mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:10:12 +01:00
Add ranges to where_expr tests (#5630)
Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
This commit is contained in:
co-authored by
josh11b
parent
07aec169e1
commit
ed82f7ef3f
+49
-522
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/constraints.carbon
|
||||
@@ -22,11 +19,13 @@ interface I {
|
||||
let Second:! J;
|
||||
}
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn EqualEqual(U:! I where .Self == ());
|
||||
|
||||
fn Impls(V:! J where .Self impls I);
|
||||
|
||||
fn And(W:! I where .Self impls J and .Member == ());
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- associated_type_impls.carbon
|
||||
|
||||
@@ -39,7 +38,9 @@ interface K {
|
||||
let Associated:! L;
|
||||
}
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn AssociatedTypeImpls(W:! K where .Associated impls M);
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- fail_left_of_impls_non_type.carbon
|
||||
|
||||
@@ -92,7 +93,7 @@ fn DoesNotImplI() {
|
||||
// CHECK:STDERR: Impls(C);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_enforce_impls_constraint.carbon:[[@LINE-10]]:1: in import [InImport]
|
||||
// CHECK:STDERR: state_constraints.carbon:13:10: note: initializing generic parameter `V` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: state_constraints.carbon:14:10: note: initializing generic parameter `V` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn Impls(V:! J where .Self impls I);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
@@ -128,12 +129,9 @@ fn NotEmptyStruct() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
|
||||
// CHECK:STDOUT: %Self.ccd: %J.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
||||
// CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Member [concrete]
|
||||
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%Second [concrete]
|
||||
// CHECK:STDOUT: %.Self.258: %I.type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %I_where.type.cad: type = facet_type <@I where TODO> [concrete]
|
||||
@@ -150,7 +148,6 @@ fn NotEmptyStruct() {
|
||||
// CHECK:STDOUT: %Impls: %Impls.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.Self.as_type.541: type = facet_access_type %.Self.258 [symbolic_self]
|
||||
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.258, @I [symbolic_self]
|
||||
// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type.541, (%I.lookup_impl_witness) [symbolic_self]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
|
||||
// CHECK:STDOUT: %I_where.type.427: type = facet_type <@I where .Self impls @J and TODO> [concrete]
|
||||
// CHECK:STDOUT: %W: %I_where.type.427 = bind_symbolic_name W, 0 [symbolic]
|
||||
@@ -160,163 +157,105 @@ fn NotEmptyStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .J = %J.decl
|
||||
// CHECK:STDOUT: .I = %I.decl
|
||||
// CHECK:STDOUT: .EqualEqual = %EqualEqual.decl
|
||||
// CHECK:STDOUT: .Impls = %Impls.decl
|
||||
// CHECK:STDOUT: .And = %And.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
|
||||
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
|
||||
// CHECK:STDOUT: %EqualEqual.decl: %EqualEqual.type = fn_decl @EqualEqual [concrete = constants.%EqualEqual] {
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.f03 = symbolic_binding_pattern U, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc11_21.1: type = splice_block %.loc11_21.2 [concrete = constants.%I_where.type.cad] {
|
||||
// CHECK:STDOUT: %.loc12_21.1: type = splice_block %.loc12_21.2 [concrete = constants.%I_where.type.cad] {
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %.loc11_37: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc11_21.2: type = where_expr %.Self [concrete = constants.%I_where.type.cad] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc11_37
|
||||
// CHECK:STDOUT: %.loc12_37: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc12_21.2: type = where_expr %.Self [concrete = constants.%I_where.type.cad] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc12_37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc11_15.1: %I_where.type.cad = bind_symbolic_name U, 0 [symbolic = %U.loc11_15.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.loc12_15.1: %I_where.type.cad = bind_symbolic_name U, 0 [symbolic = %U.loc12_15.2 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Impls.decl: %Impls.type = fn_decl @Impls [concrete = constants.%Impls] {
|
||||
// CHECK:STDOUT: %V.patt: %pattern_type.d2b = symbolic_binding_pattern V, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc13_16.1: type = splice_block %.loc13_16.2 [concrete = constants.%J_where.type] {
|
||||
// CHECK:STDOUT: %.loc14_16.1: type = splice_block %.loc14_16.2 [concrete = constants.%J_where.type] {
|
||||
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.968]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.968]
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.78d]
|
||||
// CHECK:STDOUT: %.loc13_22: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
|
||||
// CHECK:STDOUT: %.loc13_16.2: type = where_expr %.Self [concrete = constants.%J_where.type] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc13_22, %I.ref
|
||||
// CHECK:STDOUT: %.loc14_22: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.78d]
|
||||
// CHECK:STDOUT: %.loc14_16.2: type = where_expr %.Self [concrete = constants.%J_where.type] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc14_22, %I.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %V.loc13_10.1: %J_where.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_10.2 (constants.%V)]
|
||||
// CHECK:STDOUT: %V.loc14_10.1: %J_where.type = bind_symbolic_name V, 0 [symbolic = %V.loc14_10.2 (constants.%V)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [concrete = constants.%And] {
|
||||
// CHECK:STDOUT: %W.patt: %pattern_type.127 = symbolic_binding_pattern W, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc15_14.1: type = splice_block %.loc15_14.2 [concrete = constants.%I_where.type.427] {
|
||||
// CHECK:STDOUT: %.loc16_14.1: type = splice_block %.loc16_14.2 [concrete = constants.%I_where.type.427] {
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %.Self.ref.loc15_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref.loc16_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc15_20: type = facet_access_type %.Self.ref.loc15_20 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.loc15_20: type = converted %.Self.ref.loc15_20, %.Self.as_type.loc15_20 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.Self.ref.loc15_38: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc16_20: type = facet_access_type %.Self.ref.loc16_20 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.loc16_20: type = converted %.Self.ref.loc16_20, %.Self.as_type.loc16_20 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.Self.ref.loc16_38: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %Member.ref: %I.assoc_type = name_ref Member, @Member.%assoc0 [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc15_38: type = facet_access_type %.Self.ref.loc15_38 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.loc15_38: type = converted %.Self.ref.loc15_38, %.Self.as_type.loc15_38 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc16_38: type = facet_access_type %.Self.ref.loc16_38 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %.loc16_38: type = converted %.Self.ref.loc16_38, %.Self.as_type.loc16_38 [symbolic_self = constants.%.Self.as_type.541]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
|
||||
// CHECK:STDOUT: %.loc15_50: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc15_14.2: type = where_expr %.Self [concrete = constants.%I_where.type.427] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc15_20, %J.ref
|
||||
// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc15_50
|
||||
// CHECK:STDOUT: %.loc16_50: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc16_14.2: type = where_expr %.Self [concrete = constants.%I_where.type.427] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc16_20, %J.ref
|
||||
// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc16_50
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %W.loc15_8.1: %I_where.type.427 = bind_symbolic_name W, 0 [symbolic = %W.loc15_8.2 (constants.%W)]
|
||||
// CHECK:STDOUT: %W.loc16_8.1: %I_where.type.427 = bind_symbolic_name W, 0 [symbolic = %W.loc16_8.2 (constants.%W)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @J {
|
||||
// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.ccd]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826]
|
||||
// CHECK:STDOUT: %Member: type = assoc_const_decl @Member [concrete] {
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Member [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Second: %J.type = assoc_const_decl @Second [concrete] {
|
||||
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.%Second [concrete = constants.%assoc1]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .Member = @Member.%assoc0
|
||||
// CHECK:STDOUT: .J = <poisoned>
|
||||
// CHECK:STDOUT: .Second = @Second.%assoc1
|
||||
// CHECK:STDOUT: witness = (%Member, %Second)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @Member(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: assoc_const Member:! type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @Second(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: assoc_const Second:! %J.type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @EqualEqual(%U.loc11_15.1: %I_where.type.cad) {
|
||||
// CHECK:STDOUT: %U.loc11_15.2: %I_where.type.cad = bind_symbolic_name U, 0 [symbolic = %U.loc11_15.2 (constants.%U)]
|
||||
// CHECK:STDOUT: generic fn @EqualEqual(%U.loc12_15.1: %I_where.type.cad) {
|
||||
// CHECK:STDOUT: %U.loc12_15.2: %I_where.type.cad = bind_symbolic_name U, 0 [symbolic = %U.loc12_15.2 (constants.%U)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Impls(%V.loc13_10.1: %J_where.type) {
|
||||
// CHECK:STDOUT: %V.loc13_10.2: %J_where.type = bind_symbolic_name V, 0 [symbolic = %V.loc13_10.2 (constants.%V)]
|
||||
// CHECK:STDOUT: generic fn @Impls(%V.loc14_10.1: %J_where.type) {
|
||||
// CHECK:STDOUT: %V.loc14_10.2: %J_where.type = bind_symbolic_name V, 0 [symbolic = %V.loc14_10.2 (constants.%V)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @And(%W.loc15_8.1: %I_where.type.427) {
|
||||
// CHECK:STDOUT: %W.loc15_8.2: %I_where.type.427 = bind_symbolic_name W, 0 [symbolic = %W.loc15_8.2 (constants.%W)]
|
||||
// CHECK:STDOUT: generic fn @And(%W.loc16_8.1: %I_where.type.427) {
|
||||
// CHECK:STDOUT: %W.loc16_8.2: %I_where.type.427 = bind_symbolic_name W, 0 [symbolic = %W.loc16_8.2 (constants.%W)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Member(constants.%Self.826) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Second(constants.%Self.826) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @EqualEqual(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc11_15.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.loc12_15.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Impls(constants.%V) {
|
||||
// CHECK:STDOUT: %V.loc13_10.2 => constants.%V
|
||||
// CHECK:STDOUT: %V.loc14_10.2 => constants.%V
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Member(constants.%I.facet) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @And(constants.%W) {
|
||||
// CHECK:STDOUT: %W.loc15_8.2 => constants.%W
|
||||
// CHECK:STDOUT: %W.loc16_8.2 => constants.%W
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- associated_type_impls.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %L.type: type = facet_type <@L> [concrete]
|
||||
// CHECK:STDOUT: %Self.1d2: %L.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete]
|
||||
// CHECK:STDOUT: %Self.bcc: %M.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %K.type: type = facet_type <@K> [concrete]
|
||||
// CHECK:STDOUT: %Self.09f: %K.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type @K [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%Associated [concrete]
|
||||
// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
|
||||
// CHECK:STDOUT: %K.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @K [symbolic_self]
|
||||
// CHECK:STDOUT: %K.facet: %K.type = facet_value %.Self.as_type, (%K.lookup_impl_witness) [symbolic_self]
|
||||
// CHECK:STDOUT: %impl.elem0: %L.type = impl_witness_access %K.lookup_impl_witness, element0 [symbolic_self]
|
||||
// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic_self]
|
||||
// CHECK:STDOUT: %K_where.type: type = facet_type <@K where TODO> [concrete]
|
||||
@@ -327,450 +266,38 @@ fn NotEmptyStruct() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .L = %L.decl
|
||||
// CHECK:STDOUT: .M = %M.decl
|
||||
// CHECK:STDOUT: .K = %K.decl
|
||||
// CHECK:STDOUT: .AssociatedTypeImpls = %AssociatedTypeImpls.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %L.decl: type = interface_decl @L [concrete = constants.%L.type] {} {}
|
||||
// CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {}
|
||||
// CHECK:STDOUT: %K.decl: type = interface_decl @K [concrete = constants.%K.type] {} {}
|
||||
// CHECK:STDOUT: %AssociatedTypeImpls.decl: %AssociatedTypeImpls.type = fn_decl @AssociatedTypeImpls [concrete = constants.%AssociatedTypeImpls] {
|
||||
// CHECK:STDOUT: %W.patt: %pattern_type = symbolic_binding_pattern W, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc11_30.1: type = splice_block %.loc11_30.2 [concrete = constants.%K_where.type] {
|
||||
// CHECK:STDOUT: %.loc12_30.1: type = splice_block %.loc12_30.2 [concrete = constants.%K_where.type] {
|
||||
// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type]
|
||||
// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %Associated.ref: %K.assoc_type = name_ref Associated, @Associated.%assoc0 [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc11_36.1: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc12_36.1: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %impl.elem0: %L.type = impl_witness_access constants.%K.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
|
||||
// CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
|
||||
// CHECK:STDOUT: %as_type: type = facet_access_type %impl.elem0 [symbolic_self = constants.%as_type]
|
||||
// CHECK:STDOUT: %.loc11_36.2: type = converted %impl.elem0, %as_type [symbolic_self = constants.%as_type]
|
||||
// CHECK:STDOUT: %.loc11_30.2: type = where_expr %.Self [concrete = constants.%K_where.type] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc11_36.2, %M.ref
|
||||
// CHECK:STDOUT: %.loc12_36.2: type = converted %impl.elem0, %as_type [symbolic_self = constants.%as_type]
|
||||
// CHECK:STDOUT: %.loc12_30.2: type = where_expr %.Self [concrete = constants.%K_where.type] {
|
||||
// CHECK:STDOUT: requirement_impls %.loc12_36.2, %M.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %W.loc11_24.1: %K_where.type = bind_symbolic_name W, 0 [symbolic = %W.loc11_24.2 (constants.%W)]
|
||||
// CHECK:STDOUT: %W.loc12_24.1: %K_where.type = bind_symbolic_name W, 0 [symbolic = %W.loc12_24.2 (constants.%W)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @L {
|
||||
// CHECK:STDOUT: %Self: %L.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.1d2]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @M {
|
||||
// CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.bcc]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @K {
|
||||
// CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.09f]
|
||||
// CHECK:STDOUT: %Associated: %L.type = assoc_const_decl @Associated [concrete] {
|
||||
// CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%Associated [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .L = <poisoned>
|
||||
// CHECK:STDOUT: .Associated = @Associated.%assoc0
|
||||
// CHECK:STDOUT: witness = (%Associated)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @Associated(@K.%Self: %K.type) {
|
||||
// CHECK:STDOUT: assoc_const Associated:! %L.type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @AssociatedTypeImpls(%W.loc11_24.1: %K_where.type) {
|
||||
// CHECK:STDOUT: %W.loc11_24.2: %K_where.type = bind_symbolic_name W, 0 [symbolic = %W.loc11_24.2 (constants.%W)]
|
||||
// CHECK:STDOUT: generic fn @AssociatedTypeImpls(%W.loc12_24.1: %K_where.type) {
|
||||
// CHECK:STDOUT: %W.loc12_24.2: %K_where.type = bind_symbolic_name W, 0 [symbolic = %W.loc12_24.2 (constants.%W)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Associated(constants.%Self.09f) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Associated(constants.%K.facet) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @AssociatedTypeImpls(constants.%W) {
|
||||
// CHECK:STDOUT: %W.loc11_24.2 => constants.%W
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_left_of_impls_non_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %type_where: type = facet_type <type where TODO> [concrete]
|
||||
// CHECK:STDOUT: %U: %type_where = bind_symbolic_name U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.344: type = pattern_type %type_where [concrete]
|
||||
// CHECK:STDOUT: %NonTypeImpls.type: type = fn_type @NonTypeImpls [concrete]
|
||||
// CHECK:STDOUT: %NonTypeImpls: %NonTypeImpls.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .NonTypeImpls = %NonTypeImpls.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %NonTypeImpls.decl: %NonTypeImpls.type = fn_decl @NonTypeImpls [concrete = constants.%NonTypeImpls] {
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.344 = symbolic_binding_pattern U, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc11_26.1: type = splice_block %.loc11_26.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
|
||||
// CHECK:STDOUT: %.loc11_32: type = converted %int_7, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_26.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: requirement_impls <error>, type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc11_17.1: %type_where = bind_symbolic_name U, 0 [symbolic = %U.loc11_17.2 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @NonTypeImpls(%U.loc11_17.1: %type_where) {
|
||||
// CHECK:STDOUT: %U.loc11_17.2: %type_where = bind_symbolic_name U, 0 [symbolic = %U.loc11_17.2 (constants.%U)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @NonTypeImpls(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc11_17.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_right_of_impls_non_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplsNonType.type: type = fn_type @ImplsNonType [concrete]
|
||||
// CHECK:STDOUT: %ImplsNonType: %ImplsNonType.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .ImplsNonType = %ImplsNonType.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %ImplsNonType.decl: %ImplsNonType.type = fn_decl @ImplsNonType [concrete = constants.%ImplsNonType] {
|
||||
// CHECK:STDOUT: %U.patt: <error> = symbolic_binding_pattern U, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc11_26.1: type = splice_block %.loc11_26.2 [concrete = <error>] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
|
||||
// CHECK:STDOUT: %.loc11_44: type = converted %int_7, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc11_26.2: type = where_expr %.Self [concrete = <error>] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U: <error> = bind_symbolic_name U, 0 [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @ImplsNonType(%U: <error>) {
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplsNonType(<error>) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_right_of_impls_non_facet_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %ImplsOfNonFacetType.type: type = fn_type @ImplsOfNonFacetType [concrete]
|
||||
// CHECK:STDOUT: %ImplsOfNonFacetType: %ImplsOfNonFacetType.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .ImplsOfNonFacetType = %ImplsOfNonFacetType.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %ImplsOfNonFacetType.decl: %ImplsOfNonFacetType.type = fn_decl @ImplsOfNonFacetType [concrete = constants.%ImplsOfNonFacetType] {
|
||||
// CHECK:STDOUT: %U.patt: <error> = symbolic_binding_pattern U, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8_33.1: type = splice_block %.loc8_33.2 [concrete = <error>] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc8_33.2: type = where_expr %.Self [concrete = <error>] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U: <error> = bind_symbolic_name U, 0 [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @ImplsOfNonFacetType(%U: <error>) {
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @ImplsOfNonFacetType(<error>) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_enforce_impls_constraint.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
|
||||
// CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
|
||||
// CHECK:STDOUT: %DoesNotImplI.type: type = fn_type @DoesNotImplI [concrete]
|
||||
// CHECK:STDOUT: %DoesNotImplI: %DoesNotImplI.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Impls.type: type = fn_type @Impls [concrete]
|
||||
// CHECK:STDOUT: %Impls: %Impls.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %J_where.type: type = facet_type <@J where .Self impls @I> [concrete]
|
||||
// CHECK:STDOUT: %V: %J_where.type = bind_symbolic_name V, 0 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Main.J: type = import_ref Main//state_constraints, J, loaded [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: %Main.I = import_ref Main//state_constraints, I, unloaded
|
||||
// CHECK:STDOUT: %Main.EqualEqual = import_ref Main//state_constraints, EqualEqual, unloaded
|
||||
// CHECK:STDOUT: %Main.Impls: %Impls.type = import_ref Main//state_constraints, Impls, loaded [concrete = constants.%Impls]
|
||||
// CHECK:STDOUT: %Main.And = import_ref Main//state_constraints, And, unloaded
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Main.import_ref.8fd = import_ref Main//state_constraints, inst19 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.e5d = import_ref Main//state_constraints, inst24 [no loc], unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.ce7 = import_ref Main//state_constraints, loc7_13, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.731 = import_ref Main//state_constraints, loc8_13, unloaded
|
||||
// CHECK:STDOUT: %Main.Member = import_ref Main//state_constraints, Member, unloaded
|
||||
// CHECK:STDOUT: %Main.Second = import_ref Main//state_constraints, Second, unloaded
|
||||
// CHECK:STDOUT: %Main.import_ref.d1a: %J_where.type = import_ref Main//state_constraints, loc13_10, loaded [symbolic = @Impls.%V (constants.%V)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .J = imports.%Main.J
|
||||
// CHECK:STDOUT: .I = imports.%Main.I
|
||||
// CHECK:STDOUT: .EqualEqual = imports.%Main.EqualEqual
|
||||
// CHECK:STDOUT: .Impls = imports.%Main.Impls
|
||||
// CHECK:STDOUT: .And = imports.%Main.And
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .DoesNotImplI = %DoesNotImplI.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl [concrete] {} {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%Main.J [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @impl [concrete]
|
||||
// CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
|
||||
// CHECK:STDOUT: %DoesNotImplI.decl: %DoesNotImplI.type = fn_decl @DoesNotImplI [concrete = constants.%DoesNotImplI] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @J [from "state_constraints.carbon"] {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Main.import_ref.8fd
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I [from "state_constraints.carbon"] {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Main.import_ref.e5d
|
||||
// CHECK:STDOUT: .Member = imports.%Main.import_ref.ce7
|
||||
// CHECK:STDOUT: .Second = imports.%Main.import_ref.731
|
||||
// CHECK:STDOUT: witness = (imports.%Main.Member, imports.%Main.Second)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl: %C.ref as %J.ref {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: witness = file.%J.impl_witness
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @DoesNotImplI() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Impls.ref: %Impls.type = name_ref Impls, imports.%Main.Impls [concrete = constants.%Impls]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Impls(imports.%Main.import_ref.d1a: %J_where.type) [from "state_constraints.carbon"] {
|
||||
// CHECK:STDOUT: %V: %J_where.type = bind_symbolic_name V, 0 [symbolic = %V (constants.%V)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Impls(constants.%V) {
|
||||
// CHECK:STDOUT: %V => constants.%V
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_enforce_equality_constraint.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
|
||||
// CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness file.%J.impl_witness_table [concrete]
|
||||
// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %J_where.type: type = facet_type <@J where TODO> [concrete]
|
||||
// CHECK:STDOUT: %Y: %J_where.type = bind_symbolic_name Y, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %J_where.type [concrete]
|
||||
// CHECK:STDOUT: %EmptyStruct.type: type = fn_type @EmptyStruct [concrete]
|
||||
// CHECK:STDOUT: %EmptyStruct: %EmptyStruct.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %NotEmptyStruct.type: type = fn_type @NotEmptyStruct [concrete]
|
||||
// CHECK:STDOUT: %NotEmptyStruct: %NotEmptyStruct.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Main.J: type = import_ref Main//state_constraints, J, loaded [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: %Main.I = import_ref Main//state_constraints, I, unloaded
|
||||
// CHECK:STDOUT: %Main.EqualEqual = import_ref Main//state_constraints, EqualEqual, unloaded
|
||||
// CHECK:STDOUT: %Main.Impls = import_ref Main//state_constraints, Impls, unloaded
|
||||
// CHECK:STDOUT: %Main.And = import_ref Main//state_constraints, And, unloaded
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Main.import_ref = import_ref Main//state_constraints, inst19 [no loc], unloaded
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .J = imports.%Main.J
|
||||
// CHECK:STDOUT: .I = imports.%Main.I
|
||||
// CHECK:STDOUT: .EqualEqual = imports.%Main.EqualEqual
|
||||
// CHECK:STDOUT: .Impls = imports.%Main.Impls
|
||||
// CHECK:STDOUT: .And = imports.%Main.And
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .EmptyStruct = %EmptyStruct.decl
|
||||
// CHECK:STDOUT: .NotEmptyStruct = %NotEmptyStruct.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: impl_decl @impl [concrete] {} {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%Main.J [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %J.impl_witness_table = impl_witness_table (), @impl [concrete]
|
||||
// CHECK:STDOUT: %J.impl_witness: <witness> = impl_witness %J.impl_witness_table [concrete = constants.%J.impl_witness]
|
||||
// CHECK:STDOUT: %EmptyStruct.decl: %EmptyStruct.type = fn_decl @EmptyStruct [concrete = constants.%EmptyStruct] {
|
||||
// CHECK:STDOUT: %Y.patt: %pattern_type = symbolic_binding_pattern Y, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc9_22.1: type = splice_block %.loc9_22.2 [concrete = constants.%J_where.type] {
|
||||
// CHECK:STDOUT: %J.ref: type = name_ref J, imports.%Main.J [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.loc9_38: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc9_22.2: type = where_expr %.Self [concrete = constants.%J_where.type] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc9_38
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Y.loc9_16.1: %J_where.type = bind_symbolic_name Y, 0 [symbolic = %Y.loc9_16.2 (constants.%Y)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %NotEmptyStruct.decl: %NotEmptyStruct.type = fn_decl @NotEmptyStruct [concrete = constants.%NotEmptyStruct] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @J [from "state_constraints.carbon"] {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = imports.%Main.import_ref
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: impl @impl: %C.ref as %J.ref {
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: witness = file.%J.impl_witness
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @EmptyStruct(%Y.loc9_16.1: %J_where.type) {
|
||||
// CHECK:STDOUT: %Y.loc9_16.2: %J_where.type = bind_symbolic_name Y, 0 [symbolic = %Y.loc9_16.2 (constants.%Y)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @NotEmptyStruct() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %EmptyStruct.ref: %EmptyStruct.type = name_ref EmptyStruct, file.%EmptyStruct.decl [concrete = constants.%EmptyStruct]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @EmptyStruct(constants.%Y) {
|
||||
// CHECK:STDOUT: %Y.loc9_16.2 => constants.%Y
|
||||
// CHECK:STDOUT: %W.loc12_24.2 => constants.%W
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+28
-325
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/designator.carbon
|
||||
@@ -19,11 +16,13 @@ interface I {
|
||||
let Member:! type;
|
||||
}
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
fn PeriodSelf(T:! I where .Self == ());
|
||||
|
||||
fn PeriodMember(U:! I where .Member == ());
|
||||
|
||||
fn TypeSelfImpls(V:! type where .Self impls I);
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// --- fail_wrong_member.carbon
|
||||
|
||||
@@ -94,7 +93,6 @@ class D {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Member [concrete]
|
||||
// CHECK:STDOUT: %.Self.258: %I.type = bind_symbolic_name .Self [symbolic_self]
|
||||
@@ -106,7 +104,6 @@ class D {
|
||||
// CHECK:STDOUT: %PeriodSelf: %PeriodSelf.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.258 [symbolic_self]
|
||||
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.258, @I [symbolic_self]
|
||||
// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
|
||||
// CHECK:STDOUT: %U: %I_where.type = bind_symbolic_name U, 0 [symbolic]
|
||||
// CHECK:STDOUT: %PeriodMember.type: type = fn_type @PeriodMember [concrete]
|
||||
@@ -120,377 +117,83 @@ class D {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .I = %I.decl
|
||||
// CHECK:STDOUT: .PeriodSelf = %PeriodSelf.decl
|
||||
// CHECK:STDOUT: .PeriodMember = %PeriodMember.decl
|
||||
// CHECK:STDOUT: .TypeSelfImpls = %TypeSelfImpls.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
|
||||
// CHECK:STDOUT: %PeriodSelf.decl: %PeriodSelf.type = fn_decl @PeriodSelf [concrete = constants.%PeriodSelf] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.f03 = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8_21.1: type = splice_block %.loc8_21.2 [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %.loc9_21.1: type = splice_block %.loc9_21.2 [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %.loc8_37: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc8_21.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc8_37
|
||||
// CHECK:STDOUT: %.loc9_37: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc9_21.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %.loc9_37
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc8_15.1: %I_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_15.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc9_15.1: %I_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_15.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %PeriodMember.decl: %PeriodMember.type = fn_decl @PeriodMember [concrete = constants.%PeriodMember] {
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.f03 = symbolic_binding_pattern U, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc10_23.1: type = splice_block %.loc10_23.2 [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %.loc11_23.1: type = splice_block %.loc11_23.2 [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.258]
|
||||
// CHECK:STDOUT: %Member.ref: %I.assoc_type = name_ref Member, @Member.%assoc0 [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc10_29: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc11_29: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
|
||||
// CHECK:STDOUT: %.loc10_41: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc10_23.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc10_41
|
||||
// CHECK:STDOUT: %.loc11_41: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc11_23.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: requirement_equivalent %impl.elem0, %.loc11_41
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc10_17.1: %I_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc10_17.2 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.loc11_17.1: %I_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc11_17.2 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %TypeSelfImpls.decl: %TypeSelfImpls.type = fn_decl @TypeSelfImpls [concrete = constants.%TypeSelfImpls] {
|
||||
// CHECK:STDOUT: %V.patt: %pattern_type.2b5 = symbolic_binding_pattern V, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc12_27.1: type = splice_block %.loc12_27.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.Self: type = bind_symbolic_name .Self [symbolic_self = constants.%.Self.644]
|
||||
// CHECK:STDOUT: %.loc13_27.1: type = splice_block %.loc13_27.2 [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.644]
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.loc12_27.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: %.loc13_27.2: type = where_expr %.Self [concrete = constants.%type_where] {
|
||||
// CHECK:STDOUT: requirement_impls %.Self.ref, %I.ref
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %V.loc12_18.1: %type_where = bind_symbolic_name V, 0 [symbolic = %V.loc12_18.2 (constants.%V)]
|
||||
// CHECK:STDOUT: %V.loc13_18.1: %type_where = bind_symbolic_name V, 0 [symbolic = %V.loc13_18.2 (constants.%V)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT: %Member: type = assoc_const_decl @Member [concrete] {
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%Member [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .Member = @Member.%assoc0
|
||||
// CHECK:STDOUT: witness = (%Member)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @Member(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: assoc_const Member:! type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @PeriodSelf(%T.loc8_15.1: %I_where.type) {
|
||||
// CHECK:STDOUT: %T.loc8_15.2: %I_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc8_15.2 (constants.%T)]
|
||||
// CHECK:STDOUT: generic fn @PeriodSelf(%T.loc9_15.1: %I_where.type) {
|
||||
// CHECK:STDOUT: %T.loc9_15.2: %I_where.type = bind_symbolic_name T, 0 [symbolic = %T.loc9_15.2 (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @PeriodMember(%U.loc10_17.1: %I_where.type) {
|
||||
// CHECK:STDOUT: %U.loc10_17.2: %I_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc10_17.2 (constants.%U)]
|
||||
// CHECK:STDOUT: generic fn @PeriodMember(%U.loc11_17.1: %I_where.type) {
|
||||
// CHECK:STDOUT: %U.loc11_17.2: %I_where.type = bind_symbolic_name U, 0 [symbolic = %U.loc11_17.2 (constants.%U)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @TypeSelfImpls(%V.loc12_18.1: %type_where) {
|
||||
// CHECK:STDOUT: %V.loc12_18.2: %type_where = bind_symbolic_name V, 0 [symbolic = %V.loc12_18.2 (constants.%V)]
|
||||
// CHECK:STDOUT: generic fn @TypeSelfImpls(%V.loc13_18.1: %type_where) {
|
||||
// CHECK:STDOUT: %V.loc13_18.2: %type_where = bind_symbolic_name V, 0 [symbolic = %V.loc13_18.2 (constants.%V)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Member(constants.%Self) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @PeriodSelf(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc8_15.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.loc9_15.2 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Member(constants.%I.facet) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @PeriodMember(constants.%U) {
|
||||
// CHECK:STDOUT: %U.loc10_17.2 => constants.%U
|
||||
// CHECK:STDOUT: %U.loc11_17.2 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @TypeSelfImpls(constants.%V) {
|
||||
// CHECK:STDOUT: %V.loc12_18.2 => constants.%V
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_wrong_member.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
|
||||
// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%Member [concrete]
|
||||
// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %PeriodMismatch.type: type = fn_type @PeriodMismatch [concrete]
|
||||
// CHECK:STDOUT: %PeriodMismatch: %PeriodMismatch.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .J = %J.decl
|
||||
// CHECK:STDOUT: .PeriodMismatch = %PeriodMismatch.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {}
|
||||
// CHECK:STDOUT: %PeriodMismatch.decl: %PeriodMismatch.type = fn_decl @PeriodMismatch [concrete = constants.%PeriodMismatch] {
|
||||
// CHECK:STDOUT: %W.patt: <error> = symbolic_binding_pattern W, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc12_25.1: type = splice_block %.loc12_25.2 [concrete = <error>] {
|
||||
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
|
||||
// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %Mismatch.ref: <error> = name_ref Mismatch, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc12_44: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc12_25.2: type = where_expr %.Self [concrete = <error>] {
|
||||
// CHECK:STDOUT: requirement_rewrite %Mismatch.ref, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %W: <error> = bind_symbolic_name W, 0 [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @J {
|
||||
// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT: %Member: type = assoc_const_decl @Member [concrete] {
|
||||
// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%Member [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .Member = @Member.%assoc0
|
||||
// CHECK:STDOUT: .Mismatch = <poisoned>
|
||||
// CHECK:STDOUT: witness = (%Member)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @Member(@J.%Self: %J.type) {
|
||||
// CHECK:STDOUT: assoc_const Member:! type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @PeriodMismatch(%W: <error>) {
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Member(constants.%Self) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @PeriodMismatch(<error>) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_designator_matches_var.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
|
||||
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc4_14.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_14.2: type = converted %.loc4_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo() -> %empty_tuple.type {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = binding_pattern x [concrete]
|
||||
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt
|
||||
// CHECK:STDOUT: %.loc5_11.1: type = splice_block %.loc5_11.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc5_11.2: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc5_11.3: type = converted %.loc5_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_tuple.type = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %x.ref: <error> = name_ref x, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_unknown_designator.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %Bar.type: type = fn_type @Bar [concrete]
|
||||
// CHECK:STDOUT: %Bar: %Bar.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Bar = %Bar.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [concrete = constants.%Bar] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc4_14.1: %empty_tuple.type = tuple_literal ()
|
||||
// CHECK:STDOUT: %.loc4_14.2: type = converted %.loc4_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Bar() -> %empty_tuple.type {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %undef.ref: <error> = name_ref undef, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_dot_self_method_return_value.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %return.param: ref %C = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %C = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %return.param: %C {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: return <error> to %return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_dot_self_method_return_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .D = %D.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @D {
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %return.patt: <error> = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: <error> = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %return.param: ref <error> = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref <error> = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = constants.%D
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> <error> {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%D [concrete = constants.%D]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: %V.loc13_18.2 => constants.%V
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+46
-180
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/dot_self_index.carbon
|
||||
@@ -18,7 +15,9 @@ interface Empty(W:! type) {
|
||||
// T has index 0
|
||||
// .Self has index invalid, not 1
|
||||
// V has index 1, does not match .Self
|
||||
//@dump-sem-ir-begin
|
||||
fn H(T:! type, U: Empty(T) where .A = T*, V:! type) {}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
fn G(U: Empty(i32) where .A = i32*) {
|
||||
H(i32, U, bool);
|
||||
@@ -27,25 +26,17 @@ fn G(U: Empty(i32) where .A = i32*) {
|
||||
// CHECK:STDOUT: --- dot_self_index.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %W: type = bind_symbolic_name W, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %Empty.type.d5a: type = generic_interface_type @Empty [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %Empty.generic: %Empty.type.d5a = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Empty.type.3e5fde.1: type = facet_type <@Empty, @Empty(%W)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.8c5170.1: %Empty.type.3e5fde.1 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Empty.assoc_type.3cf698.1: type = assoc_entity_type @Empty, @Empty(%W) [symbolic]
|
||||
// CHECK:STDOUT: %assoc0.3715ce.1: %Empty.assoc_type.3cf698.1 = assoc_entity element0, @Empty.%A [symbolic]
|
||||
// CHECK:STDOUT: %T.8b3: type = bind_symbolic_name T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Empty.type.3e5fde.2: type = facet_type <@Empty, @Empty(%T.8b3)> [symbolic]
|
||||
// CHECK:STDOUT: %.Self.c95: %Empty.type.3e5fde.2 = bind_symbolic_name .Self [symbolic]
|
||||
// CHECK:STDOUT: %Self.8c5170.2: %Empty.type.3e5fde.2 = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Empty.assoc_type.3cf698.2: type = assoc_entity_type @Empty, @Empty(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %assoc0.3715ce.2: %Empty.assoc_type.3cf698.2 = assoc_entity element0, @Empty.%A [symbolic]
|
||||
// CHECK:STDOUT: %require_complete.22f: <witness> = require_complete_type %Empty.type.3e5fde.2 [symbolic]
|
||||
// CHECK:STDOUT: %.Self.as_type.a75: type = facet_access_type %.Self.c95 [symbolic]
|
||||
// CHECK:STDOUT: %Empty.lookup_impl_witness.b1d: <witness> = lookup_impl_witness %.Self.c95, @Empty, @Empty(%T.8b3) [symbolic]
|
||||
// CHECK:STDOUT: %Empty.facet.e74: %Empty.type.3e5fde.2 = facet_value %.Self.as_type.a75, (%Empty.lookup_impl_witness.b1d) [symbolic]
|
||||
// CHECK:STDOUT: %impl.elem0.c6e: type = impl_witness_access %Empty.lookup_impl_witness.b1d, element0 [symbolic]
|
||||
// CHECK:STDOUT: %ptr.79f: type = ptr_type %T.8b3 [symbolic]
|
||||
// CHECK:STDOUT: %Empty_where.type.b73: type = facet_type <@Empty, @Empty(%T.8b3) where %impl.elem0.c6e = %ptr.79f> [symbolic]
|
||||
@@ -55,153 +46,72 @@ fn G(U: Empty(i32) where .A = i32*) {
|
||||
// CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete.af8: <witness> = require_complete_type %Empty_where.type.b73 [symbolic]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Empty.type.f0b: type = facet_type <@Empty, @Empty(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %.Self.e6e: %Empty.type.f0b = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %Self.dcf: %Empty.type.f0b = bind_symbolic_name Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Empty.assoc_type.7c7: type = assoc_entity_type @Empty, @Empty(%i32) [concrete]
|
||||
// CHECK:STDOUT: %assoc0.758: %Empty.assoc_type.7c7 = assoc_entity element0, @Empty.%A [concrete]
|
||||
// CHECK:STDOUT: %.Self.as_type.920: type = facet_access_type %.Self.e6e [symbolic_self]
|
||||
// CHECK:STDOUT: %Empty.lookup_impl_witness.4e3: <witness> = lookup_impl_witness %.Self.e6e, @Empty, @Empty(%i32) [symbolic_self]
|
||||
// CHECK:STDOUT: %Empty.facet.112: %Empty.type.f0b = facet_value %.Self.as_type.920, (%Empty.lookup_impl_witness.4e3) [symbolic_self]
|
||||
// CHECK:STDOUT: %impl.elem0.64a: type = impl_witness_access %Empty.lookup_impl_witness.4e3, element0 [symbolic_self]
|
||||
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %Empty_where.type.fc2: type = facet_type <@Empty, @Empty(%i32) where %impl.elem0.64a = %ptr.235> [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.012: type = pattern_type %Empty_where.type.fc2 [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %complete_type.091: <witness> = complete_type_witness %Empty.type.f0b [concrete]
|
||||
// CHECK:STDOUT: %H.specific_fn: <specific function> = specific_function %H, @H(%i32, bool) [concrete]
|
||||
// CHECK:STDOUT: %complete_type.a3f: <witness> = complete_type_witness %Empty_where.type.fc2 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Bool = %Core.Bool
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Empty = %Empty.decl
|
||||
// CHECK:STDOUT: .H = %H.decl
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Empty.decl: %Empty.type.d5a = interface_decl @Empty [concrete = constants.%Empty.generic] {
|
||||
// CHECK:STDOUT: %W.patt: %pattern_type.98f = symbolic_binding_pattern W, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %W.loc14_17.1: type = bind_symbolic_name W, 0 [symbolic = %W.loc14_17.2 (constants.%W)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.98f = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: %U.patt: @H.%pattern_type (%pattern_type.668) = binding_pattern U [concrete]
|
||||
// CHECK:STDOUT: %U.param_patt: @H.%pattern_type (%pattern_type.668) = value_param_pattern %U.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: %V.patt: %pattern_type.98f = symbolic_binding_pattern V, 1 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.loc21_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %T.loc19_6.1: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %U.param: @H.%Empty_where.type (%Empty_where.type.b73) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc21_28.1: type = splice_block %.loc21_28.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.b73)] {
|
||||
// CHECK:STDOUT: %.loc19_28.1: type = splice_block %.loc19_28.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.b73)] {
|
||||
// CHECK:STDOUT: %Empty.ref: %Empty.type.d5a = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.generic]
|
||||
// CHECK:STDOUT: %T.ref.loc21_25: type = name_ref T, %T.loc21_6.1 [symbolic = %T.loc21_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Empty.type.loc21_26.1: type = facet_type <@Empty, @Empty(constants.%T.8b3)> [symbolic = %Empty.type.loc21_26.2 (constants.%Empty.type.3e5fde.2)]
|
||||
// CHECK:STDOUT: %.Self.1: @H.%Empty.type.loc21_26.2 (%Empty.type.3e5fde.2) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.c95)]
|
||||
// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc21_26.2 (%Empty.type.3e5fde.2) = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.c95)]
|
||||
// CHECK:STDOUT: %.loc21_34.1: @H.%Empty.assoc_type (%Empty.assoc_type.3cf698.2) = specific_constant @A.%assoc0, @Empty(constants.%T.8b3) [symbolic = %assoc0 (constants.%assoc0.3715ce.2)]
|
||||
// CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.3cf698.2) = name_ref A, %.loc21_34.1 [symbolic = %assoc0 (constants.%assoc0.3715ce.2)]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc21_34.1: type = facet_access_type %.Self.ref [symbolic = %.Self.as_type.loc21_34.2 (constants.%.Self.as_type.a75)]
|
||||
// CHECK:STDOUT: %.loc21_34.2: type = converted %.Self.ref, %.Self.as_type.loc21_34.1 [symbolic = %.Self.as_type.loc21_34.2 (constants.%.Self.as_type.a75)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc21_34.1: type = impl_witness_access constants.%Empty.lookup_impl_witness.b1d, element0 [symbolic = %impl.elem0.loc21_34.2 (constants.%impl.elem0.c6e)]
|
||||
// CHECK:STDOUT: %T.ref.loc21_39: type = name_ref T, %T.loc21_6.1 [symbolic = %T.loc21_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %ptr.loc21_40.1: type = ptr_type %T.ref.loc21_39 [symbolic = %ptr.loc21_40.2 (constants.%ptr.79f)]
|
||||
// CHECK:STDOUT: %.loc21_28.2: type = where_expr %.Self.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.b73)] {
|
||||
// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc21_34.1, %ptr.loc21_40.1
|
||||
// CHECK:STDOUT: %T.ref.loc19_25: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Empty.type.loc19_26.1: type = facet_type <@Empty, @Empty(constants.%T.8b3)> [symbolic = %Empty.type.loc19_26.2 (constants.%Empty.type.3e5fde.2)]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc19_26.2 (%Empty.type.3e5fde.2) = name_ref .Self, %.Self.1 [symbolic = %.Self.2 (constants.%.Self.c95)]
|
||||
// CHECK:STDOUT: %.loc19_34.1: @H.%Empty.assoc_type (%Empty.assoc_type.3cf698.2) = specific_constant @A.%assoc0, @Empty(constants.%T.8b3) [symbolic = %assoc0 (constants.%assoc0.3715ce.2)]
|
||||
// CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.3cf698.2) = name_ref A, %.loc19_34.1 [symbolic = %assoc0 (constants.%assoc0.3715ce.2)]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc19_34.1: type = facet_access_type %.Self.ref [symbolic = %.Self.as_type.loc19_34.2 (constants.%.Self.as_type.a75)]
|
||||
// CHECK:STDOUT: %.loc19_34.2: type = converted %.Self.ref, %.Self.as_type.loc19_34.1 [symbolic = %.Self.as_type.loc19_34.2 (constants.%.Self.as_type.a75)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_34.1: type = impl_witness_access constants.%Empty.lookup_impl_witness.b1d, element0 [symbolic = %impl.elem0.loc19_34.2 (constants.%impl.elem0.c6e)]
|
||||
// CHECK:STDOUT: %T.ref.loc19_39: type = name_ref T, %T.loc19_6.1 [symbolic = %T.loc19_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %ptr.loc19_40.1: type = ptr_type %T.ref.loc19_39 [symbolic = %ptr.loc19_40.2 (constants.%ptr.79f)]
|
||||
// CHECK:STDOUT: %.loc19_28.2: type = where_expr %.Self.1 [symbolic = %Empty_where.type (constants.%Empty_where.type.b73)] {
|
||||
// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc19_34.1, %ptr.loc19_40.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U: @H.%Empty_where.type (%Empty_where.type.b73) = bind_name U, %U.param
|
||||
// CHECK:STDOUT: %V.loc21_43.1: type = bind_symbolic_name V, 1 [symbolic = %V.loc21_43.2 (constants.%V)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.012 = binding_pattern U [concrete]
|
||||
// CHECK:STDOUT: %U.param_patt: %pattern_type.012 = value_param_pattern %U.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %U.param: %Empty_where.type.fc2 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc23_20.1: type = splice_block %.loc23_20.2 [concrete = constants.%Empty_where.type.fc2] {
|
||||
// CHECK:STDOUT: %Empty.ref: %Empty.type.d5a = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.generic]
|
||||
// CHECK:STDOUT: %int_32.loc23_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc23_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(constants.%i32)> [concrete = constants.%Empty.type.f0b]
|
||||
// CHECK:STDOUT: %.Self: %Empty.type.f0b = bind_symbolic_name .Self [symbolic_self = constants.%.Self.e6e]
|
||||
// CHECK:STDOUT: %.Self.ref: %Empty.type.f0b = name_ref .Self, %.Self [symbolic_self = constants.%.Self.e6e]
|
||||
// CHECK:STDOUT: %.loc23_26.1: %Empty.assoc_type.7c7 = specific_constant @A.%assoc0, @Empty(constants.%i32) [concrete = constants.%assoc0.758]
|
||||
// CHECK:STDOUT: %A.ref: %Empty.assoc_type.7c7 = name_ref A, %.loc23_26.1 [concrete = constants.%assoc0.758]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type.920]
|
||||
// CHECK:STDOUT: %.loc23_26.2: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type.920]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%Empty.lookup_impl_witness.4e3, element0 [symbolic_self = constants.%impl.elem0.64a]
|
||||
// CHECK:STDOUT: %int_32.loc23_31: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc23_31: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %i32.loc23_31 [concrete = constants.%ptr.235]
|
||||
// CHECK:STDOUT: %.loc23_20.2: type = where_expr %.Self [concrete = constants.%Empty_where.type.fc2] {
|
||||
// CHECK:STDOUT: requirement_rewrite %impl.elem0, %ptr
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U: %Empty_where.type.fc2 = bind_name U, %U.param
|
||||
// CHECK:STDOUT: %V.loc19_43.1: type = bind_symbolic_name V, 1 [symbolic = %V.loc19_43.2 (constants.%V)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @Empty(%W.loc14_17.1: type) {
|
||||
// CHECK:STDOUT: %W.loc14_17.2: type = bind_symbolic_name W, 0 [symbolic = %W.loc14_17.2 (constants.%W)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Empty.type: type = facet_type <@Empty, @Empty(%W.loc14_17.2)> [symbolic = %Empty.type (constants.%Empty.type.3e5fde.1)]
|
||||
// CHECK:STDOUT: %Self.2: @Empty.%Empty.type (%Empty.type.3e5fde.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.8c5170.1)]
|
||||
// CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty, @Empty(%W.loc14_17.2) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.3cf698.1)]
|
||||
// CHECK:STDOUT: %assoc0: @Empty.%Empty.assoc_type (%Empty.assoc_type.3cf698.1) = assoc_entity element0, %A [symbolic = %assoc0 (constants.%assoc0.3715ce.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: %Self.1: @Empty.%Empty.type (%Empty.type.3e5fde.1) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self.8c5170.1)]
|
||||
// CHECK:STDOUT: %A: type = assoc_const_decl @A [concrete] {
|
||||
// CHECK:STDOUT: %assoc0: @Empty.%Empty.assoc_type (%Empty.assoc_type.3cf698.1) = assoc_entity element0, @Empty.%A [symbolic = @Empty.%assoc0 (constants.%assoc0.3715ce.1)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.1
|
||||
// CHECK:STDOUT: .A = @A.%assoc0
|
||||
// CHECK:STDOUT: witness = (%A)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @A(@Empty.%W.loc14_17.1: type, @Empty.%Self.1: @Empty.%Empty.type (%Empty.type.3e5fde.1)) {
|
||||
// CHECK:STDOUT: assoc_const A:! type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @H(%T.loc21_6.1: type, %V.loc21_43.1: type) {
|
||||
// CHECK:STDOUT: %T.loc21_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc21_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Empty.type.loc21_26.2: type = facet_type <@Empty, @Empty(%T.loc21_6.2)> [symbolic = %Empty.type.loc21_26.2 (constants.%Empty.type.3e5fde.2)]
|
||||
// CHECK:STDOUT: %.Self.2: @H.%Empty.type.loc21_26.2 (%Empty.type.3e5fde.2) = bind_symbolic_name .Self [symbolic = %.Self.2 (constants.%.Self.c95)]
|
||||
// CHECK:STDOUT: %require_complete.loc21_34: <witness> = require_complete_type %Empty.type.loc21_26.2 [symbolic = %require_complete.loc21_34 (constants.%require_complete.22f)]
|
||||
// CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty, @Empty(%T.loc21_6.2) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.3cf698.2)]
|
||||
// CHECK:STDOUT: generic fn @H(%T.loc19_6.1: type, %V.loc19_43.1: type) {
|
||||
// CHECK:STDOUT: %T.loc19_6.2: type = bind_symbolic_name T, 0 [symbolic = %T.loc19_6.2 (constants.%T.8b3)]
|
||||
// CHECK:STDOUT: %Empty.type.loc19_26.2: type = facet_type <@Empty, @Empty(%T.loc19_6.2)> [symbolic = %Empty.type.loc19_26.2 (constants.%Empty.type.3e5fde.2)]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %require_complete.loc19_34: <witness> = require_complete_type %Empty.type.loc19_26.2 [symbolic = %require_complete.loc19_34 (constants.%require_complete.22f)]
|
||||
// CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty, @Empty(%T.loc19_6.2) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.3cf698.2)]
|
||||
// CHECK:STDOUT: %assoc0: @H.%Empty.assoc_type (%Empty.assoc_type.3cf698.2) = assoc_entity element0, @Empty.%A [symbolic = %assoc0 (constants.%assoc0.3715ce.2)]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc21_34.2: type = facet_access_type %.Self.2 [symbolic = %.Self.as_type.loc21_34.2 (constants.%.Self.as_type.a75)]
|
||||
// CHECK:STDOUT: %Empty.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.2, @Empty, @Empty(%T.loc21_6.2) [symbolic = %Empty.lookup_impl_witness (constants.%Empty.lookup_impl_witness.b1d)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc21_34.2: type = impl_witness_access %Empty.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc21_34.2 (constants.%impl.elem0.c6e)]
|
||||
// CHECK:STDOUT: %ptr.loc21_40.2: type = ptr_type %T.loc21_6.2 [symbolic = %ptr.loc21_40.2 (constants.%ptr.79f)]
|
||||
// CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc21_6.2) where %impl.elem0.loc21_34.2 = %ptr.loc21_40.2> [symbolic = %Empty_where.type (constants.%Empty_where.type.b73)]
|
||||
// CHECK:STDOUT: %.Self.as_type.loc19_34.2: type = facet_access_type %.Self.2 [symbolic = %.Self.as_type.loc19_34.2 (constants.%.Self.as_type.a75)]
|
||||
// CHECK:STDOUT: %Empty.lookup_impl_witness: <witness> = lookup_impl_witness %.Self.2, @Empty, @Empty(%T.loc19_6.2) [symbolic = %Empty.lookup_impl_witness (constants.%Empty.lookup_impl_witness.b1d)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_34.2: type = impl_witness_access %Empty.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc19_34.2 (constants.%impl.elem0.c6e)]
|
||||
// CHECK:STDOUT: %ptr.loc19_40.2: type = ptr_type %T.loc19_6.2 [symbolic = %ptr.loc19_40.2 (constants.%ptr.79f)]
|
||||
// CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc19_6.2) where %impl.elem0.loc19_34.2 = %ptr.loc19_40.2> [symbolic = %Empty_where.type (constants.%Empty_where.type.b73)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Empty_where.type [symbolic = %pattern_type (constants.%pattern_type.668)]
|
||||
// CHECK:STDOUT: %V.loc21_43.2: type = bind_symbolic_name V, 1 [symbolic = %V.loc21_43.2 (constants.%V)]
|
||||
// CHECK:STDOUT: %V.loc19_43.2: type = bind_symbolic_name V, 1 [symbolic = %V.loc19_43.2 (constants.%V)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc21_17: <witness> = require_complete_type %Empty_where.type [symbolic = %require_complete.loc21_17 (constants.%require_complete.af8)]
|
||||
// CHECK:STDOUT: %require_complete.loc19_17: <witness> = require_complete_type %Empty_where.type [symbolic = %require_complete.loc19_17 (constants.%require_complete.af8)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%U.param: @H.%Empty_where.type (%Empty_where.type.b73)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
@@ -209,82 +119,38 @@ fn G(U: Empty(i32) where .A = i32*) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G(%U.param: %Empty_where.type.fc2) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [concrete = constants.%H]
|
||||
// CHECK:STDOUT: %int_32.loc24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %U.ref: %Empty_where.type.fc2 = name_ref U, %U
|
||||
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc24_17.1: type = value_of_initializer %bool.make_type [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc24_17.2: type = converted %bool.make_type, %.loc24_17.1 [concrete = bool]
|
||||
// CHECK:STDOUT: %H.specific_fn: <specific function> = specific_function %H.ref, @H(constants.%i32, bool) [concrete = constants.%H.specific_fn]
|
||||
// CHECK:STDOUT: %H.call: init %empty_tuple.type = call %H.specific_fn(%U.ref)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Empty(constants.%W) {
|
||||
// CHECK:STDOUT: %W.loc14_17.2 => constants.%W
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @A(constants.%W, constants.%Self.8c5170.1) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Empty(constants.%T.8b3) {
|
||||
// CHECK:STDOUT: %W.loc14_17.2 => constants.%T.8b3
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Empty.type => constants.%Empty.type.3e5fde.2
|
||||
// CHECK:STDOUT: %Self.2 => constants.%Self.8c5170.2
|
||||
// CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.3cf698.2
|
||||
// CHECK:STDOUT: %assoc0 => constants.%assoc0.3715ce.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @A(constants.%T.8b3, constants.%Empty.facet.e74) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @H(constants.%T.8b3, constants.%V) {
|
||||
// CHECK:STDOUT: %T.loc21_6.2 => constants.%T.8b3
|
||||
// CHECK:STDOUT: %Empty.type.loc21_26.2 => constants.%Empty.type.3e5fde.2
|
||||
// CHECK:STDOUT: %T.loc19_6.2 => constants.%T.8b3
|
||||
// CHECK:STDOUT: %Empty.type.loc19_26.2 => constants.%Empty.type.3e5fde.2
|
||||
// CHECK:STDOUT: %.Self.2 => constants.%.Self.c95
|
||||
// CHECK:STDOUT: %require_complete.loc21_34 => constants.%require_complete.22f
|
||||
// CHECK:STDOUT: %require_complete.loc19_34 => constants.%require_complete.22f
|
||||
// CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.3cf698.2
|
||||
// CHECK:STDOUT: %assoc0 => constants.%assoc0.3715ce.2
|
||||
// CHECK:STDOUT: %.Self.as_type.loc21_34.2 => constants.%.Self.as_type.a75
|
||||
// CHECK:STDOUT: %.Self.as_type.loc19_34.2 => constants.%.Self.as_type.a75
|
||||
// CHECK:STDOUT: %Empty.lookup_impl_witness => constants.%Empty.lookup_impl_witness.b1d
|
||||
// CHECK:STDOUT: %impl.elem0.loc21_34.2 => constants.%impl.elem0.c6e
|
||||
// CHECK:STDOUT: %ptr.loc21_40.2 => constants.%ptr.79f
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_34.2 => constants.%impl.elem0.c6e
|
||||
// CHECK:STDOUT: %ptr.loc19_40.2 => constants.%ptr.79f
|
||||
// CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.b73
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.668
|
||||
// CHECK:STDOUT: %V.loc21_43.2 => constants.%V
|
||||
// CHECK:STDOUT: %V.loc19_43.2 => constants.%V
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Empty(constants.%i32) {
|
||||
// CHECK:STDOUT: %W.loc14_17.2 => constants.%i32
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Empty.type => constants.%Empty.type.f0b
|
||||
// CHECK:STDOUT: %Self.2 => constants.%Self.dcf
|
||||
// CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.7c7
|
||||
// CHECK:STDOUT: %assoc0 => constants.%assoc0.758
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @A(constants.%i32, constants.%Empty.facet.112) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @H(constants.%i32, bool) {
|
||||
// CHECK:STDOUT: %T.loc21_6.2 => constants.%i32
|
||||
// CHECK:STDOUT: %Empty.type.loc21_26.2 => constants.%Empty.type.f0b
|
||||
// CHECK:STDOUT: %T.loc19_6.2 => constants.%i32
|
||||
// CHECK:STDOUT: %Empty.type.loc19_26.2 => constants.%Empty.type.f0b
|
||||
// CHECK:STDOUT: %.Self.2 => constants.%.Self.e6e
|
||||
// CHECK:STDOUT: %require_complete.loc21_34 => constants.%complete_type.091
|
||||
// CHECK:STDOUT: %require_complete.loc19_34 => constants.%complete_type.091
|
||||
// CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.7c7
|
||||
// CHECK:STDOUT: %assoc0 => constants.%assoc0.758
|
||||
// CHECK:STDOUT: %.Self.as_type.loc21_34.2 => constants.%.Self.as_type.920
|
||||
// CHECK:STDOUT: %.Self.as_type.loc19_34.2 => constants.%.Self.as_type.920
|
||||
// CHECK:STDOUT: %Empty.lookup_impl_witness => constants.%Empty.lookup_impl_witness.4e3
|
||||
// CHECK:STDOUT: %impl.elem0.loc21_34.2 => constants.%impl.elem0.64a
|
||||
// CHECK:STDOUT: %ptr.loc21_40.2 => constants.%ptr.235
|
||||
// CHECK:STDOUT: %impl.elem0.loc19_34.2 => constants.%impl.elem0.64a
|
||||
// CHECK:STDOUT: %ptr.loc19_40.2 => constants.%ptr.235
|
||||
// CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.fc2
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.012
|
||||
// CHECK:STDOUT: %V.loc21_43.2 => bool
|
||||
// CHECK:STDOUT: %V.loc19_43.2 => bool
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete.loc21_17 => constants.%complete_type.a3f
|
||||
// CHECK:STDOUT: %require_complete.loc19_17 => constants.%complete_type.a3f
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+120
-1240
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/fail_not_facet.carbon
|
||||
@@ -40,142 +37,3 @@ library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var v: e where .x = 3;
|
||||
|
||||
// CHECK:STDOUT: --- fail_left_where_not_facet.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: .Bool = %Core.Bool
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt: <error> = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8_14.1: type = splice_block %.loc8_14.2 [concrete = <error>] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.Self: <error> = bind_symbolic_name .Self [concrete = <error>]
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, %.Self [concrete = <error>]
|
||||
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc8_14.2: type = where_expr %.Self [concrete = <error>] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T: <error> = bind_symbolic_name T, 0 [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T: <error>) {
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(<error>) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_left_where_unknown.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
|
||||
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Bool = %Core.Bool
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .NOT_DECLARED = <poisoned>
|
||||
// CHECK:STDOUT: .G = %G.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %U.patt: <error> = symbolic_binding_pattern U, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.2 [concrete = <error>] {
|
||||
// CHECK:STDOUT: %NOT_DECLARED.ref: <error> = name_ref NOT_DECLARED, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.Self: <error> = bind_symbolic_name .Self [concrete = <error>]
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, %.Self [concrete = <error>]
|
||||
// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [concrete = bool]
|
||||
// CHECK:STDOUT: %.loc8_23.2: type = where_expr %.Self [concrete = <error>] {
|
||||
// CHECK:STDOUT: requirement_equivalent %.Self.ref, %bool.make_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U: <error> = bind_symbolic_name U, 0 [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @G(%U: <error>) {
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @G(<error>) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_var.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .e = <poisoned>
|
||||
// CHECK:STDOUT: .v = %v
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: <error> = binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: <error> = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref <error> = var %v.var_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc8_10.1: type = splice_block %.loc8_10.2 [concrete = <error>] {
|
||||
// CHECK:STDOUT: %e.ref: <error> = name_ref e, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.Self: <error> = bind_symbolic_name .Self [concrete = <error>]
|
||||
// CHECK:STDOUT: %.Self.ref: <error> = name_ref .Self, %.Self [concrete = <error>]
|
||||
// CHECK:STDOUT: %x.ref: <error> = name_ref x, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc8_10.2: type = where_expr %.Self [concrete = <error>] {
|
||||
// CHECK:STDOUT: requirement_rewrite %x.ref, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: <error> = bind_name v, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+6
-44
@@ -2,9 +2,6 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
||||
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/non_generic.carbon
|
||||
@@ -14,23 +11,21 @@
|
||||
interface I { let T:! type; }
|
||||
|
||||
// Ensure that we don't crash when checking this `where` in a non-generic context.
|
||||
//@dump-sem-ir-begin
|
||||
fn NotGenericF(U: I where .T == i32) {}
|
||||
//@dump-sem-ir-end
|
||||
|
||||
// CHECK:STDOUT: --- non_generic.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
|
||||
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete]
|
||||
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self]
|
||||
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %.Self, @I [symbolic_self]
|
||||
// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
||||
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %I_where.type: type = facet_type <@I where TODO> [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.f03: type = pattern_type %I_where.type [concrete]
|
||||
@@ -39,38 +34,25 @@ fn NotGenericF(U: I where .T == i32) {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .Int = %Core.Int
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .I = %I.decl
|
||||
// CHECK:STDOUT: .NotGenericF = %NotGenericF.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
|
||||
// CHECK:STDOUT: %NotGenericF.decl: %NotGenericF.type = fn_decl @NotGenericF [concrete = constants.%NotGenericF] {
|
||||
// CHECK:STDOUT: %U.patt: %pattern_type.f03 = binding_pattern U [concrete]
|
||||
// CHECK:STDOUT: %U.param_patt: %pattern_type.f03 = value_param_pattern %U.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %U.param: %I_where.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc17_21.1: type = splice_block %.loc17_21.2 [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %.loc15_21.1: type = splice_block %.loc15_21.2 [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc17_27: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %.loc15_27: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type]
|
||||
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17_21.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: %.loc15_21.2: type = where_expr %.Self [concrete = constants.%I_where.type] {
|
||||
// CHECK:STDOUT: requirement_equivalent %impl.elem0, %i32
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -78,28 +60,8 @@ fn NotGenericF(U: I where .T == i32) {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self
|
||||
// CHECK:STDOUT: .T = @T.%assoc0
|
||||
// CHECK:STDOUT: witness = (%T)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: assoc_const T:! type;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @NotGenericF(%U.param: %I_where.type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @T(constants.%Self) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @T(constants.%I.facet) {}
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user