mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:40:10 +01:00
Add a `Core.BigInt` type and a corresponding builtin type in the toolchain. See [corresponding section of the design](https://docs.carbon-lang.dev/docs/design/expressions/literals.html#defined-types). So far this type is not used for anything, and there is no way to create an instance of it.
641 lines
35 KiB
Plaintext
641 lines
35 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/extend_adapt.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/extend_adapt.carbon
|
|
|
|
// --- basic.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class SomeClassAdapter;
|
|
|
|
class SomeClass {
|
|
var a: i32;
|
|
var b: i32;
|
|
|
|
fn StaticMemberFunction();
|
|
|
|
fn AdapterMethod[self: SomeClassAdapter]();
|
|
}
|
|
|
|
class SomeClassAdapter {
|
|
extend adapt SomeClass;
|
|
}
|
|
|
|
fn TestStaticMemberFunction(a: SomeClassAdapter) {
|
|
a.StaticMemberFunction();
|
|
}
|
|
|
|
fn TestAdapterMethod(a: SomeClassAdapter) {
|
|
a.AdapterMethod();
|
|
}
|
|
|
|
// --- fail_todo_method_access.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class SomeClass {
|
|
fn F[self: Self]();
|
|
}
|
|
|
|
class SomeClassAdapter {
|
|
extend adapt SomeClass;
|
|
}
|
|
|
|
fn F(a: SomeClassAdapter) {
|
|
// CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+10]]:3: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass`
|
|
// CHECK:STDERR: a.F();
|
|
// CHECK:STDERR: ^
|
|
// CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE+7]]:3: note: type `SomeClassAdapter` does not implement interface `ImplicitAs`
|
|
// CHECK:STDERR: a.F();
|
|
// CHECK:STDERR: ^
|
|
// CHECK:STDERR: fail_todo_method_access.carbon:[[@LINE-14]]:8: note: initializing `self` parameter of method declared here
|
|
// CHECK:STDERR: fn F[self: Self]();
|
|
// CHECK:STDERR: ^~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
a.F();
|
|
}
|
|
|
|
// --- fail_todo_field_access.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class SomeClass {
|
|
var a: i32;
|
|
var b: i32;
|
|
}
|
|
|
|
class SomeClassAdapter {
|
|
extend adapt SomeClass;
|
|
}
|
|
|
|
fn F(a: SomeClassAdapter) -> i32 {
|
|
// CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+7]]:10: error: cannot implicitly convert from `SomeClassAdapter` to `SomeClass`
|
|
// CHECK:STDERR: return a.b;
|
|
// CHECK:STDERR: ^~~
|
|
// CHECK:STDERR: fail_todo_field_access.carbon:[[@LINE+4]]:10: note: type `SomeClassAdapter` does not implement interface `ImplicitAs`
|
|
// CHECK:STDERR: return a.b;
|
|
// CHECK:STDERR: ^~~
|
|
// CHECK:STDERR:
|
|
return a.b;
|
|
}
|
|
|
|
// --- fail_todo_adapt_non_class.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class StructAdapter {
|
|
// CHECK:STDERR: fail_todo_adapt_non_class.carbon:[[@LINE+3]]:3: error: semantics TODO: `extending non-class type`
|
|
// CHECK:STDERR: extend adapt {.a: i32, .b: i32};
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
extend adapt {.a: i32, .b: i32};
|
|
}
|
|
|
|
// CHECK:STDOUT: --- basic.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template]
|
|
// CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template]
|
|
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
|
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
|
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
|
// CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, i32 [template]
|
|
// CHECK:STDOUT: %StaticMemberFunction.type: type = fn_type @StaticMemberFunction [template]
|
|
// CHECK:STDOUT: %StaticMemberFunction: %StaticMemberFunction.type = struct_value () [template]
|
|
// CHECK:STDOUT: %AdapterMethod.type: type = fn_type @AdapterMethod [template]
|
|
// CHECK:STDOUT: %AdapterMethod: %AdapterMethod.type = struct_value () [template]
|
|
// CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template]
|
|
// CHECK:STDOUT: %.4: <witness> = complete_type_witness %.3 [template]
|
|
// CHECK:STDOUT: %.5: type = ptr_type %.3 [template]
|
|
// CHECK:STDOUT: %.6: <witness> = complete_type_witness %SomeClass [template]
|
|
// CHECK:STDOUT: %TestStaticMemberFunction.type: type = fn_type @TestStaticMemberFunction [template]
|
|
// CHECK:STDOUT: %TestStaticMemberFunction: %TestStaticMemberFunction.type = struct_value () [template]
|
|
// CHECK:STDOUT: %TestAdapterMethod.type: type = fn_type @TestAdapterMethod [template]
|
|
// CHECK:STDOUT: %TestAdapterMethod: %TestAdapterMethod.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .Int32 = %import_ref
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/operators
|
|
// CHECK:STDOUT: import Core//prelude/types
|
|
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
|
|
// CHECK:STDOUT: import Core//prelude/operators/as
|
|
// CHECK:STDOUT: import Core//prelude/operators/bitwise
|
|
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
|
// CHECK:STDOUT: import Core//prelude/types/bool
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl.loc4
|
|
// CHECK:STDOUT: .SomeClass = %SomeClass.decl
|
|
// CHECK:STDOUT: .TestStaticMemberFunction = %TestStaticMemberFunction.decl
|
|
// CHECK:STDOUT: .TestAdapterMethod = %TestAdapterMethod.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %SomeClassAdapter.decl.loc4: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
|
|
// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {}
|
|
// CHECK:STDOUT: %SomeClassAdapter.decl.loc15: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
|
|
// CHECK:STDOUT: %TestStaticMemberFunction.decl: %TestStaticMemberFunction.type = fn_decl @TestStaticMemberFunction [template = constants.%TestStaticMemberFunction] {
|
|
// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter]
|
|
// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0
|
|
// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %TestAdapterMethod.decl: %TestAdapterMethod.type = fn_decl @TestAdapterMethod [template = constants.%TestAdapterMethod] {
|
|
// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter]
|
|
// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0
|
|
// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @SomeClassAdapter {
|
|
// CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass]
|
|
// CHECK:STDOUT: adapt_decl %SomeClass
|
|
// CHECK:STDOUT: %.loc17: <witness> = complete_type_witness %SomeClass [template = constants.%.6]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%SomeClassAdapter
|
|
// CHECK:STDOUT: extend name_scope2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @SomeClass {
|
|
// CHECK:STDOUT: %int.make_type_32.loc7: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc7_10.1: type = value_of_initializer %int.make_type_32.loc7 [template = i32]
|
|
// CHECK:STDOUT: %.loc7_10.2: type = converted %int.make_type_32.loc7, %.loc7_10.1 [template = i32]
|
|
// CHECK:STDOUT: %.loc7_8: %.2 = field_decl a, element0 [template]
|
|
// CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc8_10.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32]
|
|
// CHECK:STDOUT: %.loc8_10.2: type = converted %int.make_type_32.loc8, %.loc8_10.1 [template = i32]
|
|
// CHECK:STDOUT: %.loc8_8: %.2 = field_decl b, element1 [template]
|
|
// CHECK:STDOUT: %StaticMemberFunction.decl: %StaticMemberFunction.type = fn_decl @StaticMemberFunction [template = constants.%StaticMemberFunction] {} {}
|
|
// CHECK:STDOUT: %AdapterMethod.decl: %AdapterMethod.type = fn_decl @AdapterMethod [template = constants.%AdapterMethod] {
|
|
// CHECK:STDOUT: %self.patt: %SomeClassAdapter = binding_pattern self
|
|
// CHECK:STDOUT: %self.param_patt: %SomeClassAdapter = param_pattern %self.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl.loc4 [template = constants.%SomeClassAdapter]
|
|
// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0
|
|
// CHECK:STDOUT: %self: %SomeClassAdapter = bind_name self, %param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc13: <witness> = complete_type_witness %.3 [template = constants.%.4]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%SomeClass
|
|
// CHECK:STDOUT: .a = %.loc7_8
|
|
// CHECK:STDOUT: .b = %.loc8_8
|
|
// CHECK:STDOUT: .StaticMemberFunction = %StaticMemberFunction.decl
|
|
// CHECK:STDOUT: .AdapterMethod = %AdapterMethod.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @StaticMemberFunction();
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @AdapterMethod[%self.param_patt: %SomeClassAdapter]();
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestStaticMemberFunction(%a.param_patt: %SomeClassAdapter) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
|
|
// CHECK:STDOUT: %StaticMemberFunction.ref: %StaticMemberFunction.type = name_ref StaticMemberFunction, @SomeClass.%StaticMemberFunction.decl [template = constants.%StaticMemberFunction]
|
|
// CHECK:STDOUT: %StaticMemberFunction.call: init %.1 = call %StaticMemberFunction.ref()
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @TestAdapterMethod(%a.param_patt: %SomeClassAdapter) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
|
|
// CHECK:STDOUT: %AdapterMethod.ref: %AdapterMethod.type = name_ref AdapterMethod, @SomeClass.%AdapterMethod.decl [template = constants.%AdapterMethod]
|
|
// CHECK:STDOUT: %.loc24: <bound method> = bound_method %a.ref, %AdapterMethod.ref
|
|
// CHECK:STDOUT: %AdapterMethod.call: init %.1 = call %.loc24(%a.ref)
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_method_access.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template]
|
|
// CHECK:STDOUT: %F.type.1: type = fn_type @F.1 [template]
|
|
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
|
// CHECK:STDOUT: %F.1: %F.type.1 = struct_value () [template]
|
|
// CHECK:STDOUT: %.2: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %.3: <witness> = complete_type_witness %.2 [template]
|
|
// CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template]
|
|
// CHECK:STDOUT: %.4: type = ptr_type %.2 [template]
|
|
// CHECK:STDOUT: %.5: <witness> = complete_type_witness %SomeClass [template]
|
|
// CHECK:STDOUT: %F.type.2: type = fn_type @F.2 [template]
|
|
// CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template]
|
|
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
|
|
// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
|
|
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
|
|
// CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
|
|
// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
|
|
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
|
|
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
|
|
// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
|
|
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %.6: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
|
|
// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [symbolic]
|
|
// CHECK:STDOUT: %ImplicitAs.type.3: type = interface_type @ImplicitAs, @ImplicitAs(%SomeClass) [template]
|
|
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%SomeClass) [template]
|
|
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
|
|
// CHECK:STDOUT: %.8: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
|
|
// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template]
|
|
// CHECK:STDOUT: %.10: %.6 = assoc_entity element0, imports.%import_ref.6 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .ImplicitAs = %import_ref.1
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/operators
|
|
// CHECK:STDOUT: import Core//prelude/types
|
|
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
|
|
// CHECK:STDOUT: import Core//prelude/operators/as
|
|
// CHECK:STDOUT: import Core//prelude/operators/bitwise
|
|
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
|
// CHECK:STDOUT: import Core//prelude/types/bool
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %import_ref.1: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs]
|
|
// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
|
// CHECK:STDOUT: %import_ref.3: @ImplicitAs.%.1 (%.6) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.10)]
|
|
// CHECK:STDOUT: %import_ref.4 = import_ref Core//prelude/operators/as, inst+64, unloaded
|
|
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded
|
|
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .SomeClass = %SomeClass.decl
|
|
// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {}
|
|
// CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
|
|
// CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] {
|
|
// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter]
|
|
// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0
|
|
// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
|
|
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
|
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
|
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
|
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
|
|
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
|
|
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.6)]
|
|
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.6) = assoc_entity element0, imports.%import_ref.5 [symbolic = %.2 (constants.%.7)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%import_ref.2
|
|
// CHECK:STDOUT: .Convert = imports.%import_ref.3
|
|
// CHECK:STDOUT: witness = (imports.%import_ref.4)
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @SomeClass {
|
|
// CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] {
|
|
// CHECK:STDOUT: %self.patt: %SomeClass = binding_pattern self
|
|
// CHECK:STDOUT: %self.param_patt: %SomeClass = param_pattern %self.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%SomeClass [template = constants.%SomeClass]
|
|
// CHECK:STDOUT: %param: %SomeClass = param runtime_param0
|
|
// CHECK:STDOUT: %self: %SomeClass = bind_name self, %param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc6: <witness> = complete_type_witness %.2 [template = constants.%.3]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%SomeClass
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @SomeClassAdapter {
|
|
// CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass]
|
|
// CHECK:STDOUT: adapt_decl %SomeClass
|
|
// CHECK:STDOUT: %.loc10: <witness> = complete_type_witness %SomeClass [template = constants.%.5]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%SomeClassAdapter
|
|
// CHECK:STDOUT: extend name_scope2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F.1[%self.param_patt: %SomeClass]();
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F.2(%a.param_patt: %SomeClassAdapter) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
|
|
// CHECK:STDOUT: %F.ref: %F.type.1 = name_ref F, @SomeClass.%F.decl [template = constants.%F.1]
|
|
// CHECK:STDOUT: %.loc23_4: <bound method> = bound_method %a.ref, %F.ref
|
|
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%ImplicitAs.type.3]
|
|
// CHECK:STDOUT: %.loc23_3.1: %.8 = specific_constant imports.%import_ref.3, @ImplicitAs(constants.%SomeClass) [template = constants.%.9]
|
|
// CHECK:STDOUT: %Convert.ref: %.8 = name_ref Convert, %.loc23_3.1 [template = constants.%.9]
|
|
// CHECK:STDOUT: %.loc23_3.2: %SomeClass = converted %a.ref, <error> [template = <error>]
|
|
// CHECK:STDOUT: %F.call: init %.1 = call %.loc23_4(<invalid>) [template = <error>]
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
|
|
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
|
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
|
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest);
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
|
|
// CHECK:STDOUT: %Self => constants.%Self.1
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(constants.%SomeClass) {
|
|
// CHECK:STDOUT: %Dest => constants.%SomeClass
|
|
// CHECK:STDOUT: %Dest.patt => constants.%SomeClass
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
|
|
// CHECK:STDOUT: %Self => constants.%Self.2
|
|
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
|
|
// CHECK:STDOUT: %Convert => constants.%Convert.2
|
|
// CHECK:STDOUT: %.1 => constants.%.8
|
|
// CHECK:STDOUT: %.2 => constants.%.9
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_field_access.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %SomeClass: type = class_type @SomeClass [template]
|
|
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
|
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
|
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
|
// CHECK:STDOUT: %.2: type = unbound_element_type %SomeClass, i32 [template]
|
|
// CHECK:STDOUT: %.3: type = struct_type {.a: i32, .b: i32} [template]
|
|
// CHECK:STDOUT: %.4: <witness> = complete_type_witness %.3 [template]
|
|
// CHECK:STDOUT: %SomeClassAdapter: type = class_type @SomeClassAdapter [template]
|
|
// CHECK:STDOUT: %.5: type = ptr_type %.3 [template]
|
|
// CHECK:STDOUT: %.6: <witness> = complete_type_witness %SomeClass [template]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
|
// CHECK:STDOUT: %ImplicitAs.type.1: type = generic_interface_type @ImplicitAs [template]
|
|
// CHECK:STDOUT: %ImplicitAs: %ImplicitAs.type.1 = struct_value () [template]
|
|
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
|
|
// CHECK:STDOUT: %ImplicitAs.type.2: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic]
|
|
// CHECK:STDOUT: %Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2) = bind_symbolic_name Self, 1 [symbolic]
|
|
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
|
|
// CHECK:STDOUT: %Self.2: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic]
|
|
// CHECK:STDOUT: %Convert.type.1: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
|
|
// CHECK:STDOUT: %Convert.1: %Convert.type.1 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %.7: type = assoc_entity_type %ImplicitAs.type.2, %Convert.type.1 [symbolic]
|
|
// CHECK:STDOUT: %.8: %.7 = assoc_entity element0, imports.%import_ref.6 [symbolic]
|
|
// CHECK:STDOUT: %ImplicitAs.type.3: type = interface_type @ImplicitAs, @ImplicitAs(%SomeClass) [template]
|
|
// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert, @ImplicitAs(%SomeClass) [template]
|
|
// CHECK:STDOUT: %Convert.2: %Convert.type.2 = struct_value () [template]
|
|
// CHECK:STDOUT: %.9: type = assoc_entity_type %ImplicitAs.type.3, %Convert.type.2 [template]
|
|
// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template]
|
|
// CHECK:STDOUT: %.11: %.7 = assoc_entity element0, imports.%import_ref.7 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .Int32 = %import_ref.1
|
|
// CHECK:STDOUT: .ImplicitAs = %import_ref.2
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/operators
|
|
// CHECK:STDOUT: import Core//prelude/types
|
|
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
|
|
// CHECK:STDOUT: import Core//prelude/operators/as
|
|
// CHECK:STDOUT: import Core//prelude/operators/bitwise
|
|
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
|
// CHECK:STDOUT: import Core//prelude/types/bool
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
|
|
// CHECK:STDOUT: %import_ref.2: %ImplicitAs.type.1 = import_ref Core//prelude/operators/as, inst+46, loaded [template = constants.%ImplicitAs]
|
|
// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/as, inst+52, unloaded
|
|
// CHECK:STDOUT: %import_ref.4: @ImplicitAs.%.1 (%.7) = import_ref Core//prelude/operators/as, inst+71, loaded [symbolic = @ImplicitAs.%.2 (constants.%.11)]
|
|
// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/as, inst+64, unloaded
|
|
// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/as, inst+64, unloaded
|
|
// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/as, inst+64, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .SomeClass = %SomeClass.decl
|
|
// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} {}
|
|
// CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} {}
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
|
// CHECK:STDOUT: %a.patt: %SomeClassAdapter = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %SomeClassAdapter = param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %SomeClassAdapter.ref: type = name_ref SomeClassAdapter, file.%SomeClassAdapter.decl [template = constants.%SomeClassAdapter]
|
|
// CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc13_30.1: type = value_of_initializer %int.make_type_32 [template = i32]
|
|
// CHECK:STDOUT: %.loc13_30.2: type = converted %int.make_type_32, %.loc13_30.1 [template = i32]
|
|
// CHECK:STDOUT: %return: ref i32 = var <return slot>
|
|
// CHECK:STDOUT: %param: %SomeClassAdapter = param runtime_param0
|
|
// CHECK:STDOUT: %a: %SomeClassAdapter = bind_name a, %param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic interface @ImplicitAs(constants.%Dest: type) {
|
|
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
|
// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic = %Dest.patt (constants.%Dest.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
|
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
|
// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.1)]
|
|
// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.1) = struct_value () [symbolic = %Convert (constants.%Convert.1)]
|
|
// CHECK:STDOUT: %.1: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2), @ImplicitAs.%Convert.type (%Convert.type.1) [symbolic = %.1 (constants.%.7)]
|
|
// CHECK:STDOUT: %.2: @ImplicitAs.%.1 (%.7) = assoc_entity element0, imports.%import_ref.6 [symbolic = %.2 (constants.%.8)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%import_ref.3
|
|
// CHECK:STDOUT: .Convert = imports.%import_ref.4
|
|
// CHECK:STDOUT: witness = (imports.%import_ref.5)
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @SomeClass {
|
|
// CHECK:STDOUT: %int.make_type_32.loc5: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc5_10.1: type = value_of_initializer %int.make_type_32.loc5 [template = i32]
|
|
// CHECK:STDOUT: %.loc5_10.2: type = converted %int.make_type_32.loc5, %.loc5_10.1 [template = i32]
|
|
// CHECK:STDOUT: %.loc5_8: %.2 = field_decl a, element0 [template]
|
|
// CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc6_10.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32]
|
|
// CHECK:STDOUT: %.loc6_10.2: type = converted %int.make_type_32.loc6, %.loc6_10.1 [template = i32]
|
|
// CHECK:STDOUT: %.loc6_8: %.2 = field_decl b, element1 [template]
|
|
// CHECK:STDOUT: %.loc7: <witness> = complete_type_witness %.3 [template = constants.%.4]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%SomeClass
|
|
// CHECK:STDOUT: .a = %.loc5_8
|
|
// CHECK:STDOUT: .b = %.loc6_8
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @SomeClassAdapter {
|
|
// CHECK:STDOUT: %SomeClass.ref: type = name_ref SomeClass, file.%SomeClass.decl [template = constants.%SomeClass]
|
|
// CHECK:STDOUT: adapt_decl %SomeClass
|
|
// CHECK:STDOUT: %.loc11: <witness> = complete_type_witness %SomeClass [template = constants.%.6]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%SomeClassAdapter
|
|
// CHECK:STDOUT: extend name_scope2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%a.param_patt: %SomeClassAdapter) -> i32 {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %SomeClassAdapter = name_ref a, %a
|
|
// CHECK:STDOUT: %b.ref: %.2 = name_ref b, @SomeClass.%.loc6_8 [template = @SomeClass.%.loc6_8]
|
|
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(constants.%SomeClass) [template = constants.%ImplicitAs.type.3]
|
|
// CHECK:STDOUT: %.loc21_11.1: %.9 = specific_constant imports.%import_ref.4, @ImplicitAs(constants.%SomeClass) [template = constants.%.10]
|
|
// CHECK:STDOUT: %Convert.ref: %.9 = name_ref Convert, %.loc21_11.1 [template = constants.%.10]
|
|
// CHECK:STDOUT: %.loc21_11.2: %SomeClass = converted %a.ref, <error> [template = <error>]
|
|
// CHECK:STDOUT: %.loc21_11.3: i32 = class_element_access <error>, element1 [template = <error>]
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @Convert(constants.%Dest: type, constants.%Self.1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.2)) {
|
|
// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
|
// CHECK:STDOUT: %ImplicitAs.type: type = interface_type @ImplicitAs, @ImplicitAs(%Dest) [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.2)]
|
|
// CHECK:STDOUT: %Self: %ImplicitAs.type.2 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.2)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self (%Self.2)]() -> @Convert.%Dest (%Dest);
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(constants.%Dest) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(@ImplicitAs.%Dest) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %Dest.patt => constants.%Dest
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.1) {
|
|
// CHECK:STDOUT: %Dest => constants.%Dest
|
|
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.2
|
|
// CHECK:STDOUT: %Self => constants.%Self.1
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ImplicitAs(constants.%SomeClass) {
|
|
// CHECK:STDOUT: %Dest => constants.%SomeClass
|
|
// CHECK:STDOUT: %Dest.patt => constants.%SomeClass
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.3
|
|
// CHECK:STDOUT: %Self => constants.%Self.2
|
|
// CHECK:STDOUT: %Convert.type => constants.%Convert.type.2
|
|
// CHECK:STDOUT: %Convert => constants.%Convert.2
|
|
// CHECK:STDOUT: %.1 => constants.%.9
|
|
// CHECK:STDOUT: %.2 => constants.%.10
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_adapt_non_class.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %StructAdapter: type = class_type @StructAdapter [template]
|
|
// CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
|
|
// CHECK:STDOUT: %.1: type = tuple_type () [template]
|
|
// CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
|
|
// CHECK:STDOUT: %.2: type = struct_type {.a: i32, .b: i32} [template]
|
|
// CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
|
|
// CHECK:STDOUT: %.4: <witness> = complete_type_witness %.2 [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .Int32 = %import_ref
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/operators
|
|
// CHECK:STDOUT: import Core//prelude/types
|
|
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
|
|
// CHECK:STDOUT: import Core//prelude/operators/as
|
|
// CHECK:STDOUT: import Core//prelude/operators/bitwise
|
|
// CHECK:STDOUT: import Core//prelude/operators/comparison
|
|
// CHECK:STDOUT: import Core//prelude/types/bool
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+9, loaded [template = constants.%Int32]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .StructAdapter = %StructAdapter.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @StructAdapter {
|
|
// CHECK:STDOUT: %int.make_type_32.loc8_21: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc8_21.1: type = value_of_initializer %int.make_type_32.loc8_21 [template = i32]
|
|
// CHECK:STDOUT: %.loc8_21.2: type = converted %int.make_type_32.loc8_21, %.loc8_21.1 [template = i32]
|
|
// CHECK:STDOUT: %int.make_type_32.loc8_30: init type = call constants.%Int32() [template = i32]
|
|
// CHECK:STDOUT: %.loc8_30.1: type = value_of_initializer %int.make_type_32.loc8_30 [template = i32]
|
|
// CHECK:STDOUT: %.loc8_30.2: type = converted %int.make_type_32.loc8_30, %.loc8_30.1 [template = i32]
|
|
// CHECK:STDOUT: %.loc8_33: type = struct_type {.a: i32, .b: i32} [template = constants.%.2]
|
|
// CHECK:STDOUT: adapt_decl %.2
|
|
// CHECK:STDOUT: %.loc9: <witness> = complete_type_witness %.2 [template = constants.%.4]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%StructAdapter
|
|
// CHECK:STDOUT: has_error
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
|
|
// CHECK:STDOUT:
|