|
|
@@ -34,36 +34,46 @@ impl {.i: ()} as Instance {
|
|
|
fn G[self: Self]() {}
|
|
|
}
|
|
|
|
|
|
-// --- fail_todo_import_non-instance_success.carbon
|
|
|
+// --- import_non-instance_success.carbon
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
import library "lib";
|
|
|
|
|
|
fn NonInstanceCallImport() {
|
|
|
- // CHECK:STDERR: fail_todo_import_non-instance_success.carbon:[[@LINE+4]]:3: error: cannot access member of interface `NonInstance` in type `type` that does not implement that interface [MissingImplInMemberAccess]
|
|
|
- // CHECK:STDERR: {.i: ()}.(NonInstance.F)();
|
|
|
- // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
- // CHECK:STDERR:
|
|
|
{.i: ()}.(NonInstance.F)();
|
|
|
}
|
|
|
|
|
|
-// --- todo_fail_import_non-instance.carbon
|
|
|
+// --- fail_import_non-instance.carbon
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
import library "lib";
|
|
|
import Core;
|
|
|
|
|
|
fn NonInstanceCallImportFail(n: {.i: ()}) {
|
|
|
+ // CHECK:STDERR: fail_import_non-instance.carbon:[[@LINE+7]]:3: error: cannot implicitly convert value of type `{.i: ()}` to `NonInstance` [ImplicitAsConversionFailure]
|
|
|
+ // CHECK:STDERR: n.(NonInstance.F)();
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR: fail_import_non-instance.carbon:[[@LINE+4]]:3: note: type `{.i: ()}` does not implement interface `Core.ImplicitAs(NonInstance)` [MissingImplInMemberAccessNote]
|
|
|
+ // CHECK:STDERR: n.(NonInstance.F)();
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
n.(NonInstance.F)();
|
|
|
}
|
|
|
|
|
|
-// --- todo_fail_import_non-instance_indirect.carbon
|
|
|
+// --- fail_import_non-instance_indirect.carbon
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
import library "lib";
|
|
|
import Core;
|
|
|
|
|
|
fn NonInstanceCallIndirectImport(p: {.i: ()}*) {
|
|
|
+ // CHECK:STDERR: fail_import_non-instance_indirect.carbon:[[@LINE+7]]:3: error: cannot implicitly convert value of type `{.i: ()}` to `NonInstance` [ImplicitAsConversionFailure]
|
|
|
+ // CHECK:STDERR: p->(NonInstance.F)();
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR: fail_import_non-instance_indirect.carbon:[[@LINE+4]]:3: note: type `{.i: ()}` does not implement interface `Core.ImplicitAs(NonInstance)` [MissingImplInMemberAccessNote]
|
|
|
+ // CHECK:STDERR: p->(NonInstance.F)();
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
p->(NonInstance.F)();
|
|
|
}
|
|
|
|
|
|
@@ -330,7 +340,7 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Self.as_type.loc12_14.1 => constants.%struct_type.i
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_import_non-instance_success.carbon
|
|
|
+// CHECK:STDOUT: --- import_non-instance_success.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %NonInstanceCallImport.type: type = fn_type @NonInstanceCallImport [concrete]
|
|
|
@@ -338,9 +348,17 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %NonInstanceCallImport: %NonInstanceCallImport.type = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %struct_type.i: type = struct_type {.i: %empty_tuple.type} [concrete]
|
|
|
// CHECK:STDOUT: %NonInstance.type: type = facet_type <@NonInstance> [concrete]
|
|
|
+// CHECK:STDOUT: %Self.73c: %NonInstance.type = bind_symbolic_name Self, 0 [symbolic]
|
|
|
// CHECK:STDOUT: %NonInstance.assoc_type: type = assoc_entity_type %NonInstance.type [concrete]
|
|
|
// CHECK:STDOUT: %assoc0: %NonInstance.assoc_type = assoc_entity element0, imports.%Main.import_ref.bb3 [concrete]
|
|
|
+// CHECK:STDOUT: %F.type.9e5: type = fn_type @F.1 [concrete]
|
|
|
+// CHECK:STDOUT: %F.4e4: %F.type.9e5 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %Instance.type: type = facet_type <@Instance> [concrete]
|
|
|
+// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.2d7) [concrete]
|
|
|
+// CHECK:STDOUT: %NonInstance.facet: %NonInstance.type = facet_value %struct_type.i, %impl_witness [concrete]
|
|
|
+// CHECK:STDOUT: %.582: type = fn_type_with_self_type %F.type.9e5, %NonInstance.facet [concrete]
|
|
|
+// CHECK:STDOUT: %F.type.042: type = fn_type @F.2 [concrete]
|
|
|
+// CHECK:STDOUT: %F.db4: %F.type.042 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: imports {
|
|
|
@@ -348,8 +366,9 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Main.Instance = import_ref Main//lib, Instance, unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.c55 = import_ref Main//lib, inst15 [no loc], unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.69f: %NonInstance.assoc_type = import_ref Main//lib, loc4_9, loaded [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %Main.F = import_ref Main//lib, F, unloaded
|
|
|
-// CHECK:STDOUT: %Main.import_ref.112 = import_ref Main//lib, loc7_30, unloaded
|
|
|
+// CHECK:STDOUT: %Main.F: %F.type.9e5 = import_ref Main//lib, F, loaded [concrete = constants.%F.4e4]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.f85: %NonInstance.type = import_ref Main//lib, inst15 [no loc], loaded [symbolic = constants.%Self.73c]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.826: <witness> = import_ref Main//lib, loc7_30, loaded [concrete = constants.%impl_witness]
|
|
|
// CHECK:STDOUT: %Main.import_ref.ded207.1: type = import_ref Main//lib, loc7_13, loaded [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %Main.import_ref.ef5: type = import_ref Main//lib, loc7_18, loaded [concrete = constants.%NonInstance.type]
|
|
|
// CHECK:STDOUT: %Main.import_ref.dcd = import_ref Main//lib, inst39 [no loc], unloaded
|
|
|
@@ -386,7 +405,7 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl.c58: imports.%Main.import_ref.ded207.1 as imports.%Main.import_ref.ef5 [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: witness = imports.%Main.import_ref.112
|
|
|
+// CHECK:STDOUT: witness = imports.%Main.import_ref.826
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl.477: imports.%Main.import_ref.ded207.2 as imports.%Main.import_ref.b49 [from "lib.carbon"] {
|
|
|
@@ -396,15 +415,28 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @NonInstanceCallImport() {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
-// CHECK:STDOUT: %.loc10_9.1: %empty_tuple.type = tuple_literal ()
|
|
|
-// CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
|
+// CHECK:STDOUT: %.loc6_9.1: %empty_tuple.type = tuple_literal ()
|
|
|
+// CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
|
// CHECK:STDOUT: %struct_type.i: type = struct_type {.i: %empty_tuple.type} [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %NonInstance.ref: type = name_ref NonInstance, imports.%Main.NonInstance [concrete = constants.%NonInstance.type]
|
|
|
// CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.69f [concrete = constants.%assoc0]
|
|
|
+// CHECK:STDOUT: %NonInstance.facet: %NonInstance.type = facet_value constants.%struct_type.i, constants.%impl_witness [concrete = constants.%NonInstance.facet]
|
|
|
+// CHECK:STDOUT: %.loc6_11: %NonInstance.type = converted %struct_type.i, %NonInstance.facet [concrete = constants.%NonInstance.facet]
|
|
|
+// CHECK:STDOUT: %as_wit: <witness> = facet_access_witness %.loc6_11 [concrete = constants.%impl_witness]
|
|
|
+// CHECK:STDOUT: %impl.elem0: %.582 = impl_witness_access %as_wit, element0 [concrete = constants.%F.db4]
|
|
|
+// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- todo_fail_import_non-instance.carbon
|
|
|
+// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f85: %NonInstance.type) [from "lib.carbon"] {
|
|
|
+// CHECK:STDOUT: fn();
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @F.2() [from "lib.carbon"];
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @F.1(constants.%Self.73c) {}
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_import_non-instance.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -414,26 +446,46 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %NonInstance.type: type = facet_type <@NonInstance> [concrete]
|
|
|
// CHECK:STDOUT: %Self.73c: %NonInstance.type = bind_symbolic_name Self, 0 [symbolic]
|
|
|
// CHECK:STDOUT: %NonInstance.assoc_type: type = assoc_entity_type %NonInstance.type [concrete]
|
|
|
-// CHECK:STDOUT: %assoc0: %NonInstance.assoc_type = assoc_entity element0, imports.%Main.import_ref.474 [concrete]
|
|
|
+// CHECK:STDOUT: %assoc0.3d0: %NonInstance.assoc_type = assoc_entity element0, imports.%Main.import_ref.bb3 [concrete]
|
|
|
+// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
|
+// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
|
|
|
+// CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
|
|
|
+// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
|
|
|
+// CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
|
|
|
+// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.519 [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type.837: type = assoc_entity_type %ImplicitAs.type.d62 [symbolic]
|
|
|
+// CHECK:STDOUT: %assoc0.43db8b.1: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type.a4a: type = facet_type <@ImplicitAs, @ImplicitAs(%NonInstance.type)> [concrete]
|
|
|
+// CHECK:STDOUT: %Convert.type.0a7: type = fn_type @Convert, @ImplicitAs(%NonInstance.type) [concrete]
|
|
|
+// CHECK:STDOUT: %Convert.c2d: %Convert.type.0a7 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type.ffd: type = assoc_entity_type %ImplicitAs.type.a4a [concrete]
|
|
|
+// CHECK:STDOUT: %assoc0.ff2: %ImplicitAs.assoc_type.ffd = assoc_entity element0, imports.%Core.import_ref.207961.1 [concrete]
|
|
|
+// CHECK:STDOUT: %assoc0.43db8b.2: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.2 [symbolic]
|
|
|
// CHECK:STDOUT: %Instance.type: type = facet_type <@Instance> [concrete]
|
|
|
-// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.2d7) [concrete]
|
|
|
-// CHECK:STDOUT: %F.type.9e5: type = fn_type @F.1 [concrete]
|
|
|
-// CHECK:STDOUT: %NonInstance.facet: %NonInstance.type = facet_value %struct_type.i, %impl_witness [concrete]
|
|
|
-// CHECK:STDOUT: %.582: type = fn_type_with_self_type %F.type.9e5, %NonInstance.facet [concrete]
|
|
|
-// CHECK:STDOUT: %F.type.042: type = fn_type @F.2 [concrete]
|
|
|
-// CHECK:STDOUT: %F.db4: %F.type.042 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: imports {
|
|
|
// CHECK:STDOUT: %Main.NonInstance: type = import_ref Main//lib, NonInstance, loaded [concrete = constants.%NonInstance.type]
|
|
|
// CHECK:STDOUT: %Main.Instance = import_ref Main//lib, Instance, unloaded
|
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
|
+// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
|
|
// CHECK:STDOUT: import Core//default
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %Main.import_ref.c55 = import_ref Main//lib, inst15 [no loc], unloaded
|
|
|
-// CHECK:STDOUT: %Main.import_ref.69f: %NonInstance.assoc_type = import_ref Main//lib, loc4_9, loaded [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %Main.F = import_ref Main//lib, F, unloaded
|
|
|
-// CHECK:STDOUT: %Main.import_ref.826: <witness> = import_ref Main//lib, loc7_30, loaded [concrete = constants.%impl_witness]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.69f: %NonInstance.assoc_type = import_ref Main//lib, loc4_9, loaded [concrete = constants.%assoc0.3d0]
|
|
|
+// CHECK:STDOUT: %Main.F: %F.type = import_ref Main//lib, F, loaded [concrete = constants.%F]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.f85: %NonInstance.type = import_ref Main//lib, inst15 [no loc], loaded [symbolic = constants.%Self.73c]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst24 [no loc], unloaded
|
|
|
+// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc4_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)]
|
|
|
+// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst24 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc4_35, unloaded
|
|
|
+// CHECK:STDOUT: %Main.import_ref.112 = import_ref Main//lib, loc7_30, unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.ded207.1: type = import_ref Main//lib, loc7_13, loaded [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %Main.import_ref.ef5: type = import_ref Main//lib, loc7_18, loaded [concrete = constants.%NonInstance.type]
|
|
|
// CHECK:STDOUT: %Main.import_ref.dcd = import_ref Main//lib, inst39 [no loc], unloaded
|
|
|
@@ -442,7 +494,6 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Main.import_ref.ab2 = import_ref Main//lib, loc15_27, unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.ded207.2: type = import_ref Main//lib, loc15_13, loaded [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %Main.import_ref.b49: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type]
|
|
|
-// CHECK:STDOUT: %Main.import_ref.f85: %NonInstance.type = import_ref Main//lib, inst15 [no loc], loaded [symbolic = constants.%Self.73c]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: file {
|
|
|
@@ -475,6 +526,26 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: witness = (imports.%Main.F)
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] {
|
|
|
+// 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 = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
|
|
|
+// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
|
|
|
+// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)]
|
|
|
+// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.837)]
|
|
|
+// CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic = %assoc0 (constants.%assoc0.43db8b.1)]
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: interface {
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
|
|
|
+// CHECK:STDOUT: .Convert = imports.%Core.import_ref.630
|
|
|
+// CHECK:STDOUT: witness = (imports.%Core.Convert)
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: interface @Instance [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: !members:
|
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.dcd
|
|
|
@@ -484,7 +555,7 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl.c58: imports.%Main.import_ref.ded207.1 as imports.%Main.import_ref.ef5 [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: witness = imports.%Main.import_ref.826
|
|
|
+// CHECK:STDOUT: witness = imports.%Main.import_ref.112
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl.477: imports.%Main.import_ref.ded207.2 as imports.%Main.import_ref.b49 [from "lib.carbon"] {
|
|
|
@@ -496,21 +567,56 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
// CHECK:STDOUT: %n.ref: %struct_type.i = name_ref n, %n
|
|
|
// CHECK:STDOUT: %NonInstance.ref: type = name_ref NonInstance, imports.%Main.NonInstance [concrete = constants.%NonInstance.type]
|
|
|
-// CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.69f [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %impl.elem0: %.582 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%F.db4]
|
|
|
-// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
|
|
|
+// CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.69f [concrete = constants.%assoc0.3d0]
|
|
|
+// CHECK:STDOUT: %.loc14: %NonInstance.type = converted %n.ref, <error> [concrete = <error>]
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f85: %NonInstance.type) [from "lib.carbon"] {
|
|
|
+// CHECK:STDOUT: generic fn @F(imports.%Main.import_ref.f85: %NonInstance.type) [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: fn();
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: fn @F.2() [from "lib.carbon"];
|
|
|
+// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] {
|
|
|
+// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
|
|
|
+// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
|
|
|
+// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: specific @F.1(constants.%Self.73c) {}
|
|
|
+// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type)]() -> @Convert.%Dest (%Dest);
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @F(constants.%Self.73c) {}
|
|
|
+// 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: --- todo_fail_import_non-instance_indirect.carbon
|
|
|
+// CHECK:STDOUT: specific @ImplicitAs(%Dest) {}
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {}
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
|
|
|
+// CHECK:STDOUT: %Dest => constants.%Dest
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
|
|
|
+// CHECK:STDOUT: %Self => constants.%Self.519
|
|
|
+// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @ImplicitAs(constants.%NonInstance.type) {
|
|
|
+// CHECK:STDOUT: %Dest => constants.%NonInstance.type
|
|
|
+// CHECK:STDOUT: %Dest.patt => constants.%NonInstance.type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !definition:
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.a4a
|
|
|
+// CHECK:STDOUT: %Self => constants.%Self.519
|
|
|
+// CHECK:STDOUT: %Convert.type => constants.%Convert.type.0a7
|
|
|
+// CHECK:STDOUT: %Convert => constants.%Convert.c2d
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.ffd
|
|
|
+// CHECK:STDOUT: %assoc0 => constants.%assoc0.ff2
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_import_non-instance_indirect.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -521,26 +627,46 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %NonInstance.type: type = facet_type <@NonInstance> [concrete]
|
|
|
// CHECK:STDOUT: %Self.73c: %NonInstance.type = bind_symbolic_name Self, 0 [symbolic]
|
|
|
// CHECK:STDOUT: %NonInstance.assoc_type: type = assoc_entity_type %NonInstance.type [concrete]
|
|
|
-// CHECK:STDOUT: %assoc0: %NonInstance.assoc_type = assoc_entity element0, imports.%Main.import_ref.474 [concrete]
|
|
|
+// CHECK:STDOUT: %assoc0.3d0: %NonInstance.assoc_type = assoc_entity element0, imports.%Main.import_ref.bb3 [concrete]
|
|
|
+// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
|
+// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type.d62: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic]
|
|
|
+// CHECK:STDOUT: %Self.519: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic]
|
|
|
+// CHECK:STDOUT: %Dest.patt: type = symbolic_binding_pattern Dest, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %Convert.type.275: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic]
|
|
|
+// CHECK:STDOUT: %Convert.42e: %Convert.type.275 = struct_value () [symbolic]
|
|
|
+// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.519 [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type.837: type = assoc_entity_type %ImplicitAs.type.d62 [symbolic]
|
|
|
+// CHECK:STDOUT: %assoc0.43db8b.1: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type.a4a: type = facet_type <@ImplicitAs, @ImplicitAs(%NonInstance.type)> [concrete]
|
|
|
+// CHECK:STDOUT: %Convert.type.0a7: type = fn_type @Convert, @ImplicitAs(%NonInstance.type) [concrete]
|
|
|
+// CHECK:STDOUT: %Convert.c2d: %Convert.type.0a7 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type.ffd: type = assoc_entity_type %ImplicitAs.type.a4a [concrete]
|
|
|
+// CHECK:STDOUT: %assoc0.ff2: %ImplicitAs.assoc_type.ffd = assoc_entity element0, imports.%Core.import_ref.207961.1 [concrete]
|
|
|
+// CHECK:STDOUT: %assoc0.43db8b.2: %ImplicitAs.assoc_type.837 = assoc_entity element0, imports.%Core.import_ref.207961.2 [symbolic]
|
|
|
// CHECK:STDOUT: %Instance.type: type = facet_type <@Instance> [concrete]
|
|
|
-// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.2d7) [concrete]
|
|
|
-// CHECK:STDOUT: %F.type.9e5: type = fn_type @F.1 [concrete]
|
|
|
-// CHECK:STDOUT: %NonInstance.facet: %NonInstance.type = facet_value %struct_type.i, %impl_witness [concrete]
|
|
|
-// CHECK:STDOUT: %.582: type = fn_type_with_self_type %F.type.9e5, %NonInstance.facet [concrete]
|
|
|
-// CHECK:STDOUT: %F.type.042: type = fn_type @F.2 [concrete]
|
|
|
-// CHECK:STDOUT: %F.db4: %F.type.042 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: imports {
|
|
|
// CHECK:STDOUT: %Main.NonInstance: type = import_ref Main//lib, NonInstance, loaded [concrete = constants.%NonInstance.type]
|
|
|
// CHECK:STDOUT: %Main.Instance = import_ref Main//lib, Instance, unloaded
|
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
|
+// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
|
|
// CHECK:STDOUT: import Core//default
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %Main.import_ref.c55 = import_ref Main//lib, inst15 [no loc], unloaded
|
|
|
-// CHECK:STDOUT: %Main.import_ref.69f: %NonInstance.assoc_type = import_ref Main//lib, loc4_9, loaded [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %Main.F = import_ref Main//lib, F, unloaded
|
|
|
-// CHECK:STDOUT: %Main.import_ref.826: <witness> = import_ref Main//lib, loc7_30, loaded [concrete = constants.%impl_witness]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.69f: %NonInstance.assoc_type = import_ref Main//lib, loc4_9, loaded [concrete = constants.%assoc0.3d0]
|
|
|
+// CHECK:STDOUT: %Main.F: %F.type = import_ref Main//lib, F, loaded [concrete = constants.%F]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.f85: %NonInstance.type = import_ref Main//lib, inst15 [no loc], loaded [symbolic = constants.%Self.73c]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.ff5 = import_ref Core//default, inst24 [no loc], unloaded
|
|
|
+// CHECK:STDOUT: %Core.import_ref.630: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = import_ref Core//default, loc4_35, loaded [symbolic = @ImplicitAs.%assoc0 (constants.%assoc0.43db8b.2)]
|
|
|
+// CHECK:STDOUT: %Core.Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = import_ref Core//default, Convert, loaded [symbolic = @ImplicitAs.%Convert (constants.%Convert.42e)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) = import_ref Core//default, inst24 [no loc], loaded [symbolic = @ImplicitAs.%Self (constants.%Self.519)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.207961.1 = import_ref Core//default, loc4_35, unloaded
|
|
|
+// CHECK:STDOUT: %Main.import_ref.112 = import_ref Main//lib, loc7_30, unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.ded207.1: type = import_ref Main//lib, loc7_13, loaded [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %Main.import_ref.ef5: type = import_ref Main//lib, loc7_18, loaded [concrete = constants.%NonInstance.type]
|
|
|
// CHECK:STDOUT: %Main.import_ref.dcd = import_ref Main//lib, inst39 [no loc], unloaded
|
|
|
@@ -549,7 +675,6 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Main.import_ref.ab2 = import_ref Main//lib, loc15_27, unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.ded207.2: type = import_ref Main//lib, loc15_13, loaded [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %Main.import_ref.b49: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type]
|
|
|
-// CHECK:STDOUT: %Main.import_ref.f85: %NonInstance.type = import_ref Main//lib, inst15 [no loc], loaded [symbolic = constants.%Self.73c]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: file {
|
|
|
@@ -583,6 +708,26 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: witness = (imports.%Main.F)
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: generic interface @ImplicitAs(imports.%Core.import_ref.5ab3ec.1: type) [from "core.carbon"] {
|
|
|
+// 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 = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
|
|
|
+// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
|
|
|
+// CHECK:STDOUT: %Convert.type: type = fn_type @Convert, @ImplicitAs(%Dest) [symbolic = %Convert.type (constants.%Convert.type.275)]
|
|
|
+// CHECK:STDOUT: %Convert: @ImplicitAs.%Convert.type (%Convert.type.275) = struct_value () [symbolic = %Convert (constants.%Convert.42e)]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type: type = assoc_entity_type @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62) [symbolic = %ImplicitAs.assoc_type (constants.%ImplicitAs.assoc_type.837)]
|
|
|
+// CHECK:STDOUT: %assoc0: @ImplicitAs.%ImplicitAs.assoc_type (%ImplicitAs.assoc_type.837) = assoc_entity element0, imports.%Core.import_ref.207961.1 [symbolic = %assoc0 (constants.%assoc0.43db8b.1)]
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: interface {
|
|
|
+// CHECK:STDOUT: !members:
|
|
|
+// CHECK:STDOUT: .Self = imports.%Core.import_ref.ff5
|
|
|
+// CHECK:STDOUT: .Convert = imports.%Core.import_ref.630
|
|
|
+// CHECK:STDOUT: witness = (imports.%Core.Convert)
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: interface @Instance [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: !members:
|
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.dcd
|
|
|
@@ -592,7 +737,7 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl.c58: imports.%Main.import_ref.ded207.1 as imports.%Main.import_ref.ef5 [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: witness = imports.%Main.import_ref.826
|
|
|
+// CHECK:STDOUT: witness = imports.%Main.import_ref.112
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: impl @impl.477: imports.%Main.import_ref.ded207.2 as imports.%Main.import_ref.b49 [from "lib.carbon"] {
|
|
|
@@ -604,20 +749,55 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
// CHECK:STDOUT: %p.ref: %ptr = name_ref p, %p
|
|
|
// CHECK:STDOUT: %NonInstance.ref: type = name_ref NonInstance, imports.%Main.NonInstance [concrete = constants.%NonInstance.type]
|
|
|
-// CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.69f [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %.loc7: ref %struct_type.i = deref %p.ref
|
|
|
-// CHECK:STDOUT: %impl.elem0: %.582 = impl_witness_access constants.%impl_witness, element0 [concrete = constants.%F.db4]
|
|
|
-// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %impl.elem0()
|
|
|
+// CHECK:STDOUT: %F.ref: %NonInstance.assoc_type = name_ref F, imports.%Main.import_ref.69f [concrete = constants.%assoc0.3d0]
|
|
|
+// CHECK:STDOUT: %.loc14_4.1: ref %struct_type.i = deref %p.ref
|
|
|
+// CHECK:STDOUT: %.loc14_4.2: %NonInstance.type = converted %.loc14_4.1, <error> [concrete = <error>]
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: generic fn @F.1(imports.%Main.import_ref.f85: %NonInstance.type) [from "lib.carbon"] {
|
|
|
+// CHECK:STDOUT: generic fn @F(imports.%Main.import_ref.f85: %NonInstance.type) [from "lib.carbon"] {
|
|
|
// CHECK:STDOUT: fn();
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: fn @F.2() [from "lib.carbon"];
|
|
|
+// CHECK:STDOUT: generic fn @Convert(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.ce1: @ImplicitAs.%ImplicitAs.type (%ImplicitAs.type.d62)) [from "core.carbon"] {
|
|
|
+// CHECK:STDOUT: %Dest: type = bind_symbolic_name Dest, 0 [symbolic = %Dest (constants.%Dest)]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type: type = facet_type <@ImplicitAs, @ImplicitAs(%Dest)> [symbolic = %ImplicitAs.type (constants.%ImplicitAs.type.d62)]
|
|
|
+// CHECK:STDOUT: %Self: %ImplicitAs.type.d62 = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.519)]
|
|
|
+// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: specific @F.1(constants.%Self.73c) {}
|
|
|
+// CHECK:STDOUT: fn[%self.param_patt: @Convert.%Self.as_type (%Self.as_type)]() -> @Convert.%Dest (%Dest);
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @F(constants.%Self.73c) {}
|
|
|
+// 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(%Dest) {}
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @ImplicitAs(@Convert.%Dest) {}
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @Convert(constants.%Dest, constants.%Self.519) {
|
|
|
+// CHECK:STDOUT: %Dest => constants.%Dest
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.d62
|
|
|
+// CHECK:STDOUT: %Self => constants.%Self.519
|
|
|
+// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @ImplicitAs(constants.%NonInstance.type) {
|
|
|
+// CHECK:STDOUT: %Dest => constants.%NonInstance.type
|
|
|
+// CHECK:STDOUT: %Dest.patt => constants.%NonInstance.type
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: !definition:
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type => constants.%ImplicitAs.type.a4a
|
|
|
+// CHECK:STDOUT: %Self => constants.%Self.519
|
|
|
+// CHECK:STDOUT: %Convert.type => constants.%Convert.type.0a7
|
|
|
+// CHECK:STDOUT: %Convert => constants.%Convert.c2d
|
|
|
+// CHECK:STDOUT: %ImplicitAs.assoc_type => constants.%ImplicitAs.assoc_type.ffd
|
|
|
+// CHECK:STDOUT: %assoc0 => constants.%assoc0.ff2
|
|
|
+// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: --- import_instance_success.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
@@ -630,10 +810,11 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Self.cf8: %Instance.type = bind_symbolic_name Self, 0 [symbolic]
|
|
|
// CHECK:STDOUT: %Instance.assoc_type: type = assoc_entity_type %Instance.type [concrete]
|
|
|
// CHECK:STDOUT: %assoc0: %Instance.assoc_type = assoc_entity element0, imports.%Main.import_ref.b4d [concrete]
|
|
|
-// CHECK:STDOUT: %NonInstance.type: type = facet_type <@NonInstance> [concrete]
|
|
|
-// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.373) [concrete]
|
|
|
// CHECK:STDOUT: %G.type.1e1: type = fn_type @G.1 [concrete]
|
|
|
+// CHECK:STDOUT: %G.449: %G.type.1e1 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.cf8 [symbolic]
|
|
|
+// CHECK:STDOUT: %NonInstance.type: type = facet_type <@NonInstance> [concrete]
|
|
|
+// CHECK:STDOUT: %impl_witness: <witness> = impl_witness (imports.%Main.import_ref.373) [concrete]
|
|
|
// CHECK:STDOUT: %Instance.facet: %Instance.type = facet_value %struct_type.i, %impl_witness [concrete]
|
|
|
// CHECK:STDOUT: %.6d8: type = fn_type_with_self_type %G.type.1e1, %Instance.facet [concrete]
|
|
|
// CHECK:STDOUT: %G.type.0c0: type = fn_type @G.2 [concrete]
|
|
|
@@ -650,7 +831,8 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Main.Instance: type = import_ref Main//lib, Instance, loaded [concrete = constants.%Instance.type]
|
|
|
// CHECK:STDOUT: %Main.import_ref.dcd = import_ref Main//lib, inst39 [no loc], unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.7cb: %Instance.assoc_type = import_ref Main//lib, loc12_21, loaded [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %Main.G = import_ref Main//lib, G, unloaded
|
|
|
+// CHECK:STDOUT: %Main.G: %G.type.1e1 = import_ref Main//lib, G, loaded [concrete = constants.%G.449]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.0d8: %Instance.type = import_ref Main//lib, inst39 [no loc], loaded [symbolic = constants.%Self.cf8]
|
|
|
// CHECK:STDOUT: %Main.import_ref.c55 = import_ref Main//lib, inst15 [no loc], unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.93f = import_ref Main//lib, loc4_9, unloaded
|
|
|
// CHECK:STDOUT: %Main.F = import_ref Main//lib, F, unloaded
|
|
|
@@ -660,7 +842,6 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %Main.import_ref.97c: <witness> = import_ref Main//lib, loc15_27, loaded [concrete = constants.%impl_witness]
|
|
|
// CHECK:STDOUT: %Main.import_ref.ded207.2: type = import_ref Main//lib, loc15_13, loaded [concrete = constants.%struct_type.i]
|
|
|
// CHECK:STDOUT: %Main.import_ref.b49: type = import_ref Main//lib, loc15_18, loaded [concrete = constants.%Instance.type]
|
|
|
-// CHECK:STDOUT: %Main.import_ref.0d8: %Instance.type = import_ref Main//lib, inst39 [no loc], loaded [symbolic = constants.%Self.cf8]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: file {
|
|
|
@@ -772,8 +953,12 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: %InstanceCallImportFail: %InstanceCallImportFail.type = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %struct_type.i: type = struct_type {.i: %empty_tuple.type} [concrete]
|
|
|
// CHECK:STDOUT: %Instance.type: type = facet_type <@Instance> [concrete]
|
|
|
+// CHECK:STDOUT: %Self.cf8: %Instance.type = bind_symbolic_name Self, 0 [symbolic]
|
|
|
// CHECK:STDOUT: %Instance.assoc_type: type = assoc_entity_type %Instance.type [concrete]
|
|
|
// CHECK:STDOUT: %assoc0: %Instance.assoc_type = assoc_entity element0, imports.%Main.import_ref.19f [concrete]
|
|
|
+// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
|
|
+// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.cf8 [symbolic]
|
|
|
// CHECK:STDOUT: %NonInstance.type: type = facet_type <@NonInstance> [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
@@ -785,7 +970,8 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %Main.import_ref.dcd = import_ref Main//lib, inst39 [no loc], unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.7cb: %Instance.assoc_type = import_ref Main//lib, loc12_21, loaded [concrete = constants.%assoc0]
|
|
|
-// CHECK:STDOUT: %Main.G = import_ref Main//lib, G, unloaded
|
|
|
+// CHECK:STDOUT: %Main.G: %G.type = import_ref Main//lib, G, loaded [concrete = constants.%G]
|
|
|
+// CHECK:STDOUT: %Main.import_ref.0d8: %Instance.type = import_ref Main//lib, inst39 [no loc], loaded [symbolic = constants.%Self.cf8]
|
|
|
// CHECK:STDOUT: %Main.import_ref.c55 = import_ref Main//lib, inst15 [no loc], unloaded
|
|
|
// CHECK:STDOUT: %Main.import_ref.93f = import_ref Main//lib, loc4_9, unloaded
|
|
|
// CHECK:STDOUT: %Main.F = import_ref Main//lib, F, unloaded
|
|
|
@@ -843,3 +1029,15 @@ fn InstanceCallImportFail() {
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: generic fn @G(imports.%Main.import_ref.0d8: %Instance.type) [from "lib.carbon"] {
|
|
|
+// CHECK:STDOUT: %Self: %Instance.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self.cf8)]
|
|
|
+// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)]
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn[%self.param_patt: @G.%Self.as_type (%Self.as_type)]();
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: specific @G(constants.%Self.cf8) {
|
|
|
+// CHECK:STDOUT: %Self => constants.%Self.cf8
|
|
|
+// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|