Replace :! binding syntax with phase keywords and contextual defaults (#7479)

Implement the toolchain side of proposal #7254, removing the `:!`
binding
syntax for generic and template parameters in favor of the keywords
`generic`,
`template`, and `runtime` plus contextual defaults for phase.

For valid programs this is semantics-preserving: each binding resolves
to the
same phase, and produces the same SemIR, as it did under `:!`/`:`. The
parser
derives a binding's phase from its syntactic context plus any explicit
phase
keyword; new diagnostics and error recovery for misused keywords are
described
below.

Implementation details for each component:

- Lexer: remove the `:!` (`ColonExclaim`) token, move its virtual
parse-node
  budget onto `:`, and add the `generic` and `runtime` keywords.
- Parser: thread a `BindingContext` (`ExplicitParam`, `DeducedParam`, or
`CompileTimeEntityParam`) from declaration introducers down through
parameter
lists to each binding pattern, using a one-token lookahead to
distinguish a
name-qualifier parameter list from a declaration's own final list.
Parameters
of a compile-time entity (`class`, `interface`, `constraint`, `choice`,
`alias`, `export`, `namespace`) and deduced `[]` parameters default to
checked
generic; explicit function parameters and local bindings default to
runtime.
`HandleBindingPattern` resolves the phase from that context plus the
keyword: a
`generic` keyword needs no node of its own (the phase is carried by the
  binding's node kind), while a `runtime` keyword is preserved as a
`RuntimeBindingName` node so `check` can name it in a diagnostic. A
phase
keyword that is merely redundant with the contextual default is
diagnosed
  here, without invalidating the parse tree.
- Check: a phase keyword that is invalid for its context (for example
`runtime`
on a checked-generic parameter) is diagnosed here, and recovers by
building an
error binding that still introduces the name so that later uses of it do
not
  produce cascading errors.

The removed `:!` syntax is now rejected as an ordinary parse error.

The `form`/`:?`/`->?` ("extended types") portion of proposal #7254 is
left for a
separate change.

Assisted-by: Claude Code
This commit is contained in:
Chandler Carruth
2026-07-11 01:22:44 +00:00
committed by GitHub
parent bf106c3b4b
commit 8be274cf60
482 changed files with 16917 additions and 16226 deletions
+199 -199
View File
@@ -17,13 +17,13 @@ library "[[@TEST_NAME]]";
interface I {}
//@dump-sem-ir-begin
fn F(T:! I where .Self impls type);
fn F(generic T: I where .Self impls type);
//@dump-sem-ir-end
alias Type = type;
//@dump-sem-ir-begin
fn G(T:! I where .Self impls Type);
fn G(generic T: I where .Self impls Type);
//@dump-sem-ir-end
// --- fail_self_impls_error.carbon
@@ -36,11 +36,11 @@ interface I {}
// Because there's an error inside the `where`, the constant value of the
// `where` should be an error also.
//
// CHECK:STDERR: fail_self_impls_error.carbon:[[@LINE+4]]:30: error: name `J` not found [NameNotFound]
// CHECK:STDERR: fn F(T:! I where .Self impls J);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_self_impls_error.carbon:[[@LINE+4]]:37: error: name `J` not found [NameNotFound]
// CHECK:STDERR: fn F(generic T: I where .Self impls J);
// CHECK:STDERR: ^
// CHECK:STDERR:
fn F(T:! I where .Self impls J);
fn F(generic T: I where .Self impls J);
//@dump-sem-ir-end
// --- state_constraints.carbon
@@ -50,16 +50,16 @@ library "[[@TEST_NAME]]";
interface J {}
interface I {
let Member:! type;
let Second:! J;
let Member: type;
let Second: J;
}
//@dump-sem-ir-begin
fn EqualEqual(U:! I where .Self == ());
fn EqualEqual(generic U: I where .Self == ());
fn Impls(V:! J where .Self impls I);
fn Impls(generic V: J where .Self impls I);
fn And(W:! I where .Self impls J and .Member == ());
fn And(generic W: I where .Self impls J and .Member == ());
//@dump-sem-ir-end
// --- associated_type_impls.carbon
@@ -70,48 +70,48 @@ interface L {}
interface M {}
interface K {
let Associated:! L;
let Associated: L;
}
//@dump-sem-ir-begin
fn AssociatedTypeImpls(W:! K where .Associated impls M);
fn AssociatedTypeImpls(generic W: K where .Associated impls M);
//@dump-sem-ir-end
// --- fail_left_of_impls_non_type.carbon
library "[[@TEST_NAME]]";
// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+7]]:32: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
// CHECK:STDERR: fn NonTypeImpls(U:! type where 7 impls type);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+4]]:32: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fn NonTypeImpls(U:! type where 7 impls type);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+7]]:39: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
// CHECK:STDERR: fn NonTypeImpls(generic U: type where 7 impls type);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_left_of_impls_non_type.carbon:[[@LINE+4]]:39: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fn NonTypeImpls(generic U: type where 7 impls type);
// CHECK:STDERR: ^
// CHECK:STDERR:
fn NonTypeImpls(U:! type where 7 impls type);
fn NonTypeImpls(generic U: type where 7 impls type);
// --- fail_right_of_impls_non_type.carbon
library "[[@TEST_NAME]]";
// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+7]]:44: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
// CHECK:STDERR: fn ImplsNonType(U:! type where .Self impls 7);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+4]]:44: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fn ImplsNonType(U:! type where .Self impls 7);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+7]]:51: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
// CHECK:STDERR: fn ImplsNonType(generic U: type where .Self impls 7);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_right_of_impls_non_type.carbon:[[@LINE+4]]:51: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fn ImplsNonType(generic U: type where .Self impls 7);
// CHECK:STDERR: ^
// CHECK:STDERR:
fn ImplsNonType(U:! type where .Self impls 7);
fn ImplsNonType(generic U: type where .Self impls 7);
// --- fail_right_of_impls_non_facet_type.carbon
library "[[@TEST_NAME]]";
// CHECK:STDERR: fail_right_of_impls_non_facet_type.carbon:[[@LINE+4]]:51: error: right argument of `impls` requirement must be a facet type [ImplsOnNonFacetType]
// CHECK:STDERR: fn ImplsOfNonFacetType(U:! type where .Self impls i32);
// CHECK:STDERR: ^~~
// CHECK:STDERR: fail_right_of_impls_non_facet_type.carbon:[[@LINE+4]]:58: error: right argument of `impls` requirement must be a facet type [ImplsOnNonFacetType]
// CHECK:STDERR: fn ImplsOfNonFacetType(generic U: type where .Self impls i32);
// CHECK:STDERR: ^~~
// CHECK:STDERR:
fn ImplsOfNonFacetType(U:! type where .Self impls i32);
fn ImplsOfNonFacetType(generic U: type where .Self impls i32);
// --- fail_enforce_impls_constraint.carbon
@@ -128,9 +128,9 @@ 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:14:10: note: initializing generic parameter `V` declared here [InitializingGenericParam]
// CHECK:STDERR: fn Impls(V:! J where .Self impls I);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: state_constraints.carbon:14:18: note: initializing generic parameter `V` declared here [InitializingGenericParam]
// CHECK:STDERR: fn Impls(generic V: J where .Self impls I);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
Impls(C);
}
@@ -144,7 +144,7 @@ import library "state_constraints";
class C {}
impl C as J {}
fn EmptyStruct(Y:! J where .Self == {});
fn EmptyStruct(generic Y: J where .Self == {});
// TODO: Should report that `C` does not meeet the `==` constraint. Right
// now there is no support for `==` constraints so it rejects it as an
@@ -153,9 +153,9 @@ fn NotEmptyStruct() {
// CHECK:STDERR: fail_todo_enforce_equality_constraint.carbon:[[@LINE+7]]:3: error: cannot convert type `C` into type implementing `J where...` [ConversionFailureTypeToFacet]
// CHECK:STDERR: EmptyStruct(C);
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_enforce_equality_constraint.carbon:[[@LINE-9]]:16: note: initializing generic parameter `Y` declared here [InitializingGenericParam]
// CHECK:STDERR: fn EmptyStruct(Y:! J where .Self == {});
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_enforce_equality_constraint.carbon:[[@LINE-9]]:24: note: initializing generic parameter `Y` declared here [InitializingGenericParam]
// CHECK:STDERR: fn EmptyStruct(generic Y: J where .Self == {});
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
EmptyStruct(C);
}
@@ -165,11 +165,11 @@ fn NotEmptyStruct() {
library "[[@TEST_NAME]]";
//@dump-sem-ir-begin
// CHECK:STDERR: fail_error_in_constraint.carbon:[[@LINE+4]]:41: error: name `I` not found [NameNotFound]
// CHECK:STDERR: fn WithError(U:! type where .Self impls I);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_error_in_constraint.carbon:[[@LINE+4]]:48: error: name `I` not found [NameNotFound]
// CHECK:STDERR: fn WithError(generic U: type where .Self impls I);
// CHECK:STDERR: ^
// CHECK:STDERR:
fn WithError(U:! type where .Self impls I);
fn WithError(generic U: type where .Self impls I);
//@dump-sem-ir-end
// --- import_error_in_constraint.carbon
@@ -205,79 +205,79 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %T.patt.loc7_7.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_7.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc7_15.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_15.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc7_12.1: type = splice_block %.loc7_12.2 [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.frozen.loc7_7: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.2 [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.frozen.loc7_15: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc7_12: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc7_19: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc7_18.1: %I.type = name_ref .Self, %.Self.frozen.loc7_12 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.loc7_30: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.Self.as_type.loc7_18.1: type = facet_access_type %.Self.ref.loc7_18.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc7_18.1: type = converted %.Self.ref.loc7_18.1, %.Self.as_type.loc7_18.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc7_24.1 = requirement_impls %.loc7_18.1, %.loc7_30 [concrete]
// CHECK:STDOUT: %.Self.ref.loc7_25.1: %I.type = name_ref .Self, %.Self.frozen.loc7_19 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.loc7_37: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.Self.as_type.loc7_25.1: type = facet_access_type %.Self.ref.loc7_25.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc7_25.1: type = converted %.Self.ref.loc7_25.1, %.Self.as_type.loc7_25.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc7_31.1 = requirement_impls %.loc7_25.1, %.loc7_37 [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.ref.loc7_18.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc7_18.2: type = facet_access_type %.Self.ref.loc7_18.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc7_18.2: type = converted %.Self.ref.loc7_18.1, %.Self.as_type.loc7_18.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc7_24.2 = requirement_impls %.loc7_18.2, %.loc7_30 [concrete]
// CHECK:STDOUT: %.loc7_12.2: type = where_expr [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.ref.loc7_25.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc7_25.2: type = facet_access_type %.Self.ref.loc7_25.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc7_25.2: type = converted %.Self.ref.loc7_25.1, %.Self.as_type.loc7_25.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc7_31.2 = requirement_impls %.loc7_25.2, %.loc7_37 [concrete]
// CHECK:STDOUT: %.loc7_19.2: type = where_expr [concrete = constants.%I.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %impls.loc7_24.2 = requirement_impls %.loc7_18.2, %.loc7_30 [concrete]
// CHECK:STDOUT: %impls.loc7_31.2 = requirement_impls %.loc7_25.2, %.loc7_37 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc7_7.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc7_7.1 (constants.%T)]
// CHECK:STDOUT: %T.loc7_15.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc7_15.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %T.patt.loc13_7.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_7.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc13_15.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc13_12.1: type = splice_block %.loc13_12.2 [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.frozen.loc13_7: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc13_19.1: type = splice_block %.loc13_19.2 [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.frozen.loc13_15: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc13_12: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc13_19: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc13_18.1: %I.type = name_ref .Self, %.Self.frozen.loc13_12 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.ref.loc13_25.1: %I.type = name_ref .Self, %.Self.frozen.loc13_19 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %Type.ref: type = name_ref Type, file.%Type [concrete = type]
// CHECK:STDOUT: %.Self.as_type.loc13_18.1: type = facet_access_type %.Self.ref.loc13_18.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc13_18.1: type = converted %.Self.ref.loc13_18.1, %.Self.as_type.loc13_18.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc13_24.1 = requirement_impls %.loc13_18.1, %Type.ref [concrete]
// CHECK:STDOUT: %.Self.as_type.loc13_25.1: type = facet_access_type %.Self.ref.loc13_25.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc13_25.1: type = converted %.Self.ref.loc13_25.1, %.Self.as_type.loc13_25.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc13_31.1 = requirement_impls %.loc13_25.1, %Type.ref [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.ref.loc13_18.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc13_18.2: type = facet_access_type %.Self.ref.loc13_18.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc13_18.2: type = converted %.Self.ref.loc13_18.1, %.Self.as_type.loc13_18.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc13_24.2 = requirement_impls %.loc13_18.2, %Type.ref [concrete]
// CHECK:STDOUT: %.loc13_12.2: type = where_expr [concrete = constants.%I.type] {
// CHECK:STDOUT: %.Self.ref.loc13_25.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc13_25.2: type = facet_access_type %.Self.ref.loc13_25.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc13_25.2: type = converted %.Self.ref.loc13_25.1, %.Self.as_type.loc13_25.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc13_31.2 = requirement_impls %.loc13_25.2, %Type.ref [concrete]
// CHECK:STDOUT: %.loc13_19.2: type = where_expr [concrete = constants.%I.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %impls.loc13_24.2 = requirement_impls %.loc13_18.2, %Type.ref [concrete]
// CHECK:STDOUT: %impls.loc13_31.2 = requirement_impls %.loc13_25.2, %Type.ref [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc13_7.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc13_7.1 (constants.%T)]
// CHECK:STDOUT: %T.loc13_15.2: %I.type = symbolic_binding T, 0 [symbolic = %T.loc13_15.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @F(%T.loc7_7.2: %I.type) {
// CHECK:STDOUT: %T.patt.loc7_7.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_7.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc7_7.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc7_7.1 (constants.%T)]
// CHECK:STDOUT: generic fn @F(%T.loc7_15.2: %I.type) {
// CHECK:STDOUT: %T.patt.loc7_15.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc7_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc7_15.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc7_15.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @G(%T.loc13_7.2: %I.type) {
// CHECK:STDOUT: %T.patt.loc13_7.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_7.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc13_7.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc13_7.1 (constants.%T)]
// CHECK:STDOUT: generic fn @G(%T.loc13_15.2: %I.type) {
// CHECK:STDOUT: %T.patt.loc13_15.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc13_15.1: %I.type = symbolic_binding T, 0 [symbolic = %T.loc13_15.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @F(constants.%T) {
// CHECK:STDOUT: %T.patt.loc7_7.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc7_7.1 => constants.%T
// CHECK:STDOUT: %T.patt.loc7_15.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc7_15.1 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @G(constants.%T) {
// CHECK:STDOUT: %T.patt.loc13_7.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc13_7.1 => constants.%T
// CHECK:STDOUT: %T.patt.loc13_15.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc13_15.1 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_self_impls_error.carbon
@@ -298,24 +298,24 @@ fn F() {
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %T.patt: <error> = symbolic_binding_pattern T, 0 [concrete = <error>]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc14_12.1: type = splice_block %.loc14_12.2 [concrete = <error>] {
// CHECK:STDOUT: %.Self.frozen.loc14_7: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc14_19.1: type = splice_block %.loc14_19.2 [concrete = <error>] {
// CHECK:STDOUT: %.Self.frozen.loc14_15: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc14_12: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc14_19: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc14_18.1: %I.type = name_ref .Self, %.Self.frozen.loc14_12 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.ref.loc14_25.1: %I.type = name_ref .Self, %.Self.frozen.loc14_19 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %J.ref: <error> = name_ref J, <error> [concrete = <error>]
// CHECK:STDOUT: %.Self.as_type.loc14_18.1: type = facet_access_type %.Self.ref.loc14_18.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc14_18.1: type = converted %.Self.ref.loc14_18.1, %.Self.as_type.loc14_18.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc14_24.1 = requirement_impls %.loc14_18.1, <error> [concrete]
// CHECK:STDOUT: %.Self.as_type.loc14_25.1: type = facet_access_type %.Self.ref.loc14_25.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc14_25.1: type = converted %.Self.ref.loc14_25.1, %.Self.as_type.loc14_25.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc14_31.1 = requirement_impls %.loc14_25.1, <error> [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.ref.loc14_18.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc14_18.2: type = facet_access_type %.Self.ref.loc14_18.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc14_18.2: type = converted %.Self.ref.loc14_18.1, %.Self.as_type.loc14_18.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc14_24.2 = requirement_impls %.loc14_18.2, <error> [concrete]
// CHECK:STDOUT: %.loc14_12.2: type = where_expr [concrete = <error>] {
// CHECK:STDOUT: %.Self.ref.loc14_25.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc14_25.2: type = facet_access_type %.Self.ref.loc14_25.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc14_25.2: type = converted %.Self.ref.loc14_25.1, %.Self.as_type.loc14_25.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc14_31.2 = requirement_impls %.loc14_25.2, <error> [concrete]
// CHECK:STDOUT: %.loc14_19.2: type = where_expr [concrete = <error>] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %impls.loc14_24.2 = requirement_impls %.loc14_18.2, <error> [concrete]
// CHECK:STDOUT: %impls.loc14_31.2 = requirement_impls %.loc14_25.2, <error> [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %T: <error> = symbolic_binding T, 0 [concrete = <error>]
@@ -373,122 +373,122 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %EqualEqual.decl: %EqualEqual.type = fn_decl @EqualEqual [concrete = constants.%EqualEqual] {
// CHECK:STDOUT: %U.patt.loc12_16.1: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_16.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.patt.loc12_24.1: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_24.2 (constants.%U.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc12_21.1: type = splice_block %.loc12_21.2 [concrete = constants.%I_where.type.267] {
// CHECK:STDOUT: %.Self.frozen.loc12_16: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc12_28.1: type = splice_block %.loc12_28.2 [concrete = constants.%I_where.type.267] {
// CHECK:STDOUT: %.Self.frozen.loc12_24: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc12_21: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc12_28: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc12_27.1: %I.type = name_ref .Self, %.Self.frozen.loc12_21 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.loc12_37: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc12_33.1 = requirement_equivalent %.Self.ref.loc12_27.1, %.loc12_37 [concrete]
// CHECK:STDOUT: %.Self.ref.loc12_34.1: %I.type = name_ref .Self, %.Self.frozen.loc12_28 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.loc12_44: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc12_40.1 = requirement_equivalent %.Self.ref.loc12_34.1, %.loc12_44 [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %.Self.ref.loc12_27.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %equiv.loc12_33.2 = requirement_equivalent %.Self.ref.loc12_27.2, %.loc12_37 [concrete]
// CHECK:STDOUT: %.loc12_21.2: type = where_expr [concrete = constants.%I_where.type.267] {
// CHECK:STDOUT: %.Self.ref.loc12_34.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %equiv.loc12_40.2 = requirement_equivalent %.Self.ref.loc12_34.2, %.loc12_44 [concrete]
// CHECK:STDOUT: %.loc12_28.2: type = where_expr [concrete = constants.%I_where.type.267] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %equiv.loc12_33.2 = requirement_equivalent %.Self.ref.loc12_27.2, %.loc12_37 [concrete]
// CHECK:STDOUT: %equiv.loc12_40.2 = requirement_equivalent %.Self.ref.loc12_34.2, %.loc12_44 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc12_16.2: %I_where.type.267 = symbolic_binding U, 0 [symbolic = %U.loc12_16.1 (constants.%U)]
// CHECK:STDOUT: %U.loc12_24.2: %I_where.type.267 = symbolic_binding U, 0 [symbolic = %U.loc12_24.1 (constants.%U)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %Impls.decl: %Impls.type = fn_decl @Impls [concrete = constants.%Impls] {
// CHECK:STDOUT: %V.patt.loc14_11.1: %pattern_type.17c = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc14_11.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.patt.loc14_19.1: %pattern_type.17c = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc14_19.2 (constants.%V.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc14_16.1: type = splice_block %.loc14_16.2 [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc14_11: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc14_23.1: type = splice_block %.loc14_23.2 [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc14_19: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
// CHECK:STDOUT: %.Self.frozen.loc14_16: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.frozen.loc14_23: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %J.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc14_22.1: %J.type = name_ref .Self, %.Self.frozen.loc14_16 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.ref.loc14_29.1: %J.type = name_ref .Self, %.Self.frozen.loc14_23 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.as_type.loc14_22.1: type = facet_access_type %.Self.ref.loc14_22.1 [symbolic_self = constants.%.Self.frozen.as_type.8c8]
// CHECK:STDOUT: %.loc14_22.1: type = converted %.Self.ref.loc14_22.1, %.Self.as_type.loc14_22.1 [symbolic_self = constants.%.Self.frozen.as_type.8c8]
// CHECK:STDOUT: %impls.loc14_28.1 = requirement_impls %.loc14_22.1, %I.ref [concrete]
// CHECK:STDOUT: %.Self.as_type.loc14_29.1: type = facet_access_type %.Self.ref.loc14_29.1 [symbolic_self = constants.%.Self.frozen.as_type.8c8]
// CHECK:STDOUT: %.loc14_29.1: type = converted %.Self.ref.loc14_29.1, %.Self.as_type.loc14_29.1 [symbolic_self = constants.%.Self.frozen.as_type.8c8]
// CHECK:STDOUT: %impls.loc14_35.1 = requirement_impls %.loc14_29.1, %I.ref [concrete]
// CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.6ef]
// CHECK:STDOUT: %.Self.ref.loc14_22.2: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.6ef]
// CHECK:STDOUT: %.Self.as_type.loc14_22.2: type = facet_access_type %.Self.ref.loc14_22.2 [symbolic_self = constants.%.Self.as_type.8c4]
// CHECK:STDOUT: %.loc14_22.2: type = converted %.Self.ref.loc14_22.1, %.Self.as_type.loc14_22.2 [symbolic_self = constants.%.Self.as_type.8c4]
// CHECK:STDOUT: %impls.loc14_28.2 = requirement_impls %.loc14_22.2, %I.ref [concrete]
// CHECK:STDOUT: %.loc14_16.2: type = where_expr [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.ref.loc14_29.2: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.6ef]
// CHECK:STDOUT: %.Self.as_type.loc14_29.2: type = facet_access_type %.Self.ref.loc14_29.2 [symbolic_self = constants.%.Self.as_type.8c4]
// CHECK:STDOUT: %.loc14_29.2: type = converted %.Self.ref.loc14_29.1, %.Self.as_type.loc14_29.2 [symbolic_self = constants.%.Self.as_type.8c4]
// CHECK:STDOUT: %impls.loc14_35.2 = requirement_impls %.loc14_29.2, %I.ref [concrete]
// CHECK:STDOUT: %.loc14_23.2: type = where_expr [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %J.ref [concrete]
// CHECK:STDOUT: %impls.loc14_28.2 = requirement_impls %.loc14_22.2, %I.ref [concrete]
// CHECK:STDOUT: %impls.loc14_35.2 = requirement_impls %.loc14_29.2, %I.ref [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %V.loc14_11.2: %J_where.type = symbolic_binding V, 0 [symbolic = %V.loc14_11.1 (constants.%V)]
// CHECK:STDOUT: %V.loc14_19.2: %J_where.type = symbolic_binding V, 0 [symbolic = %V.loc14_19.1 (constants.%V)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [concrete = constants.%And] {
// CHECK:STDOUT: %W.patt.loc16_9.1: %pattern_type.e37 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_9.2 (constants.%W.patt)]
// CHECK:STDOUT: %W.patt.loc16_17.1: %pattern_type.e37 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_17.2 (constants.%W.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc16_14.1: type = splice_block %.loc16_14.2 [concrete = constants.%I_where.type.a1d] {
// CHECK:STDOUT: %.Self.frozen.loc16_9: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc16_21.1: type = splice_block %.loc16_21.2 [concrete = constants.%I_where.type.a1d] {
// CHECK:STDOUT: %.Self.frozen.loc16_17: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc16_14: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc16_21: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc16_20.1: %I.type = name_ref .Self, %.Self.frozen.loc16_14 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.ref.loc16_27.1: %I.type = name_ref .Self, %.Self.frozen.loc16_21 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
// CHECK:STDOUT: %.Self.as_type.loc16_20.1: type = facet_access_type %.Self.ref.loc16_20.1 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.loc16_20.1: type = converted %.Self.ref.loc16_20.1, %.Self.as_type.loc16_20.1 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %impls.loc16_26.1 = requirement_impls %.loc16_20.1, %J.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc16_38: %I.type = name_ref .Self, %.Self.frozen.loc16_14 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.as_type.loc16_38: type = facet_access_type %.Self.ref.loc16_38 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.loc16_38: type = converted %.Self.ref.loc16_38, %.Self.as_type.loc16_38 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.Self.as_type.loc16_27.1: type = facet_access_type %.Self.ref.loc16_27.1 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.loc16_27.1: type = converted %.Self.ref.loc16_27.1, %.Self.as_type.loc16_27.1 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %impls.loc16_33.1 = requirement_impls %.loc16_27.1, %J.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc16_45: %I.type = name_ref .Self, %.Self.frozen.loc16_21 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.as_type.loc16_45: type = facet_access_type %.Self.ref.loc16_45 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.loc16_45: type = converted %.Self.ref.loc16_45, %.Self.as_type.loc16_45 [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %Member.ref: %I.assoc_type = name_ref Member, @Member.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc16_38.1: type = impl_witness_access constants.%I.lookup_impl_witness.ced, element0 [symbolic_self = constants.%impl.elem0.125]
// CHECK:STDOUT: %.loc16_50: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc16_46.1 = requirement_equivalent %impl.elem0.loc16_38.1, %.loc16_50 [concrete]
// CHECK:STDOUT: %impl.elem0.loc16_45.1: type = impl_witness_access constants.%I.lookup_impl_witness.ced, element0 [symbolic_self = constants.%impl.elem0.125]
// CHECK:STDOUT: %.loc16_57: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc16_53.1 = requirement_equivalent %impl.elem0.loc16_45.1, %.loc16_57 [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %.Self.ref.loc16_20.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %.Self.as_type.loc16_20.2: type = facet_access_type %.Self.ref.loc16_20.2 [symbolic_self = constants.%.Self.as_type.f7e]
// CHECK:STDOUT: %.loc16_20.2: type = converted %.Self.ref.loc16_20.1, %.Self.as_type.loc16_20.2 [symbolic_self = constants.%.Self.as_type.f7e]
// CHECK:STDOUT: %impls.loc16_26.2 = requirement_impls %.loc16_20.2, %J.ref [concrete]
// CHECK:STDOUT: %impl.elem0.loc16_38.2: type = impl_witness_access constants.%I.lookup_impl_witness.78b, element0 [symbolic_self = constants.%impl.elem0.e55]
// CHECK:STDOUT: %equiv.loc16_46.2 = requirement_equivalent %impl.elem0.loc16_38.2, %.loc16_50 [concrete]
// CHECK:STDOUT: %.loc16_14.2: type = where_expr [concrete = constants.%I_where.type.a1d] {
// CHECK:STDOUT: %.Self.ref.loc16_27.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %.Self.as_type.loc16_27.2: type = facet_access_type %.Self.ref.loc16_27.2 [symbolic_self = constants.%.Self.as_type.f7e]
// CHECK:STDOUT: %.loc16_27.2: type = converted %.Self.ref.loc16_27.1, %.Self.as_type.loc16_27.2 [symbolic_self = constants.%.Self.as_type.f7e]
// CHECK:STDOUT: %impls.loc16_33.2 = requirement_impls %.loc16_27.2, %J.ref [concrete]
// CHECK:STDOUT: %impl.elem0.loc16_45.2: type = impl_witness_access constants.%I.lookup_impl_witness.78b, element0 [symbolic_self = constants.%impl.elem0.e55]
// CHECK:STDOUT: %equiv.loc16_53.2 = requirement_equivalent %impl.elem0.loc16_45.2, %.loc16_57 [concrete]
// CHECK:STDOUT: %.loc16_21.2: type = where_expr [concrete = constants.%I_where.type.a1d] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %impls.loc16_26.2 = requirement_impls %.loc16_20.2, %J.ref [concrete]
// CHECK:STDOUT: %equiv.loc16_46.2 = requirement_equivalent %impl.elem0.loc16_38.2, %.loc16_50 [concrete]
// CHECK:STDOUT: %impls.loc16_33.2 = requirement_impls %.loc16_27.2, %J.ref [concrete]
// CHECK:STDOUT: %equiv.loc16_53.2 = requirement_equivalent %impl.elem0.loc16_45.2, %.loc16_57 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %W.loc16_9.2: %I_where.type.a1d = symbolic_binding W, 0 [symbolic = %W.loc16_9.1 (constants.%W)]
// CHECK:STDOUT: %W.loc16_17.2: %I_where.type.a1d = symbolic_binding W, 0 [symbolic = %W.loc16_17.1 (constants.%W)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @EqualEqual(%U.loc12_16.2: %I_where.type.267) {
// CHECK:STDOUT: %U.patt.loc12_16.2: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_16.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.loc12_16.1: %I_where.type.267 = symbolic_binding U, 0 [symbolic = %U.loc12_16.1 (constants.%U)]
// CHECK:STDOUT: generic fn @EqualEqual(%U.loc12_24.2: %I_where.type.267) {
// CHECK:STDOUT: %U.patt.loc12_24.2: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc12_24.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.loc12_24.1: %I_where.type.267 = symbolic_binding U, 0 [symbolic = %U.loc12_24.1 (constants.%U)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Impls(%V.loc14_11.2: %J_where.type) {
// CHECK:STDOUT: %V.patt.loc14_11.2: %pattern_type.17c = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc14_11.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc14_11.1: %J_where.type = symbolic_binding V, 0 [symbolic = %V.loc14_11.1 (constants.%V)]
// CHECK:STDOUT: generic fn @Impls(%V.loc14_19.2: %J_where.type) {
// CHECK:STDOUT: %V.patt.loc14_19.2: %pattern_type.17c = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc14_19.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc14_19.1: %J_where.type = symbolic_binding V, 0 [symbolic = %V.loc14_19.1 (constants.%V)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @And(%W.loc16_9.2: %I_where.type.a1d) {
// CHECK:STDOUT: %W.patt.loc16_9.2: %pattern_type.e37 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_9.2 (constants.%W.patt)]
// CHECK:STDOUT: %W.loc16_9.1: %I_where.type.a1d = symbolic_binding W, 0 [symbolic = %W.loc16_9.1 (constants.%W)]
// CHECK:STDOUT: generic fn @And(%W.loc16_17.2: %I_where.type.a1d) {
// CHECK:STDOUT: %W.patt.loc16_17.2: %pattern_type.e37 = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc16_17.2 (constants.%W.patt)]
// CHECK:STDOUT: %W.loc16_17.1: %I_where.type.a1d = symbolic_binding W, 0 [symbolic = %W.loc16_17.1 (constants.%W)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @EqualEqual(constants.%U) {
// CHECK:STDOUT: %U.patt.loc12_16.2 => constants.%U.patt
// CHECK:STDOUT: %U.loc12_16.1 => constants.%U
// CHECK:STDOUT: %U.patt.loc12_24.2 => constants.%U.patt
// CHECK:STDOUT: %U.loc12_24.1 => constants.%U
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Impls(constants.%V) {
// CHECK:STDOUT: %V.patt.loc14_11.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc14_11.1 => constants.%V
// CHECK:STDOUT: %V.patt.loc14_19.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc14_19.1 => constants.%V
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @And(constants.%W) {
// CHECK:STDOUT: %W.patt.loc16_9.2 => constants.%W.patt
// CHECK:STDOUT: %W.loc16_9.1 => constants.%W
// CHECK:STDOUT: %W.patt.loc16_17.2 => constants.%W.patt
// CHECK:STDOUT: %W.loc16_17.1 => constants.%W
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- associated_type_impls.carbon
@@ -520,45 +520,45 @@ fn F() {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %AssociatedTypeImpls.decl: %AssociatedTypeImpls.type = fn_decl @AssociatedTypeImpls [concrete = constants.%AssociatedTypeImpls] {
// CHECK:STDOUT: %W.patt.loc12_25.1: %pattern_type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_25.2 (constants.%W.patt)]
// CHECK:STDOUT: %W.patt.loc12_33.1: %pattern_type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_33.2 (constants.%W.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc12_30.1: type = splice_block %.loc12_30.2 [concrete = constants.%K_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc12_25: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc12_37.1: type = splice_block %.loc12_37.2 [concrete = constants.%K_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc12_33: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type]
// CHECK:STDOUT: %.Self.frozen.loc12_30: %K.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.b1d]
// CHECK:STDOUT: %.Self.frozen.loc12_37: %K.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.b1d]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %K.ref [concrete]
// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self.frozen.loc12_30 [symbolic_self = constants.%.Self.frozen.b1d]
// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self.frozen.loc12_37 [symbolic_self = constants.%.Self.frozen.b1d]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc12_36.1: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc12_43.1: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %Associated.ref: %K.assoc_type = name_ref Associated, @Associated.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc12_36.1: %L.type = impl_witness_access constants.%K.lookup_impl_witness.46f, element0 [symbolic_self = constants.%impl.elem0.c97]
// CHECK:STDOUT: %impl.elem0.loc12_43.1: %L.type = impl_witness_access constants.%K.lookup_impl_witness.46f, element0 [symbolic_self = constants.%impl.elem0.c97]
// CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type]
// CHECK:STDOUT: %as_type.loc12_36.1: type = facet_access_type %impl.elem0.loc12_36.1 [symbolic_self = constants.%as_type.3da]
// CHECK:STDOUT: %.loc12_36.2: type = converted %impl.elem0.loc12_36.1, %as_type.loc12_36.1 [symbolic_self = constants.%as_type.3da]
// CHECK:STDOUT: %impls.loc12_48.1 = requirement_impls %.loc12_36.2, %M.ref [concrete]
// CHECK:STDOUT: %impl.elem0.loc12_36.2: %L.type = impl_witness_access constants.%K.lookup_impl_witness.4f0, element0 [symbolic_self = constants.%impl.elem0.819]
// CHECK:STDOUT: %as_type.loc12_36.2: type = facet_access_type %impl.elem0.loc12_36.2 [symbolic_self = constants.%as_type.75b]
// CHECK:STDOUT: %.loc12_36.3: type = converted %impl.elem0.loc12_36.1, %as_type.loc12_36.2 [symbolic_self = constants.%as_type.75b]
// CHECK:STDOUT: %impls.loc12_48.2 = requirement_impls %.loc12_36.3, %M.ref [concrete]
// CHECK:STDOUT: %.loc12_30.2: type = where_expr [concrete = constants.%K_where.type] {
// CHECK:STDOUT: %as_type.loc12_43.1: type = facet_access_type %impl.elem0.loc12_43.1 [symbolic_self = constants.%as_type.3da]
// CHECK:STDOUT: %.loc12_43.2: type = converted %impl.elem0.loc12_43.1, %as_type.loc12_43.1 [symbolic_self = constants.%as_type.3da]
// CHECK:STDOUT: %impls.loc12_55.1 = requirement_impls %.loc12_43.2, %M.ref [concrete]
// CHECK:STDOUT: %impl.elem0.loc12_43.2: %L.type = impl_witness_access constants.%K.lookup_impl_witness.4f0, element0 [symbolic_self = constants.%impl.elem0.819]
// CHECK:STDOUT: %as_type.loc12_43.2: type = facet_access_type %impl.elem0.loc12_43.2 [symbolic_self = constants.%as_type.75b]
// CHECK:STDOUT: %.loc12_43.3: type = converted %impl.elem0.loc12_43.1, %as_type.loc12_43.2 [symbolic_self = constants.%as_type.75b]
// CHECK:STDOUT: %impls.loc12_55.2 = requirement_impls %.loc12_43.3, %M.ref [concrete]
// CHECK:STDOUT: %.loc12_37.2: type = where_expr [concrete = constants.%K_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %K.ref [concrete]
// CHECK:STDOUT: %impls.loc12_48.2 = requirement_impls %.loc12_36.3, %M.ref [concrete]
// CHECK:STDOUT: %impls.loc12_55.2 = requirement_impls %.loc12_43.3, %M.ref [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %W.loc12_25.2: %K_where.type = symbolic_binding W, 0 [symbolic = %W.loc12_25.1 (constants.%W)]
// CHECK:STDOUT: %W.loc12_33.2: %K_where.type = symbolic_binding W, 0 [symbolic = %W.loc12_33.1 (constants.%W)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @AssociatedTypeImpls(%W.loc12_25.2: %K_where.type) {
// CHECK:STDOUT: %W.patt.loc12_25.2: %pattern_type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_25.2 (constants.%W.patt)]
// CHECK:STDOUT: %W.loc12_25.1: %K_where.type = symbolic_binding W, 0 [symbolic = %W.loc12_25.1 (constants.%W)]
// CHECK:STDOUT: generic fn @AssociatedTypeImpls(%W.loc12_33.2: %K_where.type) {
// CHECK:STDOUT: %W.patt.loc12_33.2: %pattern_type = symbolic_binding_pattern W, 0 [symbolic = %W.patt.loc12_33.2 (constants.%W.patt)]
// CHECK:STDOUT: %W.loc12_33.1: %K_where.type = symbolic_binding W, 0 [symbolic = %W.loc12_33.1 (constants.%W)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @AssociatedTypeImpls(constants.%W) {
// CHECK:STDOUT: %W.patt.loc12_25.2 => constants.%W.patt
// CHECK:STDOUT: %W.loc12_25.1 => constants.%W
// CHECK:STDOUT: %W.patt.loc12_33.2 => constants.%W.patt
// CHECK:STDOUT: %W.loc12_33.1 => constants.%W
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_error_in_constraint.carbon
@@ -577,24 +577,24 @@ fn F() {
// CHECK:STDOUT: %WithError.decl: %WithError.type = fn_decl @WithError [concrete = constants.%WithError] {
// CHECK:STDOUT: %U.patt: <error> = symbolic_binding_pattern U, 0 [concrete = <error>]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [concrete = <error>] {
// CHECK:STDOUT: %.Self.frozen.loc9_15: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc9_18: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc9_30.1: type = splice_block %.loc9_30.2 [concrete = <error>] {
// CHECK:STDOUT: %.Self.frozen.loc9_23: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc9_18 [concrete]
// CHECK:STDOUT: %.Self.ref.loc9_29.1: %type = name_ref .Self, %.Self.frozen.loc9_23 [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %.loc9_25: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.Self.frozen.loc9_30: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc9_25 [concrete]
// CHECK:STDOUT: %.Self.ref.loc9_36.1: %type = name_ref .Self, %.Self.frozen.loc9_30 [symbolic_self = constants.%.Self.frozen]
// CHECK:STDOUT: %I.ref: <error> = name_ref I, <error> [concrete = <error>]
// CHECK:STDOUT: %.Self.as_type.loc9_29.1: type = facet_access_type %.Self.ref.loc9_29.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc9_29.1: type = converted %.Self.ref.loc9_29.1, %.Self.as_type.loc9_29.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc9_35.1 = requirement_impls %.loc9_29.1, <error> [concrete]
// CHECK:STDOUT: %.Self.as_type.loc9_36.1: type = facet_access_type %.Self.ref.loc9_36.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc9_36.1: type = converted %.Self.ref.loc9_36.1, %.Self.as_type.loc9_36.1 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impls.loc9_42.1 = requirement_impls %.loc9_36.1, <error> [concrete]
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.ref.loc9_29.2: %type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc9_29.2: type = facet_access_type %.Self.ref.loc9_29.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc9_29.2: type = converted %.Self.ref.loc9_29.1, %.Self.as_type.loc9_29.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc9_35.2 = requirement_impls %.loc9_29.2, <error> [concrete]
// CHECK:STDOUT: %.loc9_23.2: type = where_expr [concrete = <error>] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc9_18 [concrete]
// CHECK:STDOUT: %impls.loc9_35.2 = requirement_impls %.loc9_29.2, <error> [concrete]
// CHECK:STDOUT: %.Self.ref.loc9_36.2: %type = name_ref .Self, %.Self [symbolic_self = constants.%.Self]
// CHECK:STDOUT: %.Self.as_type.loc9_36.2: type = facet_access_type %.Self.ref.loc9_36.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc9_36.2: type = converted %.Self.ref.loc9_36.1, %.Self.as_type.loc9_36.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc9_42.2 = requirement_impls %.loc9_36.2, <error> [concrete]
// CHECK:STDOUT: %.loc9_30.2: type = where_expr [concrete = <error>] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc9_25 [concrete]
// CHECK:STDOUT: %impls.loc9_42.2 = requirement_impls %.loc9_36.2, <error> [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %U: <error> = symbolic_binding U, 0 [concrete = <error>]
+132 -132
View File
@@ -15,15 +15,15 @@
library "[[@TEST_NAME]]";
interface I {
let Member:! type;
let Member: type;
}
//@dump-sem-ir-begin
fn PeriodSelf(T:! I where .Self == ());
fn PeriodSelf(generic T: I where .Self == ());
fn PeriodMember(U:! I where .Member == ());
fn PeriodMember(generic U: I where .Member == ());
fn TypeSelfImpls(V:! type where .Self impls I);
fn TypeSelfImpls(generic V: type where .Self impls I);
//@dump-sem-ir-end
// --- fail_wrong_member.carbon
@@ -31,14 +31,14 @@ fn TypeSelfImpls(V:! type where .Self impls I);
library "[[@TEST_NAME]]";
interface J {
let Member:! type;
let Member: type;
}
// CHECK:STDERR: fail_wrong_member.carbon:[[@LINE+4]]:31: error: member name `Mismatch` not found in `J` [MemberNameNotFoundInSpecificScope]
// CHECK:STDERR: fn PeriodMismatch(W:! J where .Mismatch = {});
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_wrong_member.carbon:[[@LINE+4]]:38: error: member name `Mismatch` not found in `J` [MemberNameNotFoundInSpecificScope]
// CHECK:STDERR: fn PeriodMismatch(generic W: J where .Mismatch = {});
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn PeriodMismatch(W:! J where .Mismatch = {});
fn PeriodMismatch(generic W: J where .Mismatch = {});
// --- fail_designator_matches_var.carbon
@@ -96,179 +96,179 @@ library "[[@TEST_NAME]]";
interface I {}
// CHECK:STDERR: fail_impls_constraint_does_not_constrain_self.carbon:[[@LINE+4]]:38: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(U:! type, unused T:! type where U impls I) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_impls_constraint_does_not_constrain_self.carbon:[[@LINE+4]]:52: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(generic U: type, unused generic T: type where U impls I) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn F(U:! type, unused T:! type where U impls I) {}
fn F(generic U: type, unused generic T: type where U impls I) {}
// --- fail_equality_constraint_does_not_constrain_self.carbon
library "[[@TEST_NAME]]";
interface I {
let X:! type;
let X: type;
}
// CHECK:STDERR: fail_equality_constraint_does_not_constrain_self.carbon:[[@LINE+4]]:35: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(U:! I, unused T:! type where U.X == ()) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_equality_constraint_does_not_constrain_self.carbon:[[@LINE+4]]:49: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(generic U: I, unused generic T: type where U.X == ()) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn F(U:! I, unused T:! type where U.X == ()) {}
fn F(generic U: I, unused generic T: type where U.X == ()) {}
// --- fail_combined_constraint_does_not_constrain_self.carbon
library "[[@TEST_NAME]]";
interface I {
let X:! type;
let X: type;
}
// CHECK:STDERR: fail_combined_constraint_does_not_constrain_self.carbon:[[@LINE+8]]:35: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(U:! I, unused T:! type where U impls I and U.X == ()) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
// CHECK:STDERR: fail_combined_constraint_does_not_constrain_self.carbon:[[@LINE+4]]:49: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(U:! I, unused T:! type where U impls I and U.X == ()) {}
// CHECK:STDERR: fail_combined_constraint_does_not_constrain_self.carbon:[[@LINE+8]]:49: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(generic U: I, unused generic T: type where U impls I and U.X == ()) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn F(U:! I, unused T:! type where U impls I and U.X == ()) {}
// CHECK:STDERR: fail_combined_constraint_does_not_constrain_self.carbon:[[@LINE+4]]:63: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(generic U: I, unused generic T: type where U impls I and U.X == ()) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn F(generic U: I, unused generic T: type where U impls I and U.X == ()) {}
// --- impls_constraint_does_constrain_self.carbon
library "[[@TEST_NAME]]";
interface I(T:! type) {}
interface I(T: type) {}
class C(T:! type);
class C(T: type);
fn F(unused T:! type where C(.Self) impls I(())) {}
fn F(unused generic T: type where C(.Self) impls I(())) {}
fn G(unused T:! type where C(()) impls I(.Self)) {}
fn G(unused generic T: type where C(()) impls I(.Self)) {}
// --- fail_where_without_designator_in_one_equiv_constraint.carbon
library "[[@TEST_NAME]]";
interface I {}
interface J(T:! type) {}
class A(T:! type);
interface J(T: type) {}
class A(T: type);
class B;
class C;
// CHECK:STDERR: fail_where_without_designator_in_one_equiv_constraint.carbon:[[@LINE+4]]:46: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused T:! type where A(.Self) == B and A(B) == B) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_where_without_designator_in_one_equiv_constraint.carbon:[[@LINE+4]]:53: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused generic T: type where A(.Self) == B and A(B) == B) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn F(unused T:! type where A(.Self) == B and A(B) == B) {}
fn F(unused generic T: type where A(.Self) == B and A(B) == B) {}
interface Z {
let Z0:! type;
let Z0: type;
}
// CHECK:STDERR: fail_where_without_designator_in_one_equiv_constraint.carbon:[[@LINE+4]]:41: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn G(unused T:! Z where A(.Z0) == B and A(B) == B) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR: fail_where_without_designator_in_one_equiv_constraint.carbon:[[@LINE+4]]:48: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn G(unused generic T: Z where A(.Z0) == B and A(B) == B) {}
// CHECK:STDERR: ^~~~~~~~~
// CHECK:STDERR:
fn G(unused T:! Z where A(.Z0) == B and A(B) == B) {}
fn G(unused generic T: Z where A(.Z0) == B and A(B) == B) {}
// --- fail_where_without_self_designator_in_one_impls_interface.carbon
library "[[@TEST_NAME]]";
interface Z(T:! type) {}
interface Z(T: type) {}
interface I {}
interface J(T:! type) {}
interface J(T: type) {}
class C;
// CHECK:STDERR: fail_where_without_self_designator_in_one_impls_interface.carbon:[[@LINE+4]]:28: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused T:! type where C impls (I & J(.Self))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_where_without_self_designator_in_one_impls_interface.carbon:[[@LINE+4]]:35: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused generic T: type where C impls (I & J(.Self))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
fn F(unused T:! type where C impls (I & J(.Self))) {}
fn F(unused generic T: type where C impls (I & J(.Self))) {}
// --- fail_where_without_member_designator_in_one_impls_interface.carbon
library "[[@TEST_NAME]]";
interface Z {
let Z0:! type;
let Z0: type;
}
interface I {}
interface J(T:! type) {}
interface J(T: type) {}
class C;
// CHECK:STDERR: fail_where_without_member_designator_in_one_impls_interface.carbon:[[@LINE+4]]:25: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused T:! Z where C impls (I & J(.Z0))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_where_without_member_designator_in_one_impls_interface.carbon:[[@LINE+4]]:32: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused generic T: Z where C impls (I & J(.Z0))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
fn F(unused T:! Z where C impls (I & J(.Z0))) {}
fn F(unused generic T: Z where C impls (I & J(.Z0))) {}
// --- fail_where_without_self_designator_in_one_impls_named_constraint.carbon
library "[[@TEST_NAME]]";
interface Z {}
constraint I {}
interface J(T:! type) {}
constraint K(T:! type) {
interface J(T: type) {}
constraint K(T: type) {
require T impls J(Self);
}
class C;
// CHECK:STDERR: fail_where_without_self_designator_in_one_impls_named_constraint.carbon:[[@LINE+4]]:28: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused T:! type where C impls (I & K(.Self))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_where_without_self_designator_in_one_impls_named_constraint.carbon:[[@LINE+4]]:35: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused generic T: type where C impls (I & K(.Self))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
fn F(unused T:! type where C impls (I & K(.Self))) {}
fn F(unused generic T: type where C impls (I & K(.Self))) {}
// --- fail_where_without_member_designator_in_one_impls_named_constraint.carbon
library "[[@TEST_NAME]]";
interface Z {
let Z0:! type;
let Z0: type;
}
constraint I {}
interface J(T:! type) {}
constraint K(T:! type) {
interface J(T: type) {}
constraint K(T: type) {
require T impls J(Self);
}
class C;
// CHECK:STDERR: fail_where_without_member_designator_in_one_impls_named_constraint.carbon:[[@LINE+4]]:25: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused T:! Z where C impls (I & K(.Z0))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_where_without_member_designator_in_one_impls_named_constraint.carbon:[[@LINE+4]]:32: error: constraint in `where` clause without a designator; expected `.Self` or a member access like `.M` [WhereWithoutDesignator]
// CHECK:STDERR: fn F(unused generic T: Z where C impls (I & K(.Z0))) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
fn F(unused T:! Z where C impls (I & K(.Z0))) {}
fn F(unused generic T: Z where C impls (I & K(.Z0))) {}
// --- constraint_does_constrain_designator_as_self.carbon
library "[[@TEST_NAME]]";
interface Z(T:! type) {}
constraint N(T:! type) {
interface Z(T: type) {}
constraint N(T: type) {
require T impls Z(Self);
}
class C;
fn F(unused T:! type where C impls N(.Self)) {}
fn F(unused generic T: type where C impls N(.Self)) {}
// --- constraint_does_constrain_designator_as_specific.carbon
library "[[@TEST_NAME]]";
interface Z(T:! type) {}
constraint N(T:! type) {
interface Z(T: type) {}
constraint N(T: type) {
require impls Z(T);
}
class C;
fn F(unused T:! type where C impls N(.Self)) {}
fn F(unused generic T: type where C impls N(.Self)) {}
// --- todo_fail_constraint_does_not_constrain_designator.carbon
library "[[@TEST_NAME]]";
interface Z {}
constraint N(T:! type) {
constraint N(T: type) {
require impls Z;
}
class C;
// TODO: This `.Self` is not actually constrained by `C impls N(.Self)`, so it
// should fail.
fn F(unused T:! type where C impls N(.Self)) {}
fn F(unused generic T: type where C impls N(.Self)) {}
// CHECK:STDOUT: --- success.carbon
// CHECK:STDOUT:
@@ -310,110 +310,110 @@ fn F(unused T:! type where C impls N(.Self)) {}
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %PeriodSelf.decl: %PeriodSelf.type = fn_decl @PeriodSelf [concrete = constants.%PeriodSelf] {
// CHECK:STDOUT: %T.patt.loc9_16.1: %pattern_type.603 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_16.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc9_24.1: %pattern_type.603 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_24.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc9_21.1: type = splice_block %.loc9_21.2 [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc9_16: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.2 [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc9_24: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc9_21: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc9_28: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc9_27.1: %I.type = name_ref .Self, %.Self.frozen.loc9_21 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.loc9_37: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc9_33.1 = requirement_equivalent %.Self.ref.loc9_27.1, %.loc9_37 [concrete]
// CHECK:STDOUT: %.Self.ref.loc9_34.1: %I.type = name_ref .Self, %.Self.frozen.loc9_28 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.loc9_44: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc9_40.1 = requirement_equivalent %.Self.ref.loc9_34.1, %.loc9_44 [concrete]
// CHECK:STDOUT: %.Self: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %.Self.ref.loc9_27.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %equiv.loc9_33.2 = requirement_equivalent %.Self.ref.loc9_27.2, %.loc9_37 [concrete]
// CHECK:STDOUT: %.loc9_21.2: type = where_expr [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %.Self.ref.loc9_34.2: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.f73]
// CHECK:STDOUT: %equiv.loc9_40.2 = requirement_equivalent %.Self.ref.loc9_34.2, %.loc9_44 [concrete]
// CHECK:STDOUT: %.loc9_28.2: type = where_expr [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %equiv.loc9_33.2 = requirement_equivalent %.Self.ref.loc9_27.2, %.loc9_37 [concrete]
// CHECK:STDOUT: %equiv.loc9_40.2 = requirement_equivalent %.Self.ref.loc9_34.2, %.loc9_44 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc9_16.2: %I_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_16.1 (constants.%T)]
// CHECK:STDOUT: %T.loc9_24.2: %I_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_24.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %PeriodMember.decl: %PeriodMember.type = fn_decl @PeriodMember [concrete = constants.%PeriodMember] {
// CHECK:STDOUT: %U.patt.loc11_18.1: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_18.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.patt.loc11_26.1: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_26.2 (constants.%U.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11_23.1: type = splice_block %.loc11_23.2 [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc11_18: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc11_30.1: type = splice_block %.loc11_30.2 [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc11_26: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.frozen.loc11_23: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.frozen.loc11_30: %I.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self.frozen.loc11_23 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self.frozen.loc11_30 [symbolic_self = constants.%.Self.frozen.3a0]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.loc11_29: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %.loc11_36: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type.e90]
// CHECK:STDOUT: %Member.ref: %I.assoc_type = name_ref Member, @Member.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc11_29.1: type = impl_witness_access constants.%I.lookup_impl_witness.ced, element0 [symbolic_self = constants.%impl.elem0.125]
// CHECK:STDOUT: %.loc11_41: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc11_37.1 = requirement_equivalent %impl.elem0.loc11_29.1, %.loc11_41 [concrete]
// CHECK:STDOUT: %impl.elem0.loc11_29.2: type = impl_witness_access constants.%I.lookup_impl_witness.78b, element0 [symbolic_self = constants.%impl.elem0.e55]
// CHECK:STDOUT: %equiv.loc11_37.2 = requirement_equivalent %impl.elem0.loc11_29.2, %.loc11_41 [concrete]
// CHECK:STDOUT: %.loc11_23.2: type = where_expr [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %impl.elem0.loc11_36.1: type = impl_witness_access constants.%I.lookup_impl_witness.ced, element0 [symbolic_self = constants.%impl.elem0.125]
// CHECK:STDOUT: %.loc11_48: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %equiv.loc11_44.1 = requirement_equivalent %impl.elem0.loc11_36.1, %.loc11_48 [concrete]
// CHECK:STDOUT: %impl.elem0.loc11_36.2: type = impl_witness_access constants.%I.lookup_impl_witness.78b, element0 [symbolic_self = constants.%impl.elem0.e55]
// CHECK:STDOUT: %equiv.loc11_44.2 = requirement_equivalent %impl.elem0.loc11_36.2, %.loc11_48 [concrete]
// CHECK:STDOUT: %.loc11_30.2: type = where_expr [concrete = constants.%I_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %I.ref [concrete]
// CHECK:STDOUT: %equiv.loc11_37.2 = requirement_equivalent %impl.elem0.loc11_29.2, %.loc11_41 [concrete]
// CHECK:STDOUT: %equiv.loc11_44.2 = requirement_equivalent %impl.elem0.loc11_36.2, %.loc11_48 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %U.loc11_18.2: %I_where.type = symbolic_binding U, 0 [symbolic = %U.loc11_18.1 (constants.%U)]
// CHECK:STDOUT: %U.loc11_26.2: %I_where.type = symbolic_binding U, 0 [symbolic = %U.loc11_26.1 (constants.%U)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %TypeSelfImpls.decl: %TypeSelfImpls.type = fn_decl @TypeSelfImpls [concrete = constants.%TypeSelfImpls] {
// CHECK:STDOUT: %V.patt.loc13_19.1: %pattern_type.951 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_19.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.patt.loc13_27.1: %pattern_type.951 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_27.2 (constants.%V.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc13_27.1: type = splice_block %.loc13_27.2 [concrete = constants.%type_where] {
// CHECK:STDOUT: %.Self.frozen.loc13_19: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc13_22: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc13_34.1: type = splice_block %.loc13_34.2 [concrete = constants.%type_where] {
// CHECK:STDOUT: %.Self.frozen.loc13_27: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc13_22 [concrete]
// CHECK:STDOUT: %.Self.ref.loc13_33.1: %type = name_ref .Self, %.Self.frozen.loc13_27 [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc13_29: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.Self.frozen.loc13_34: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc13_29 [concrete]
// CHECK:STDOUT: %.Self.ref.loc13_40.1: %type = name_ref .Self, %.Self.frozen.loc13_34 [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
// CHECK:STDOUT: %.Self.as_type.loc13_33.1: type = facet_access_type %.Self.ref.loc13_33.1 [symbolic_self = constants.%.Self.frozen.as_type.bce]
// CHECK:STDOUT: %.loc13_33.1: type = converted %.Self.ref.loc13_33.1, %.Self.as_type.loc13_33.1 [symbolic_self = constants.%.Self.frozen.as_type.bce]
// CHECK:STDOUT: %impls.loc13_39.1 = requirement_impls %.loc13_33.1, %I.ref [concrete]
// CHECK:STDOUT: %.Self.as_type.loc13_40.1: type = facet_access_type %.Self.ref.loc13_40.1 [symbolic_self = constants.%.Self.frozen.as_type.bce]
// CHECK:STDOUT: %.loc13_40.1: type = converted %.Self.ref.loc13_40.1, %.Self.as_type.loc13_40.1 [symbolic_self = constants.%.Self.frozen.as_type.bce]
// CHECK:STDOUT: %impls.loc13_46.1 = requirement_impls %.loc13_40.1, %I.ref [concrete]
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.e0b]
// CHECK:STDOUT: %.Self.ref.loc13_33.2: %type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.e0b]
// CHECK:STDOUT: %.Self.as_type.loc13_33.2: type = facet_access_type %.Self.ref.loc13_33.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc13_33.2: type = converted %.Self.ref.loc13_33.1, %.Self.as_type.loc13_33.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc13_39.2 = requirement_impls %.loc13_33.2, %I.ref [concrete]
// CHECK:STDOUT: %.loc13_27.2: type = where_expr [concrete = constants.%type_where] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc13_22 [concrete]
// CHECK:STDOUT: %impls.loc13_39.2 = requirement_impls %.loc13_33.2, %I.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc13_40.2: %type = name_ref .Self, %.Self [symbolic_self = constants.%.Self.e0b]
// CHECK:STDOUT: %.Self.as_type.loc13_40.2: type = facet_access_type %.Self.ref.loc13_40.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %.loc13_40.2: type = converted %.Self.ref.loc13_40.1, %.Self.as_type.loc13_40.2 [symbolic_self = constants.%.Self.as_type]
// CHECK:STDOUT: %impls.loc13_46.2 = requirement_impls %.loc13_40.2, %I.ref [concrete]
// CHECK:STDOUT: %.loc13_34.2: type = where_expr [concrete = constants.%type_where] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %.loc13_29 [concrete]
// CHECK:STDOUT: %impls.loc13_46.2 = requirement_impls %.loc13_40.2, %I.ref [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %V.loc13_19.2: %type_where = symbolic_binding V, 0 [symbolic = %V.loc13_19.1 (constants.%V)]
// CHECK:STDOUT: %V.loc13_27.2: %type_where = symbolic_binding V, 0 [symbolic = %V.loc13_27.1 (constants.%V)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @PeriodSelf(%T.loc9_16.2: %I_where.type) {
// CHECK:STDOUT: %T.patt.loc9_16.2: %pattern_type.603 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_16.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc9_16.1: %I_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_16.1 (constants.%T)]
// CHECK:STDOUT: generic fn @PeriodSelf(%T.loc9_24.2: %I_where.type) {
// CHECK:STDOUT: %T.patt.loc9_24.2: %pattern_type.603 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_24.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc9_24.1: %I_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_24.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @PeriodMember(%U.loc11_18.2: %I_where.type) {
// CHECK:STDOUT: %U.patt.loc11_18.2: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_18.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.loc11_18.1: %I_where.type = symbolic_binding U, 0 [symbolic = %U.loc11_18.1 (constants.%U)]
// CHECK:STDOUT: generic fn @PeriodMember(%U.loc11_26.2: %I_where.type) {
// CHECK:STDOUT: %U.patt.loc11_26.2: %pattern_type.603 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc11_26.2 (constants.%U.patt)]
// CHECK:STDOUT: %U.loc11_26.1: %I_where.type = symbolic_binding U, 0 [symbolic = %U.loc11_26.1 (constants.%U)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @TypeSelfImpls(%V.loc13_19.2: %type_where) {
// CHECK:STDOUT: %V.patt.loc13_19.2: %pattern_type.951 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_19.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc13_19.1: %type_where = symbolic_binding V, 0 [symbolic = %V.loc13_19.1 (constants.%V)]
// CHECK:STDOUT: generic fn @TypeSelfImpls(%V.loc13_27.2: %type_where) {
// CHECK:STDOUT: %V.patt.loc13_27.2: %pattern_type.951 = symbolic_binding_pattern V, 0 [symbolic = %V.patt.loc13_27.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc13_27.1: %type_where = symbolic_binding V, 0 [symbolic = %V.loc13_27.1 (constants.%V)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @PeriodSelf(constants.%T) {
// CHECK:STDOUT: %T.patt.loc9_16.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc9_16.1 => constants.%T
// CHECK:STDOUT: %T.patt.loc9_24.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc9_24.1 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @PeriodMember(constants.%U) {
// CHECK:STDOUT: %U.patt.loc11_18.2 => constants.%U.patt
// CHECK:STDOUT: %U.loc11_18.1 => constants.%U
// CHECK:STDOUT: %U.patt.loc11_26.2 => constants.%U.patt
// CHECK:STDOUT: %U.loc11_26.1 => constants.%U
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @TypeSelfImpls(constants.%V) {
// CHECK:STDOUT: %V.patt.loc13_19.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc13_19.1 => constants.%V
// CHECK:STDOUT: %V.patt.loc13_27.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc13_27.1 => constants.%V
// CHECK:STDOUT: }
// CHECK:STDOUT:
+35 -35
View File
@@ -23,7 +23,7 @@ interface J {
fn GSelf(self);
}
fn INotJ[T:! I where .Self impls J](x: T) {
fn INotJ[T: I where .Self impls J](x: T) {
// Can access members of `I` using either kind of member access.
T.FNonInstance();
T.(I.FNonInstance)();
@@ -39,7 +39,7 @@ fn INotJ[T:! I where .Self impls J](x: T) {
x.(J.GSelf)();
}
fn TypeNotJ[T:! type where .Self impls J](x: T) {
fn TypeNotJ[T: type where .Self impls J](x: T) {
T.(J.GNonInstance)();
x.(J.GSelf)();
}
@@ -55,7 +55,7 @@ interface J {
fn F() -> {};
}
fn INotJ(T:! I where .Self impls J) {
fn INotJ(generic T: I where .Self impls J) {
// Gets `T.(I.F)`. Doesn't consider `T.(J.F)`, so no ambiguity.
let unused x: () = T.F();
}
@@ -71,7 +71,7 @@ interface J {
fn G();
}
fn INotJ(T:! I where .Self impls J) {
fn INotJ(generic T: I where .Self impls J) {
// CHECK:STDERR: fail_name_lookup_through_where_self_impls.carbon:[[@LINE+4]]:3: error: member name `G` not found in `I` [MemberNameNotFoundInSpecificScope]
// CHECK:STDERR: T.G();
// CHECK:STDERR: ^~~
@@ -86,7 +86,7 @@ interface J {
fn G();
}
fn TypeNotJ(T:! type where .Self impls J) {
fn TypeNotJ(generic T: type where .Self impls J) {
// CHECK:STDERR: fail_name_lookup_with_type.carbon:[[@LINE+4]]:3: error: member name `G` not found [MemberNameNotFound]
// CHECK:STDERR: T.G();
// CHECK:STDERR: ^~~
@@ -100,7 +100,7 @@ library "[[@TEST_NAME]]";
interface A {}
interface B { fn Bfn(); }
fn F(T:! A & B) {
fn F(generic T: A & B) {
// CHECK:STDERR: fail_facet_type_simple_member_access.carbon:[[@LINE+4]]:6: error: member name `Bfn` not found in `A` [MemberNameNotFoundInSpecificScope]
// CHECK:STDERR: T.((A where .Self impls B).Bfn)();
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -127,7 +127,7 @@ interface J {
fn GSelf(self);
}
fn INotJ[T:! I where .Self impls J](x: T) {
fn INotJ[T: I where .Self impls J](x: T) {
// CHECK:STDERR: fail_name_lookup_instance.carbon:[[@LINE+4]]:3: error: member name `GNonInstance` not found in `I` [MemberNameNotFoundInSpecificScope]
// CHECK:STDERR: x.GNonInstance();
// CHECK:STDERR: ^~~~~~~~~~~~~~
@@ -144,9 +144,9 @@ fn INotJ[T:! I where .Self impls J](x: T) {
// --- compare_equal.carbon
library "[[@TEST_NAME]]";
class WrapType(T:! type) {}
fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(T:! type) -> WrapType(T) { return {}; }
class WrapType(T: type) {}
fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(generic T: type) -> WrapType(T) { return {}; }
interface I;
interface J;
@@ -171,12 +171,12 @@ interface K {}
// --- fail_todo_compare_equal_with_rewrite.carbon
library "[[@TEST_NAME]]";
class WrapType(T:! type) {}
fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(T:! type) -> WrapType(T) { return {}; }
class WrapType(T: type) {}
fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(generic T: type) -> WrapType(T) { return {}; }
interface I { let A:! type; }
interface J { let B:! type; }
interface I { let A: type; }
interface J { let B: type; }
// TODO: The `.Self` implied in `.A` contains all of the extended interfaces,
// which is different between these facet types at the point where `.A` is
@@ -192,8 +192,8 @@ fn Test() {
// CHECK:STDERR: AssertSame(Type((I where .A = ()) & J),
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_compare_equal_with_rewrite.carbon:[[@LINE-19]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
AssertSame(Type((I where .A = ()) & J),
Type(I & J where .A = ()));
@@ -202,8 +202,8 @@ fn Test() {
// CHECK:STDERR: AssertSame(Type(I & (J where .B = {})),
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_compare_equal_with_rewrite.carbon:[[@LINE-29]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
AssertSame(Type(I & (J where .B = {})),
Type(I & J where .B = {}));
@@ -213,8 +213,8 @@ fn Test() {
// CHECK:STDERR: AssertSame(Type((I where .A = ()) & (J where .B = {})),
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_compare_equal_with_rewrite.carbon:[[@LINE-40]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn AssertSame[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn AssertSame[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
AssertSame(Type((I where .A = ()) & (J where .B = {})),
Type(I & J where .A = () and .B = {}));
@@ -223,9 +223,9 @@ fn Test() {
// --- fail_compare_not_equal.carbon
library "[[@TEST_NAME]]";
class WrapType(T:! type) {}
fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(T:! type) -> WrapType(T) { return {}; }
class WrapType(T: type) {}
fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(generic T: type) -> WrapType(T) { return {}; }
interface I {}
interface J {}
@@ -235,8 +235,8 @@ fn Test() {
// CHECK:STDERR: Same(Type(I where .Self impls J), Type(J where .Self impls I));
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_compare_not_equal.carbon:[[@LINE-10]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
// CHECK:STDERR: fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
Same(Type(I where .Self impls J), Type(J where .Self impls I));
}
@@ -244,12 +244,12 @@ fn Test() {
// --- todo_fail_compare_not_equal_with_same_type.carbon
library "[[@TEST_NAME]]";
class WrapType(T:! type) {}
fn Same[T:! type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(T:! type) -> WrapType(T) { return {}; }
class WrapType(T: type) {}
fn Same[T: type](unused a: WrapType(T), unused b: WrapType(T)) {}
fn Type(generic T: type) -> WrapType(T) { return {}; }
interface I { let A:! type; }
interface J { let B:! type; }
interface I { let A: type; }
interface J { let B: type; }
fn Test() {
// The first `.A` has a `.Self` of type `I`. The second contains a `.Self` of
@@ -266,7 +266,7 @@ library "[[@TEST_NAME]]";
class C {}
interface I {}
interface J { let T:! type; }
interface J { let T: type; }
// Interfaces to the right of the `where` don't interfere with the
// "can only impl a facet type with a single interface" rule. Only
@@ -278,8 +278,8 @@ impl {.b: C} as J where .Self impls I and .T = () {}
// --- impl_with_rewrite_of_interface_not_being_implemented.carbon
library "[[@TEST_NAME]]";
interface I { let A:! type; }
interface J { let A:! type; }
interface I { let A: type; }
interface J { let A: type; }
class C {}
@@ -287,7 +287,7 @@ class C {}
impl C as J where .A = {} {}
// Requirement of implementing J with `.A = A`.
constraint NeedJ(A:! type) {
constraint NeedJ(A: type) {
require impls J where .A = A;
}
+82 -82
View File
@@ -10,15 +10,15 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/where_expr/dot_self_index.carbon
interface Empty(W:! type) {
let A:! type;
interface Empty(W: type) {
let A: 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, unused U: Empty(T) where .A = T*, unused V:! type) {}
fn H(generic T: type, unused U: Empty(T) where .A = T*, unused generic V: type) {}
//@dump-sem-ir-end
fn G(U: Empty(i32) where .A = i32*) {
@@ -79,72 +79,72 @@ fn G(U: Empty(i32) where .A = i32*) {
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
// CHECK:STDOUT: %T.patt.loc21_7.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_7.2 (constants.%T.patt)]
// CHECK:STDOUT: %U.param_patt.loc21_24.1: @H.%pattern_type (%pattern_type.a0f) = value_param_pattern [symbolic = %U.param_patt.loc21_24.2 (constants.%U.param_patt.558)]
// CHECK:STDOUT: %U.patt.loc21_24.1: @H.%pattern_type (%pattern_type.a0f) = at_binding_pattern U, %U.param_patt.loc21_24.1 [symbolic = %U.patt.loc21_24.2 (constants.%U.patt.e03)]
// CHECK:STDOUT: %V.patt.loc21_58.1: %pattern_type.98f = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc21_58.2 (constants.%V.patt)]
// CHECK:STDOUT: %T.patt.loc21_15.1: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %U.param_patt.loc21_31.1: @H.%pattern_type (%pattern_type.a0f) = value_param_pattern [symbolic = %U.param_patt.loc21_31.2 (constants.%U.param_patt.558)]
// CHECK:STDOUT: %U.patt.loc21_31.1: @H.%pattern_type (%pattern_type.a0f) = at_binding_pattern U, %U.param_patt.loc21_31.1 [symbolic = %U.patt.loc21_31.2 (constants.%U.patt.e03)]
// CHECK:STDOUT: %V.patt.loc21_73.1: %pattern_type.98f = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc21_73.2 (constants.%V.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc21_10.1: type = splice_block %.loc21_10.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen.loc21_7: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc21_10.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc21_17.1: type = splice_block %.loc21_17.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen.loc21_15: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc21_17.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc21_7.2: type = symbolic_binding T, 0 [symbolic = %T.loc21_7.1 (constants.%T)]
// CHECK:STDOUT: %T.loc21_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc21_15.1 (constants.%T)]
// CHECK:STDOUT: %U.param: @H.%Empty_where.type (%Empty_where.type.696) = value_param call_param0
// CHECK:STDOUT: %.loc21_35.1: type = splice_block %.loc21_35.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.696)] {
// CHECK:STDOUT: %.loc21_42.1: type = splice_block %.loc21_42.2 [symbolic = %Empty_where.type (constants.%Empty_where.type.696)] {
// CHECK:STDOUT: %Empty.ref: %Empty.type.c52 = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.generic]
// CHECK:STDOUT: %T.ref.loc21_32: type = name_ref T, %T.loc21_7.2 [symbolic = %T.loc21_7.1 (constants.%T)]
// CHECK:STDOUT: %Empty.type.loc21_33.2: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc21_33.1 (constants.%Empty.type.95d624.2)]
// CHECK:STDOUT: %.Self.frozen.loc21_35.2: @H.%Empty.type.loc21_33.1 (%Empty.type.95d624.2) = symbolic_binding .Self [symbolic = %.Self.frozen.loc21_35.1 (constants.%.Self.frozen.063)]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %Empty.type.loc21_33.2 [concrete]
// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc21_33.1 (%Empty.type.95d624.2) = name_ref .Self, %.Self.frozen.loc21_35.2 [symbolic = %.Self.frozen.loc21_35.1 (constants.%.Self.frozen.063)]
// CHECK:STDOUT: %T.ref.loc21_39: type = name_ref T, %T.loc21_15.2 [symbolic = %T.loc21_15.1 (constants.%T)]
// CHECK:STDOUT: %Empty.type.loc21_40.2: type = facet_type <@Empty, @Empty(constants.%T)> [symbolic = %Empty.type.loc21_40.1 (constants.%Empty.type.95d624.2)]
// CHECK:STDOUT: %.Self.frozen.loc21_42.2: @H.%Empty.type.loc21_40.1 (%Empty.type.95d624.2) = symbolic_binding .Self [symbolic = %.Self.frozen.loc21_42.1 (constants.%.Self.frozen.063)]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %Empty.type.loc21_40.2 [concrete]
// CHECK:STDOUT: %.Self.ref: @H.%Empty.type.loc21_40.1 (%Empty.type.95d624.2) = name_ref .Self, %.Self.frozen.loc21_42.2 [symbolic = %.Self.frozen.loc21_42.1 (constants.%.Self.frozen.063)]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic = %.Self.frozen.as_type (constants.%.Self.frozen.as_type.f3f)]
// CHECK:STDOUT: %.loc21_41.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.frozen.as_type (constants.%.Self.frozen.as_type.f3f)]
// CHECK:STDOUT: %.loc21_41.2: @H.%Empty.assoc_type (%Empty.assoc_type.c44b55.2) = specific_constant @A.%assoc0, @Empty.WithSelf(constants.%T, constants.%.Self.frozen.063) [symbolic = %assoc0 (constants.%assoc0.3a7cb1.2)]
// CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.c44b55.2) = name_ref A, %.loc21_41.2 [symbolic = %assoc0 (constants.%assoc0.3a7cb1.2)]
// CHECK:STDOUT: %impl.elem0.loc21_41.3: type = impl_witness_access constants.%Empty.lookup_impl_witness.88a, element0 [symbolic = %impl.elem0.loc21_41.1 (constants.%impl.elem0.c2e)]
// CHECK:STDOUT: %T.ref.loc21_46: type = name_ref T, %T.loc21_7.2 [symbolic = %T.loc21_7.1 (constants.%T)]
// CHECK:STDOUT: %ptr.loc21_47.2: type = ptr_type %T.ref.loc21_46 [symbolic = %ptr.loc21_47.1 (constants.%ptr.e8f)]
// CHECK:STDOUT: %rewrite.loc21_44.1 = requirement_rewrite %impl.elem0.loc21_41.3, %ptr.loc21_47.2 [concrete]
// CHECK:STDOUT: %impl.elem0.loc21_41.4: type = impl_witness_access constants.%Empty.lookup_impl_witness.67b, element0 [symbolic = %impl.elem0.loc21_41.2 (constants.%impl.elem0.d8a)]
// CHECK:STDOUT: %rewrite.loc21_44.2 = requirement_rewrite %impl.elem0.loc21_41.4, %ptr.loc21_47.2 [concrete]
// CHECK:STDOUT: %.loc21_35.2: type = where_expr [symbolic = %Empty_where.type (constants.%Empty_where.type.696)] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %Empty.type.loc21_33.2 [concrete]
// CHECK:STDOUT: %rewrite.loc21_44.2 = requirement_rewrite %impl.elem0.loc21_41.4, %ptr.loc21_47.2 [concrete]
// CHECK:STDOUT: %.loc21_48.1: type = converted %.Self.ref, %.Self.as_type [symbolic = %.Self.frozen.as_type (constants.%.Self.frozen.as_type.f3f)]
// CHECK:STDOUT: %.loc21_48.2: @H.%Empty.assoc_type (%Empty.assoc_type.c44b55.2) = specific_constant @A.%assoc0, @Empty.WithSelf(constants.%T, constants.%.Self.frozen.063) [symbolic = %assoc0 (constants.%assoc0.3a7cb1.2)]
// CHECK:STDOUT: %A.ref: @H.%Empty.assoc_type (%Empty.assoc_type.c44b55.2) = name_ref A, %.loc21_48.2 [symbolic = %assoc0 (constants.%assoc0.3a7cb1.2)]
// CHECK:STDOUT: %impl.elem0.loc21_48.3: type = impl_witness_access constants.%Empty.lookup_impl_witness.88a, element0 [symbolic = %impl.elem0.loc21_48.1 (constants.%impl.elem0.c2e)]
// CHECK:STDOUT: %T.ref.loc21_53: type = name_ref T, %T.loc21_15.2 [symbolic = %T.loc21_15.1 (constants.%T)]
// CHECK:STDOUT: %ptr.loc21_54.2: type = ptr_type %T.ref.loc21_53 [symbolic = %ptr.loc21_54.1 (constants.%ptr.e8f)]
// CHECK:STDOUT: %rewrite.loc21_51.1 = requirement_rewrite %impl.elem0.loc21_48.3, %ptr.loc21_54.2 [concrete]
// CHECK:STDOUT: %impl.elem0.loc21_48.4: type = impl_witness_access constants.%Empty.lookup_impl_witness.67b, element0 [symbolic = %impl.elem0.loc21_48.2 (constants.%impl.elem0.d8a)]
// CHECK:STDOUT: %rewrite.loc21_51.2 = requirement_rewrite %impl.elem0.loc21_48.4, %ptr.loc21_54.2 [concrete]
// CHECK:STDOUT: %.loc21_42.2: type = where_expr [symbolic = %Empty_where.type (constants.%Empty_where.type.696)] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %Empty.type.loc21_40.2 [concrete]
// CHECK:STDOUT: %rewrite.loc21_51.2 = requirement_rewrite %impl.elem0.loc21_48.4, %ptr.loc21_54.2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %U: @H.%Empty_where.type (%Empty_where.type.696) = wrapper_binding U, %U.param
// CHECK:STDOUT: %.loc21_61.1: type = splice_block %.loc21_61.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen.loc21_58: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc21_61.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: %.loc21_75.1: type = splice_block %.loc21_75.2 [concrete = type] {
// CHECK:STDOUT: %.Self.frozen.loc21_73: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc21_75.2: type = type_literal type [concrete = type]
// CHECK:STDOUT: }
// CHECK:STDOUT: %V.loc21_58.2: type = symbolic_binding V, 1 [symbolic = %V.loc21_58.1 (constants.%V)]
// CHECK:STDOUT: %V.loc21_73.2: type = symbolic_binding V, 1 [symbolic = %V.loc21_73.1 (constants.%V)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @H(%T.loc21_7.2: type, %V.loc21_58.2: type) {
// CHECK:STDOUT: %T.patt.loc21_7.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_7.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc21_7.1: type = symbolic_binding T, 0 [symbolic = %T.loc21_7.1 (constants.%T)]
// CHECK:STDOUT: %Empty.type.loc21_33.1: type = facet_type <@Empty, @Empty(%T.loc21_7.1)> [symbolic = %Empty.type.loc21_33.1 (constants.%Empty.type.95d624.2)]
// CHECK:STDOUT: %.Self.frozen.loc21_35.1: @H.%Empty.type.loc21_33.1 (%Empty.type.95d624.2) = symbolic_binding .Self [symbolic = %.Self.frozen.loc21_35.1 (constants.%.Self.frozen.063)]
// CHECK:STDOUT: %require_complete.loc21_41: <witness> = require_complete_type %Empty.type.loc21_33.1 [symbolic = %require_complete.loc21_41 (constants.%require_complete.a43)]
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.loc21_35.1 [symbolic = %.Self.frozen.as_type (constants.%.Self.frozen.as_type.f3f)]
// CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty, @Empty(%T.loc21_7.1) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.c44b55.2)]
// CHECK:STDOUT: generic fn @H(%T.loc21_15.2: type, %V.loc21_73.2: type) {
// CHECK:STDOUT: %T.patt.loc21_15.2: %pattern_type.98f = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc21_15.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc21_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc21_15.1 (constants.%T)]
// CHECK:STDOUT: %Empty.type.loc21_40.1: type = facet_type <@Empty, @Empty(%T.loc21_15.1)> [symbolic = %Empty.type.loc21_40.1 (constants.%Empty.type.95d624.2)]
// CHECK:STDOUT: %.Self.frozen.loc21_42.1: @H.%Empty.type.loc21_40.1 (%Empty.type.95d624.2) = symbolic_binding .Self [symbolic = %.Self.frozen.loc21_42.1 (constants.%.Self.frozen.063)]
// CHECK:STDOUT: %require_complete.loc21_48: <witness> = require_complete_type %Empty.type.loc21_40.1 [symbolic = %require_complete.loc21_48 (constants.%require_complete.a43)]
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.loc21_42.1 [symbolic = %.Self.frozen.as_type (constants.%.Self.frozen.as_type.f3f)]
// CHECK:STDOUT: %Empty.assoc_type: type = assoc_entity_type @Empty, @Empty(%T.loc21_15.1) [symbolic = %Empty.assoc_type (constants.%Empty.assoc_type.c44b55.2)]
// CHECK:STDOUT: %assoc0: @H.%Empty.assoc_type (%Empty.assoc_type.c44b55.2) = assoc_entity element0, @Empty.WithSelf.%A [symbolic = %assoc0 (constants.%assoc0.3a7cb1.2)]
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_41.1: <witness> = lookup_impl_witness %.Self.frozen.loc21_35.1, @Empty, @Empty(%T.loc21_7.1) [symbolic = %Empty.lookup_impl_witness.loc21_41.1 (constants.%Empty.lookup_impl_witness.88a)]
// CHECK:STDOUT: %impl.elem0.loc21_41.1: type = impl_witness_access %Empty.lookup_impl_witness.loc21_41.1, element0 [symbolic = %impl.elem0.loc21_41.1 (constants.%impl.elem0.c2e)]
// CHECK:STDOUT: %ptr.loc21_47.1: type = ptr_type %T.loc21_7.1 [symbolic = %ptr.loc21_47.1 (constants.%ptr.e8f)]
// CHECK:STDOUT: %.Self: @H.%Empty.type.loc21_33.1 (%Empty.type.95d624.2) = symbolic_binding .Self [symbolic = %.Self (constants.%.Self.913)]
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_41.2: <witness> = lookup_impl_witness %.Self, @Empty, @Empty(%T.loc21_7.1) [symbolic = %Empty.lookup_impl_witness.loc21_41.2 (constants.%Empty.lookup_impl_witness.67b)]
// CHECK:STDOUT: %impl.elem0.loc21_41.2: type = impl_witness_access %Empty.lookup_impl_witness.loc21_41.2, element0 [symbolic = %impl.elem0.loc21_41.2 (constants.%impl.elem0.d8a)]
// CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc21_7.1) where %impl.elem0.loc21_41.2 = %ptr.loc21_47.1> [symbolic = %Empty_where.type (constants.%Empty_where.type.696)]
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_48.1: <witness> = lookup_impl_witness %.Self.frozen.loc21_42.1, @Empty, @Empty(%T.loc21_15.1) [symbolic = %Empty.lookup_impl_witness.loc21_48.1 (constants.%Empty.lookup_impl_witness.88a)]
// CHECK:STDOUT: %impl.elem0.loc21_48.1: type = impl_witness_access %Empty.lookup_impl_witness.loc21_48.1, element0 [symbolic = %impl.elem0.loc21_48.1 (constants.%impl.elem0.c2e)]
// CHECK:STDOUT: %ptr.loc21_54.1: type = ptr_type %T.loc21_15.1 [symbolic = %ptr.loc21_54.1 (constants.%ptr.e8f)]
// CHECK:STDOUT: %.Self: @H.%Empty.type.loc21_40.1 (%Empty.type.95d624.2) = symbolic_binding .Self [symbolic = %.Self (constants.%.Self.913)]
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_48.2: <witness> = lookup_impl_witness %.Self, @Empty, @Empty(%T.loc21_15.1) [symbolic = %Empty.lookup_impl_witness.loc21_48.2 (constants.%Empty.lookup_impl_witness.67b)]
// CHECK:STDOUT: %impl.elem0.loc21_48.2: type = impl_witness_access %Empty.lookup_impl_witness.loc21_48.2, element0 [symbolic = %impl.elem0.loc21_48.2 (constants.%impl.elem0.d8a)]
// CHECK:STDOUT: %Empty_where.type: type = facet_type <@Empty, @Empty(%T.loc21_15.1) where %impl.elem0.loc21_48.2 = %ptr.loc21_54.1> [symbolic = %Empty_where.type (constants.%Empty_where.type.696)]
// CHECK:STDOUT: %pattern_type: type = pattern_type %Empty_where.type [symbolic = %pattern_type (constants.%pattern_type.a0f)]
// CHECK:STDOUT: %U.param_patt.loc21_24.2: @H.%pattern_type (%pattern_type.a0f) = value_param_pattern [symbolic = %U.param_patt.loc21_24.2 (constants.%U.param_patt.558)]
// CHECK:STDOUT: %U.patt.loc21_24.2: @H.%pattern_type (%pattern_type.a0f) = at_binding_pattern U, %U.param_patt.loc21_24.2 [symbolic = %U.patt.loc21_24.2 (constants.%U.patt.e03)]
// CHECK:STDOUT: %V.patt.loc21_58.2: %pattern_type.98f = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc21_58.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc21_58.1: type = symbolic_binding V, 1 [symbolic = %V.loc21_58.1 (constants.%V)]
// CHECK:STDOUT: %U.param_patt.loc21_31.2: @H.%pattern_type (%pattern_type.a0f) = value_param_pattern [symbolic = %U.param_patt.loc21_31.2 (constants.%U.param_patt.558)]
// CHECK:STDOUT: %U.patt.loc21_31.2: @H.%pattern_type (%pattern_type.a0f) = at_binding_pattern U, %U.param_patt.loc21_31.2 [symbolic = %U.patt.loc21_31.2 (constants.%U.patt.e03)]
// CHECK:STDOUT: %V.patt.loc21_73.2: %pattern_type.98f = symbolic_binding_pattern V, 1 [symbolic = %V.patt.loc21_73.2 (constants.%V.patt)]
// CHECK:STDOUT: %V.loc21_73.1: type = symbolic_binding V, 1 [symbolic = %V.loc21_73.1 (constants.%V)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc21_24: <witness> = require_complete_type %Empty_where.type [symbolic = %require_complete.loc21_24 (constants.%require_complete.e98)]
// CHECK:STDOUT: %require_complete.loc21_31: <witness> = require_complete_type %Empty_where.type [symbolic = %require_complete.loc21_31 (constants.%require_complete.e98)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn(%U.param: @H.%Empty_where.type (%Empty_where.type.696)) {
// CHECK:STDOUT: !entry:
@@ -155,51 +155,51 @@ fn G(U: Empty(i32) where .A = i32*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @H(constants.%T, constants.%V) {
// CHECK:STDOUT: %T.patt.loc21_7.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc21_7.1 => constants.%T
// CHECK:STDOUT: %Empty.type.loc21_33.1 => constants.%Empty.type.95d624.2
// CHECK:STDOUT: %.Self.frozen.loc21_35.1 => constants.%.Self.frozen.063
// CHECK:STDOUT: %require_complete.loc21_41 => constants.%require_complete.a43
// CHECK:STDOUT: %T.patt.loc21_15.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc21_15.1 => constants.%T
// CHECK:STDOUT: %Empty.type.loc21_40.1 => constants.%Empty.type.95d624.2
// CHECK:STDOUT: %.Self.frozen.loc21_42.1 => constants.%.Self.frozen.063
// CHECK:STDOUT: %require_complete.loc21_48 => constants.%require_complete.a43
// CHECK:STDOUT: %.Self.frozen.as_type => constants.%.Self.frozen.as_type.f3f
// CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.c44b55.2
// CHECK:STDOUT: %assoc0 => constants.%assoc0.3a7cb1.2
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_41.1 => constants.%Empty.lookup_impl_witness.88a
// CHECK:STDOUT: %impl.elem0.loc21_41.1 => constants.%impl.elem0.c2e
// CHECK:STDOUT: %ptr.loc21_47.1 => constants.%ptr.e8f
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_48.1 => constants.%Empty.lookup_impl_witness.88a
// CHECK:STDOUT: %impl.elem0.loc21_48.1 => constants.%impl.elem0.c2e
// CHECK:STDOUT: %ptr.loc21_54.1 => constants.%ptr.e8f
// CHECK:STDOUT: %.Self => constants.%.Self.913
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_41.2 => constants.%Empty.lookup_impl_witness.67b
// CHECK:STDOUT: %impl.elem0.loc21_41.2 => constants.%impl.elem0.d8a
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_48.2 => constants.%Empty.lookup_impl_witness.67b
// CHECK:STDOUT: %impl.elem0.loc21_48.2 => constants.%impl.elem0.d8a
// CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.696
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.a0f
// CHECK:STDOUT: %U.param_patt.loc21_24.2 => constants.%U.param_patt.558
// CHECK:STDOUT: %U.patt.loc21_24.2 => constants.%U.patt.e03
// CHECK:STDOUT: %V.patt.loc21_58.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc21_58.1 => constants.%V
// CHECK:STDOUT: %U.param_patt.loc21_31.2 => constants.%U.param_patt.558
// CHECK:STDOUT: %U.patt.loc21_31.2 => constants.%U.patt.e03
// CHECK:STDOUT: %V.patt.loc21_73.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc21_73.1 => constants.%V
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @H(constants.%i32, bool) {
// CHECK:STDOUT: %T.patt.loc21_7.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc21_7.1 => constants.%i32
// CHECK:STDOUT: %Empty.type.loc21_33.1 => constants.%Empty.type.39c
// CHECK:STDOUT: %.Self.frozen.loc21_35.1 => constants.%.Self.frozen.869
// CHECK:STDOUT: %require_complete.loc21_41 => constants.%complete_type.c56
// CHECK:STDOUT: %T.patt.loc21_15.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc21_15.1 => constants.%i32
// CHECK:STDOUT: %Empty.type.loc21_40.1 => constants.%Empty.type.39c
// CHECK:STDOUT: %.Self.frozen.loc21_42.1 => constants.%.Self.frozen.869
// CHECK:STDOUT: %require_complete.loc21_48 => constants.%complete_type.c56
// CHECK:STDOUT: %.Self.frozen.as_type => constants.%.Self.frozen.as_type.941
// CHECK:STDOUT: %Empty.assoc_type => constants.%Empty.assoc_type.22b
// CHECK:STDOUT: %assoc0 => constants.%assoc0.023
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_41.1 => constants.%Empty.lookup_impl_witness.635
// CHECK:STDOUT: %impl.elem0.loc21_41.1 => constants.%impl.elem0.31d
// CHECK:STDOUT: %ptr.loc21_47.1 => constants.%ptr.d08
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_48.1 => constants.%Empty.lookup_impl_witness.635
// CHECK:STDOUT: %impl.elem0.loc21_48.1 => constants.%impl.elem0.31d
// CHECK:STDOUT: %ptr.loc21_54.1 => constants.%ptr.d08
// CHECK:STDOUT: %.Self => constants.%.Self.98b
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_41.2 => constants.%Empty.lookup_impl_witness.4f6
// CHECK:STDOUT: %impl.elem0.loc21_41.2 => constants.%impl.elem0.f25
// CHECK:STDOUT: %Empty.lookup_impl_witness.loc21_48.2 => constants.%Empty.lookup_impl_witness.4f6
// CHECK:STDOUT: %impl.elem0.loc21_48.2 => constants.%impl.elem0.f25
// CHECK:STDOUT: %Empty_where.type => constants.%Empty_where.type.944
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.12c
// CHECK:STDOUT: %U.param_patt.loc21_24.2 => constants.%U.param_patt.a6a
// CHECK:STDOUT: %U.patt.loc21_24.2 => constants.%U.patt.616e51.2
// CHECK:STDOUT: %V.patt.loc21_58.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc21_58.1 => bool
// CHECK:STDOUT: %U.param_patt.loc21_31.2 => constants.%U.param_patt.a6a
// CHECK:STDOUT: %U.patt.loc21_31.2 => constants.%U.patt.616e51.2
// CHECK:STDOUT: %V.patt.loc21_73.2 => constants.%V.patt
// CHECK:STDOUT: %V.loc21_73.1 => bool
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %require_complete.loc21_24 => constants.%complete_type.c21
// CHECK:STDOUT: %require_complete.loc21_31 => constants.%complete_type.c21
// CHECK:STDOUT: }
// CHECK:STDOUT:
+225 -225
View File
@@ -15,11 +15,11 @@
library "[[@TEST_NAME]]";
interface N {
let P:! type;
let P: type;
}
//@dump-sem-ir-begin
fn Equal(T:! N where .P = {});
fn Equal(generic T: N where .P = {});
//@dump-sem-ir-end
// --- nested_rewrites.carbon
@@ -27,12 +27,12 @@ fn Equal(T:! N where .P = {});
library "[[@TEST_NAME]]";
interface A {
let B:! type;
let C:! type;
let B: type;
let C: type;
}
//@dump-sem-ir-begin
fn NestedRewrite(D:! (A where .B = bool) where .C = ());
fn NestedRewrite(generic D: (A where .B = bool) where .C = ());
//@dump-sem-ir-end
// --- repeated_rewrite.carbon
@@ -40,18 +40,18 @@ fn NestedRewrite(D:! (A where .B = bool) where .C = ());
library "[[@TEST_NAME]]";
interface E {
let F:! type;
let F: type;
}
//@dump-sem-ir-begin
fn OneRewrite(unused G:! E where .F = i32) {}
fn OneRewrite(unused generic G: E where .F = i32) {}
fn RepeatedRewrite(H:! E where .F = i32 and .F = i32) {
fn RepeatedRewrite(generic H: E where .F = i32 and .F = i32) {
//@dump-sem-ir-end
OneRewrite(H);
}
fn OneRewriteAgain(I:! E where .F = i32) {
fn OneRewriteAgain(generic I: E where .F = i32) {
RepeatedRewrite(I);
}
@@ -60,14 +60,14 @@ fn OneRewriteAgain(I:! E where .F = i32) {
library "[[@TEST_NAME]]";
interface J {
let K:! type;
let L:! type;
let K: type;
let L: type;
}
//@dump-sem-ir-begin
fn Alphabetical(unused M:! J where .K = () and .L = bool) {}
fn Alphabetical(unused generic M: J where .K = () and .L = bool) {}
fn Reversed(N:! J where .L = bool and .K = ()) {
fn Reversed(generic N: J where .L = bool and .K = ()) {
//@dump-sem-ir-end
Alphabetical(N);
}
@@ -77,18 +77,18 @@ fn Reversed(N:! J where .L = bool and .K = ()) {
library "[[@TEST_NAME]]";
interface O {
let P:! type;
let P: type;
}
fn WithInteger(unused Q:! O where .P = i32) {}
fn WithInteger(unused generic Q: O where .P = i32) {}
fn WithBool(R:! O where .P = bool) {
fn WithBool(generic R: O where .P = bool) {
// CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE+7]]:3: error: cannot convert type `R` that implements `O where .(O.P) = bool` into type implementing `O where .(O.P) = i32` [ConversionFailureFacetToFacet]
// CHECK:STDERR: WithInteger(R);
// CHECK:STDERR: ^~~~~~~~~~~~~~
// CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE-6]]:23: note: initializing generic parameter `Q` declared here [InitializingGenericParam]
// CHECK:STDERR: fn WithInteger(unused Q:! O where .P = i32) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_rewrites_mismatch_right.carbon:[[@LINE-6]]:31: note: initializing generic parameter `Q` declared here [InitializingGenericParam]
// CHECK:STDERR: fn WithInteger(unused generic Q: O where .P = i32) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
WithInteger(R);
}
@@ -98,19 +98,19 @@ fn WithBool(R:! O where .P = bool) {
library "[[@TEST_NAME]]";
interface S {
let T:! type;
let U:! type;
let T: type;
let U: type;
}
fn WithT(unused V:! S where .T = ()) {}
fn WithT(unused generic V: S where .T = ()) {}
fn WithU(W:! S where .U = ()) {
fn WithU(generic W: S where .U = ()) {
// CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE+7]]:3: error: cannot convert type `W` that implements `S where .(S.U) = ()` into type implementing `S where .(S.T) = ()` [ConversionFailureFacetToFacet]
// CHECK:STDERR: WithT(W);
// CHECK:STDERR: ^~~~~~~~
// CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE-6]]:17: note: initializing generic parameter `V` declared here [InitializingGenericParam]
// CHECK:STDERR: fn WithT(unused V:! S where .T = ()) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_rewrites_mismatch_left.carbon:[[@LINE-6]]:25: note: initializing generic parameter `V` declared here [InitializingGenericParam]
// CHECK:STDERR: fn WithT(unused generic V: S where .T = ()) {}
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
WithT(W);
}
@@ -127,9 +127,9 @@ fn Calls() {
// CHECK:STDERR: Equal(bool);
// CHECK:STDERR: ^~~~~~~~~~~
// CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-7]]:1: in import [InImport]
// CHECK:STDERR: equal_constraint.carbon:9:10: note: initializing generic parameter `T` declared here [InitializingGenericParam]
// CHECK:STDERR: fn Equal(T:! N where .P = {});
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: equal_constraint.carbon:9:18: note: initializing generic parameter `T` declared here [InitializingGenericParam]
// CHECK:STDERR: fn Equal(generic T: N where .P = {});
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
Equal(bool);
@@ -137,9 +137,9 @@ fn Calls() {
// CHECK:STDERR: NestedRewrite(i32);
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE-17]]:1: in import [InImport]
// CHECK:STDERR: nested_rewrites.carbon:10:18: note: initializing generic parameter `D` declared here [InitializingGenericParam]
// CHECK:STDERR: fn NestedRewrite(D:! (A where .B = bool) where .C = ());
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: nested_rewrites.carbon:10:26: note: initializing generic parameter `D` declared here [InitializingGenericParam]
// CHECK:STDERR: fn NestedRewrite(generic D: (A where .B = bool) where .C = ());
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
NestedRewrite(i32);
}
@@ -149,18 +149,18 @@ fn Calls() {
library "[[@TEST_NAME]]";
interface I {
let Member:! type;
let Member: type;
}
// `2` can't be converted to the type of `I.Member`
// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:46: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
// CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:46: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fn RewriteTypeMismatch(X:! I where .Member = 2);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+7]]:53: error: cannot implicitly convert non-type value of type `Core.IntLiteral` to `type` [ConversionFailureNonTypeToFacet]
// CHECK:STDERR: fn RewriteTypeMismatch(generic X: I where .Member = 2);
// CHECK:STDERR: ^
// CHECK:STDERR: fail_check_rewrite_constraints.carbon:[[@LINE+4]]:53: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(type)` [MissingImplInMemberAccessInContext]
// CHECK:STDERR: fn RewriteTypeMismatch(generic X: I where .Member = 2);
// CHECK:STDERR: ^
// CHECK:STDERR:
fn RewriteTypeMismatch(X:! I where .Member = 2);
fn RewriteTypeMismatch(generic X: I where .Member = 2);
// --- fail_todo_let.carbon
@@ -171,11 +171,11 @@ class D {}
impl D as A {}
fn F() {
// CHECK:STDERR: fail_todo_let.carbon:[[@LINE+4]]:7: error: semantics TODO: `local `let :!` bindings are currently unsupported` [SemanticsTodo]
// CHECK:STDERR: let E:! type where .Self impls A = D;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_let.carbon:[[@LINE+4]]:15: error: semantics TODO: `local generic `let` bindings are currently unsupported` [SemanticsTodo]
// CHECK:STDERR: let generic E: type where .Self impls A = D;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
let E:! type where .Self impls A = D;
let generic E: type where .Self impls A = D;
}
// --- fail_todo_let_compile_time.carbon
@@ -186,19 +186,19 @@ interface A {}
class D {}
impl D as A {}
// TODO: Compile-time binding are not yet supported at file scope.
// CHECK:STDERR: fail_todo_let_compile_time.carbon:[[@LINE+4]]:5: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
// CHECK:STDERR: let B:! type where .Self impls A = D;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR: fail_todo_let_compile_time.carbon:[[@LINE+4]]:13: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
// CHECK:STDERR: let generic B: type where .Self impls A = D;
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
// CHECK:STDERR:
let B:! type where .Self impls A = D;
let generic B: type where .Self impls A = D;
// --- fail_type_does_not_implement_where.carbon
library "[[@TEST_NAME]]";
interface E {
let F:! type;
let G:! type;
let F: type;
let G: type;
}
// Testing how these types get stringified in error messages.
@@ -248,42 +248,42 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %Equal.decl: %Equal.type = fn_decl @Equal [concrete = constants.%Equal] {
// CHECK:STDOUT: %T.patt.loc9_11.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_11.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.patt.loc9_19.1: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_19.2 (constants.%T.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc9_16.1: type = splice_block %.loc9_16.2 [concrete = constants.%N_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc9_11: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc9_23.1: type = splice_block %.loc9_23.2 [concrete = constants.%N_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc9_19: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [concrete = constants.%N.type]
// CHECK:STDOUT: %.Self.frozen.loc9_16: %N.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.098]
// CHECK:STDOUT: %.Self.frozen.loc9_23: %N.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.098]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %N.ref [concrete]
// CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self.frozen.loc9_16 [symbolic_self = constants.%.Self.frozen.098]
// CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self.frozen.loc9_23 [symbolic_self = constants.%.Self.frozen.098]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc9_22: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc9_29: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %P.ref: %N.assoc_type = name_ref P, @P.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc9_22.1: type = impl_witness_access constants.%N.lookup_impl_witness.e97, element0 [symbolic_self = constants.%impl.elem0.892]
// CHECK:STDOUT: %.loc9_28.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %rewrite.loc9_25.1 = requirement_rewrite %impl.elem0.loc9_22.1, %.loc9_28.2 [concrete]
// CHECK:STDOUT: %impl.elem0.loc9_22.2: type = impl_witness_access constants.%N.lookup_impl_witness.98e, element0 [symbolic_self = constants.%impl.elem0.48c]
// CHECK:STDOUT: %rewrite.loc9_25.2 = requirement_rewrite %impl.elem0.loc9_22.2, %.loc9_28.2 [concrete]
// CHECK:STDOUT: %.loc9_16.2: type = where_expr [concrete = constants.%N_where.type] {
// CHECK:STDOUT: %impl.elem0.loc9_29.1: type = impl_witness_access constants.%N.lookup_impl_witness.e97, element0 [symbolic_self = constants.%impl.elem0.892]
// CHECK:STDOUT: %.loc9_35.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc9_35.2: type = converted %.loc9_35.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %rewrite.loc9_32.1 = requirement_rewrite %impl.elem0.loc9_29.1, %.loc9_35.2 [concrete]
// CHECK:STDOUT: %impl.elem0.loc9_29.2: type = impl_witness_access constants.%N.lookup_impl_witness.98e, element0 [symbolic_self = constants.%impl.elem0.48c]
// CHECK:STDOUT: %rewrite.loc9_32.2 = requirement_rewrite %impl.elem0.loc9_29.2, %.loc9_35.2 [concrete]
// CHECK:STDOUT: %.loc9_23.2: type = where_expr [concrete = constants.%N_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %N.ref [concrete]
// CHECK:STDOUT: %rewrite.loc9_25.2 = requirement_rewrite %impl.elem0.loc9_22.2, %.loc9_28.2 [concrete]
// CHECK:STDOUT: %rewrite.loc9_32.2 = requirement_rewrite %impl.elem0.loc9_29.2, %.loc9_35.2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %T.loc9_11.2: %N_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_11.1 (constants.%T)]
// CHECK:STDOUT: %T.loc9_19.2: %N_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_19.1 (constants.%T)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Equal(%T.loc9_11.2: %N_where.type) {
// CHECK:STDOUT: %T.patt.loc9_11.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_11.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc9_11.1: %N_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_11.1 (constants.%T)]
// CHECK:STDOUT: generic fn @Equal(%T.loc9_19.2: %N_where.type) {
// CHECK:STDOUT: %T.patt.loc9_19.2: %pattern_type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_19.2 (constants.%T.patt)]
// CHECK:STDOUT: %T.loc9_19.1: %N_where.type = symbolic_binding T, 0 [symbolic = %T.loc9_19.1 (constants.%T)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Equal(constants.%T) {
// CHECK:STDOUT: %T.patt.loc9_11.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc9_11.1 => constants.%T
// CHECK:STDOUT: %T.patt.loc9_19.2 => constants.%T.patt
// CHECK:STDOUT: %T.loc9_19.1 => constants.%T
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- nested_rewrites.carbon
@@ -317,57 +317,57 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %NestedRewrite.decl: %NestedRewrite.type = fn_decl @NestedRewrite [concrete = constants.%NestedRewrite] {
// CHECK:STDOUT: %D.patt.loc10_19.1: %pattern_type = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc10_19.2 (constants.%D.patt)]
// CHECK:STDOUT: %D.patt.loc10_27.1: %pattern_type = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc10_27.2 (constants.%D.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc10_42.1: type = splice_block %.loc10_42.2 [concrete = constants.%A_where.type.0ba] {
// CHECK:STDOUT: %.Self.frozen.loc10_19: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc10_49.1: type = splice_block %.loc10_49.2 [concrete = constants.%A_where.type.0ba] {
// CHECK:STDOUT: %.Self.frozen.loc10_27: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.type]
// CHECK:STDOUT: %.Self.frozen.loc10_25: %A.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %base_facet_type.loc10_25 = requirement_base_facet_type %A.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_31: %A.type = name_ref .Self, %.Self.frozen.loc10_25 [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %.Self.as_type.loc10_31: type = facet_access_type %.Self.ref.loc10_31 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_31: type = converted %.Self.ref.loc10_31, %.Self.as_type.loc10_31 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.Self.frozen.loc10_32: %A.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %base_facet_type.loc10_32 = requirement_base_facet_type %A.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_38: %A.type = name_ref .Self, %.Self.frozen.loc10_32 [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %.Self.as_type.loc10_38: type = facet_access_type %.Self.ref.loc10_38 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_38: type = converted %.Self.ref.loc10_38, %.Self.as_type.loc10_38 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %B.ref: %A.assoc_type = name_ref B, @B.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc10_31.1: type = impl_witness_access constants.%A.lookup_impl_witness.5db, element0 [symbolic_self = constants.%impl.elem0.6ea]
// CHECK:STDOUT: %.loc10_36: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %rewrite.loc10_34.1 = requirement_rewrite %impl.elem0.loc10_31.1, %.loc10_36 [concrete]
// CHECK:STDOUT: %impl.elem0.loc10_31.2: type = impl_witness_access constants.%A.lookup_impl_witness.937, element0 [symbolic_self = constants.%impl.elem0.0e0]
// CHECK:STDOUT: %rewrite.loc10_34.2 = requirement_rewrite %impl.elem0.loc10_31.2, %.loc10_36 [concrete]
// CHECK:STDOUT: %.loc10_25: type = where_expr [concrete = constants.%A_where.type.beb] {
// CHECK:STDOUT: %base_facet_type.loc10_25 = requirement_base_facet_type %A.ref [concrete]
// CHECK:STDOUT: %rewrite.loc10_34.2 = requirement_rewrite %impl.elem0.loc10_31.2, %.loc10_36 [concrete]
// CHECK:STDOUT: %impl.elem0.loc10_38.1: type = impl_witness_access constants.%A.lookup_impl_witness.5db, element0 [symbolic_self = constants.%impl.elem0.6ea]
// CHECK:STDOUT: %.loc10_43: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %rewrite.loc10_41.1 = requirement_rewrite %impl.elem0.loc10_38.1, %.loc10_43 [concrete]
// CHECK:STDOUT: %impl.elem0.loc10_38.2: type = impl_witness_access constants.%A.lookup_impl_witness.937, element0 [symbolic_self = constants.%impl.elem0.0e0]
// CHECK:STDOUT: %rewrite.loc10_41.2 = requirement_rewrite %impl.elem0.loc10_38.2, %.loc10_43 [concrete]
// CHECK:STDOUT: %.loc10_32: type = where_expr [concrete = constants.%A_where.type.beb] {
// CHECK:STDOUT: %base_facet_type.loc10_32 = requirement_base_facet_type %A.ref [concrete]
// CHECK:STDOUT: %rewrite.loc10_41.2 = requirement_rewrite %impl.elem0.loc10_38.2, %.loc10_43 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %.Self.frozen.loc10_42: %A.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %base_facet_type.loc10_42 = requirement_base_facet_type %.loc10_25 [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_48: %A.type = name_ref .Self, %.Self.frozen.loc10_42 [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %.Self.as_type.loc10_48: type = facet_access_type %.Self.ref.loc10_48 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_48: type = converted %.Self.ref.loc10_48, %.Self.as_type.loc10_48 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.Self.frozen.loc10_49: %A.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %base_facet_type.loc10_49 = requirement_base_facet_type %.loc10_32 [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_55: %A.type = name_ref .Self, %.Self.frozen.loc10_49 [symbolic_self = constants.%.Self.frozen.d4e]
// CHECK:STDOUT: %.Self.as_type.loc10_55: type = facet_access_type %.Self.ref.loc10_55 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_55: type = converted %.Self.ref.loc10_55, %.Self.as_type.loc10_55 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %C.ref: %A.assoc_type = name_ref C, @C.%assoc1 [concrete = constants.%assoc1]
// CHECK:STDOUT: %impl.elem1.loc10_48.1: type = impl_witness_access constants.%A.lookup_impl_witness.5db, element1 [symbolic_self = constants.%impl.elem1.06a]
// CHECK:STDOUT: %.loc10_54.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc10_54.2: type = converted %.loc10_54.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %rewrite.loc10_51.1 = requirement_rewrite %impl.elem1.loc10_48.1, %.loc10_54.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc10_48.2: type = impl_witness_access constants.%A.lookup_impl_witness.937, element1 [symbolic_self = constants.%impl.elem1.844]
// CHECK:STDOUT: %rewrite.loc10_51.2 = requirement_rewrite %impl.elem1.loc10_48.2, %.loc10_54.2 [concrete]
// CHECK:STDOUT: %.loc10_42.2: type = where_expr [concrete = constants.%A_where.type.0ba] {
// CHECK:STDOUT: %base_facet_type.loc10_42 = requirement_base_facet_type %.loc10_25 [concrete]
// CHECK:STDOUT: %rewrite.loc10_51.2 = requirement_rewrite %impl.elem1.loc10_48.2, %.loc10_54.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc10_55.1: type = impl_witness_access constants.%A.lookup_impl_witness.5db, element1 [symbolic_self = constants.%impl.elem1.06a]
// CHECK:STDOUT: %.loc10_61.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc10_61.2: type = converted %.loc10_61.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %rewrite.loc10_58.1 = requirement_rewrite %impl.elem1.loc10_55.1, %.loc10_61.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc10_55.2: type = impl_witness_access constants.%A.lookup_impl_witness.937, element1 [symbolic_self = constants.%impl.elem1.844]
// CHECK:STDOUT: %rewrite.loc10_58.2 = requirement_rewrite %impl.elem1.loc10_55.2, %.loc10_61.2 [concrete]
// CHECK:STDOUT: %.loc10_49.2: type = where_expr [concrete = constants.%A_where.type.0ba] {
// CHECK:STDOUT: %base_facet_type.loc10_49 = requirement_base_facet_type %.loc10_32 [concrete]
// CHECK:STDOUT: %rewrite.loc10_58.2 = requirement_rewrite %impl.elem1.loc10_55.2, %.loc10_61.2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %D.loc10_19.2: %A_where.type.0ba = symbolic_binding D, 0 [symbolic = %D.loc10_19.1 (constants.%D)]
// CHECK:STDOUT: %D.loc10_27.2: %A_where.type.0ba = symbolic_binding D, 0 [symbolic = %D.loc10_27.1 (constants.%D)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @NestedRewrite(%D.loc10_19.2: %A_where.type.0ba) {
// CHECK:STDOUT: %D.patt.loc10_19.2: %pattern_type = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc10_19.2 (constants.%D.patt)]
// CHECK:STDOUT: %D.loc10_19.1: %A_where.type.0ba = symbolic_binding D, 0 [symbolic = %D.loc10_19.1 (constants.%D)]
// CHECK:STDOUT: generic fn @NestedRewrite(%D.loc10_27.2: %A_where.type.0ba) {
// CHECK:STDOUT: %D.patt.loc10_27.2: %pattern_type = symbolic_binding_pattern D, 0 [symbolic = %D.patt.loc10_27.2 (constants.%D.patt)]
// CHECK:STDOUT: %D.loc10_27.1: %A_where.type.0ba = symbolic_binding D, 0 [symbolic = %D.loc10_27.1 (constants.%D)]
// CHECK:STDOUT:
// CHECK:STDOUT: fn();
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @NestedRewrite(constants.%D) {
// CHECK:STDOUT: %D.patt.loc10_19.2 => constants.%D.patt
// CHECK:STDOUT: %D.loc10_19.1 => constants.%D
// CHECK:STDOUT: %D.patt.loc10_27.2 => constants.%D.patt
// CHECK:STDOUT: %D.loc10_27.1 => constants.%D
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: --- repeated_rewrite.carbon
@@ -403,70 +403,70 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %OneRewrite.decl: %OneRewrite.type = fn_decl @OneRewrite [concrete = constants.%OneRewrite] {
// CHECK:STDOUT: %G.patt.loc9_23.1: %pattern_type.b73 = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc9_23.2 (constants.%G.patt)]
// CHECK:STDOUT: %G.patt.loc9_31.1: %pattern_type.b73 = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc9_31.2 (constants.%G.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc9_28.1: type = splice_block %.loc9_28.2 [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc9_23: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc9_35.1: type = splice_block %.loc9_35.2 [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc9_31: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
// CHECK:STDOUT: %.Self.frozen.loc9_28: %E.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.frozen.loc9_35: %E.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %E.ref [concrete]
// CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self.frozen.loc9_28 [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.ref: %E.type = name_ref .Self, %.Self.frozen.loc9_35 [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc9_34: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc9_41: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %F.ref: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc9_34.1: type = impl_witness_access constants.%E.lookup_impl_witness.b1b, element0 [symbolic_self = constants.%impl.elem0.efe]
// CHECK:STDOUT: %impl.elem0.loc9_41.1: type = impl_witness_access constants.%E.lookup_impl_witness.b1b, element0 [symbolic_self = constants.%impl.elem0.efe]
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc9_37.1 = requirement_rewrite %impl.elem0.loc9_34.1, %i32 [concrete]
// CHECK:STDOUT: %impl.elem0.loc9_34.2: type = impl_witness_access constants.%E.lookup_impl_witness.8bd, element0 [symbolic_self = constants.%impl.elem0.554]
// CHECK:STDOUT: %rewrite.loc9_37.2 = requirement_rewrite %impl.elem0.loc9_34.2, %i32 [concrete]
// CHECK:STDOUT: %.loc9_28.2: type = where_expr [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %rewrite.loc9_44.1 = requirement_rewrite %impl.elem0.loc9_41.1, %i32 [concrete]
// CHECK:STDOUT: %impl.elem0.loc9_41.2: type = impl_witness_access constants.%E.lookup_impl_witness.8bd, element0 [symbolic_self = constants.%impl.elem0.554]
// CHECK:STDOUT: %rewrite.loc9_44.2 = requirement_rewrite %impl.elem0.loc9_41.2, %i32 [concrete]
// CHECK:STDOUT: %.loc9_35.2: type = where_expr [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %E.ref [concrete]
// CHECK:STDOUT: %rewrite.loc9_37.2 = requirement_rewrite %impl.elem0.loc9_34.2, %i32 [concrete]
// CHECK:STDOUT: %rewrite.loc9_44.2 = requirement_rewrite %impl.elem0.loc9_41.2, %i32 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.loc9_23.2: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_23.1 (constants.%G)]
// CHECK:STDOUT: %G.loc9_31.2: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_31.1 (constants.%G)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %RepeatedRewrite.decl: %RepeatedRewrite.type = fn_decl @RepeatedRewrite [concrete = constants.%RepeatedRewrite] {
// CHECK:STDOUT: %H.patt.loc11_21.1: %pattern_type.b73 = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc11_21.2 (constants.%H.patt)]
// CHECK:STDOUT: %H.patt.loc11_29.1: %pattern_type.b73 = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc11_29.2 (constants.%H.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11_26.1: type = splice_block %.loc11_26.2 [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc11_21: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc11_33.1: type = splice_block %.loc11_33.2 [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc11_29: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
// CHECK:STDOUT: %.Self.frozen.loc11_26: %E.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.frozen.loc11_33: %E.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %E.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc11_32: %E.type = name_ref .Self, %.Self.frozen.loc11_26 [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.as_type.loc11_32: type = facet_access_type %.Self.ref.loc11_32 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc11_32: type = converted %.Self.ref.loc11_32, %.Self.as_type.loc11_32 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %F.ref.loc11_32: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc11_32.1: type = impl_witness_access constants.%E.lookup_impl_witness.b1b, element0 [symbolic_self = constants.%impl.elem0.efe]
// CHECK:STDOUT: %i32.loc11_37: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc11_35.1 = requirement_rewrite %impl.elem0.loc11_32.1, %i32.loc11_37 [concrete]
// CHECK:STDOUT: %.Self.ref.loc11_45: %E.type = name_ref .Self, %.Self.frozen.loc11_26 [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.as_type.loc11_45: type = facet_access_type %.Self.ref.loc11_45 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc11_45: type = converted %.Self.ref.loc11_45, %.Self.as_type.loc11_45 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %F.ref.loc11_45: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc11_45.1: type = impl_witness_access constants.%E.lookup_impl_witness.b1b, element0 [symbolic_self = constants.%impl.elem0.efe]
// CHECK:STDOUT: %impl.elem0.subst.loc11_45.1: type = impl_witness_access_substituted %impl.elem0.loc11_45.1, %i32.loc11_37 [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc11_50: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc11_48.1 = requirement_rewrite %impl.elem0.subst.loc11_45.1, %i32.loc11_50 [concrete]
// CHECK:STDOUT: %impl.elem0.loc11_32.2: type = impl_witness_access constants.%E.lookup_impl_witness.8bd, element0 [symbolic_self = constants.%impl.elem0.554]
// CHECK:STDOUT: %rewrite.loc11_35.2 = requirement_rewrite %impl.elem0.loc11_32.2, %i32.loc11_37 [concrete]
// CHECK:STDOUT: %impl.elem0.loc11_45.2: type = impl_witness_access constants.%E.lookup_impl_witness.8bd, element0 [symbolic_self = constants.%impl.elem0.554]
// CHECK:STDOUT: %impl.elem0.subst.loc11_45.2: type = impl_witness_access_substituted %impl.elem0.loc11_45.2, %i32.loc11_37 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc11_48.2 = requirement_rewrite %impl.elem0.subst.loc11_45.2, %i32.loc11_50 [concrete]
// CHECK:STDOUT: %.loc11_26.2: type = where_expr [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %.Self.ref.loc11_39: %E.type = name_ref .Self, %.Self.frozen.loc11_33 [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.as_type.loc11_39: type = facet_access_type %.Self.ref.loc11_39 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc11_39: type = converted %.Self.ref.loc11_39, %.Self.as_type.loc11_39 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %F.ref.loc11_39: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc11_39.1: type = impl_witness_access constants.%E.lookup_impl_witness.b1b, element0 [symbolic_self = constants.%impl.elem0.efe]
// CHECK:STDOUT: %i32.loc11_44: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc11_42.1 = requirement_rewrite %impl.elem0.loc11_39.1, %i32.loc11_44 [concrete]
// CHECK:STDOUT: %.Self.ref.loc11_52: %E.type = name_ref .Self, %.Self.frozen.loc11_33 [symbolic_self = constants.%.Self.frozen.64b]
// CHECK:STDOUT: %.Self.as_type.loc11_52: type = facet_access_type %.Self.ref.loc11_52 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc11_52: type = converted %.Self.ref.loc11_52, %.Self.as_type.loc11_52 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %F.ref.loc11_52: %E.assoc_type = name_ref F, @F.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc11_52.1: type = impl_witness_access constants.%E.lookup_impl_witness.b1b, element0 [symbolic_self = constants.%impl.elem0.efe]
// CHECK:STDOUT: %impl.elem0.subst.loc11_52.1: type = impl_witness_access_substituted %impl.elem0.loc11_52.1, %i32.loc11_44 [concrete = constants.%i32]
// CHECK:STDOUT: %i32.loc11_57: type = type_literal constants.%i32 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc11_55.1 = requirement_rewrite %impl.elem0.subst.loc11_52.1, %i32.loc11_57 [concrete]
// CHECK:STDOUT: %impl.elem0.loc11_39.2: type = impl_witness_access constants.%E.lookup_impl_witness.8bd, element0 [symbolic_self = constants.%impl.elem0.554]
// CHECK:STDOUT: %rewrite.loc11_42.2 = requirement_rewrite %impl.elem0.loc11_39.2, %i32.loc11_44 [concrete]
// CHECK:STDOUT: %impl.elem0.loc11_52.2: type = impl_witness_access constants.%E.lookup_impl_witness.8bd, element0 [symbolic_self = constants.%impl.elem0.554]
// CHECK:STDOUT: %impl.elem0.subst.loc11_52.2: type = impl_witness_access_substituted %impl.elem0.loc11_52.2, %i32.loc11_44 [concrete = constants.%i32]
// CHECK:STDOUT: %rewrite.loc11_55.2 = requirement_rewrite %impl.elem0.subst.loc11_52.2, %i32.loc11_57 [concrete]
// CHECK:STDOUT: %.loc11_33.2: type = where_expr [concrete = constants.%E_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %E.ref [concrete]
// CHECK:STDOUT: %rewrite.loc11_35.2 = requirement_rewrite %impl.elem0.loc11_32.2, %i32.loc11_37 [concrete]
// CHECK:STDOUT: %rewrite.loc11_48.2 = requirement_rewrite %impl.elem0.subst.loc11_45.2, %i32.loc11_50 [concrete]
// CHECK:STDOUT: %rewrite.loc11_42.2 = requirement_rewrite %impl.elem0.loc11_39.2, %i32.loc11_44 [concrete]
// CHECK:STDOUT: %rewrite.loc11_55.2 = requirement_rewrite %impl.elem0.subst.loc11_52.2, %i32.loc11_57 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %H.loc11_21.2: %E_where.type = symbolic_binding H, 0 [symbolic = %H.loc11_21.1 (constants.%H)]
// CHECK:STDOUT: %H.loc11_29.2: %E_where.type = symbolic_binding H, 0 [symbolic = %H.loc11_29.1 (constants.%H)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @OneRewrite(%G.loc9_23.2: %E_where.type) {
// CHECK:STDOUT: %G.patt.loc9_23.2: %pattern_type.b73 = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc9_23.2 (constants.%G.patt)]
// CHECK:STDOUT: %G.loc9_23.1: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_23.1 (constants.%G)]
// CHECK:STDOUT: generic fn @OneRewrite(%G.loc9_31.2: %E_where.type) {
// CHECK:STDOUT: %G.patt.loc9_31.2: %pattern_type.b73 = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc9_31.2 (constants.%G.patt)]
// CHECK:STDOUT: %G.loc9_31.1: %E_where.type = symbolic_binding G, 0 [symbolic = %G.loc9_31.1 (constants.%G)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
@@ -478,9 +478,9 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @RepeatedRewrite(%H.loc11_21.2: %E_where.type) {
// CHECK:STDOUT: %H.patt.loc11_21.2: %pattern_type.b73 = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc11_21.2 (constants.%H.patt)]
// CHECK:STDOUT: %H.loc11_21.1: %E_where.type = symbolic_binding H, 0 [symbolic = %H.loc11_21.1 (constants.%H)]
// CHECK:STDOUT: generic fn @RepeatedRewrite(%H.loc11_29.2: %E_where.type) {
// CHECK:STDOUT: %H.patt.loc11_29.2: %pattern_type.b73 = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc11_29.2 (constants.%H.patt)]
// CHECK:STDOUT: %H.loc11_29.1: %E_where.type = symbolic_binding H, 0 [symbolic = %H.loc11_29.1 (constants.%H)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: <elided>
@@ -494,33 +494,33 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OneRewrite(constants.%G) {
// CHECK:STDOUT: %G.patt.loc9_23.2 => constants.%G.patt
// CHECK:STDOUT: %G.loc9_23.1 => constants.%G
// CHECK:STDOUT: %G.patt.loc9_31.2 => constants.%G.patt
// CHECK:STDOUT: %G.loc9_31.1 => constants.%G
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @RepeatedRewrite(constants.%H) {
// CHECK:STDOUT: %H.patt.loc11_21.2 => constants.%H.patt
// CHECK:STDOUT: %H.loc11_21.1 => constants.%H
// CHECK:STDOUT: %H.patt.loc11_29.2 => constants.%H.patt
// CHECK:STDOUT: %H.loc11_29.1 => constants.%H
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OneRewrite(constants.%H) {
// CHECK:STDOUT: %G.patt.loc9_23.2 => constants.%G.patt
// CHECK:STDOUT: %G.loc9_23.1 => constants.%H
// CHECK:STDOUT: %G.patt.loc9_31.2 => constants.%G.patt
// CHECK:STDOUT: %G.loc9_31.1 => constants.%H
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @RepeatedRewrite(constants.%I) {
// CHECK:STDOUT: %H.patt.loc11_21.2 => constants.%H.patt
// CHECK:STDOUT: %H.loc11_21.1 => constants.%I
// CHECK:STDOUT: %H.patt.loc11_29.2 => constants.%H.patt
// CHECK:STDOUT: %H.loc11_29.1 => constants.%I
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: %OneRewrite.specific_fn.loc13_3.2 => constants.%OneRewrite.specific_fn.ba0394.2
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @OneRewrite(constants.%I) {
// CHECK:STDOUT: %G.patt.loc9_23.2 => constants.%G.patt
// CHECK:STDOUT: %G.loc9_23.1 => constants.%I
// CHECK:STDOUT: %G.patt.loc9_31.2 => constants.%G.patt
// CHECK:STDOUT: %G.loc9_31.1 => constants.%I
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
@@ -559,80 +559,80 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: %Alphabetical.decl: %Alphabetical.type = fn_decl @Alphabetical [concrete = constants.%Alphabetical] {
// CHECK:STDOUT: %M.patt.loc10_25.1: %pattern_type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc10_25.2 (constants.%M.patt)]
// CHECK:STDOUT: %M.patt.loc10_33.1: %pattern_type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc10_33.2 (constants.%M.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc10_30.1: type = splice_block %.loc10_30.2 [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc10_25: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc10_37.1: type = splice_block %.loc10_37.2 [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc10_33: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
// CHECK:STDOUT: %.Self.frozen.loc10_30: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.frozen.loc10_37: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %J.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_36: %J.type = name_ref .Self, %.Self.frozen.loc10_30 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc10_36: type = facet_access_type %.Self.ref.loc10_36 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_36: type = converted %.Self.ref.loc10_36, %.Self.as_type.loc10_36 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.Self.ref.loc10_43: %J.type = name_ref .Self, %.Self.frozen.loc10_37 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc10_43: type = facet_access_type %.Self.ref.loc10_43 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_43: type = converted %.Self.ref.loc10_43, %.Self.as_type.loc10_43 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %K.ref: %J.assoc_type = name_ref K, @K.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc10_36.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element0 [symbolic_self = constants.%impl.elem0.221]
// CHECK:STDOUT: %.loc10_42.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc10_42.2: type = converted %.loc10_42.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %rewrite.loc10_39.1 = requirement_rewrite %impl.elem0.loc10_36.1, %.loc10_42.2 [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_48: %J.type = name_ref .Self, %.Self.frozen.loc10_30 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc10_48: type = facet_access_type %.Self.ref.loc10_48 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_48: type = converted %.Self.ref.loc10_48, %.Self.as_type.loc10_48 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impl.elem0.loc10_43.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element0 [symbolic_self = constants.%impl.elem0.221]
// CHECK:STDOUT: %.loc10_49.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc10_49.2: type = converted %.loc10_49.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %rewrite.loc10_46.1 = requirement_rewrite %impl.elem0.loc10_43.1, %.loc10_49.2 [concrete]
// CHECK:STDOUT: %.Self.ref.loc10_55: %J.type = name_ref .Self, %.Self.frozen.loc10_37 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc10_55: type = facet_access_type %.Self.ref.loc10_55 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc10_55: type = converted %.Self.ref.loc10_55, %.Self.as_type.loc10_55 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %L.ref: %J.assoc_type = name_ref L, @L.%assoc1 [concrete = constants.%assoc1]
// CHECK:STDOUT: %impl.elem1.loc10_48.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element1 [symbolic_self = constants.%impl.elem1.eed]
// CHECK:STDOUT: %.loc10_53: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %rewrite.loc10_51.1 = requirement_rewrite %impl.elem1.loc10_48.1, %.loc10_53 [concrete]
// CHECK:STDOUT: %impl.elem0.loc10_36.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element0 [symbolic_self = constants.%impl.elem0.bbd]
// CHECK:STDOUT: %rewrite.loc10_39.2 = requirement_rewrite %impl.elem0.loc10_36.2, %.loc10_42.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc10_48.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element1 [symbolic_self = constants.%impl.elem1.fb5]
// CHECK:STDOUT: %rewrite.loc10_51.2 = requirement_rewrite %impl.elem1.loc10_48.2, %.loc10_53 [concrete]
// CHECK:STDOUT: %.loc10_30.2: type = where_expr [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %impl.elem1.loc10_55.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element1 [symbolic_self = constants.%impl.elem1.eed]
// CHECK:STDOUT: %.loc10_60: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %rewrite.loc10_58.1 = requirement_rewrite %impl.elem1.loc10_55.1, %.loc10_60 [concrete]
// CHECK:STDOUT: %impl.elem0.loc10_43.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element0 [symbolic_self = constants.%impl.elem0.bbd]
// CHECK:STDOUT: %rewrite.loc10_46.2 = requirement_rewrite %impl.elem0.loc10_43.2, %.loc10_49.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc10_55.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element1 [symbolic_self = constants.%impl.elem1.fb5]
// CHECK:STDOUT: %rewrite.loc10_58.2 = requirement_rewrite %impl.elem1.loc10_55.2, %.loc10_60 [concrete]
// CHECK:STDOUT: %.loc10_37.2: type = where_expr [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %J.ref [concrete]
// CHECK:STDOUT: %rewrite.loc10_39.2 = requirement_rewrite %impl.elem0.loc10_36.2, %.loc10_42.2 [concrete]
// CHECK:STDOUT: %rewrite.loc10_51.2 = requirement_rewrite %impl.elem1.loc10_48.2, %.loc10_53 [concrete]
// CHECK:STDOUT: %rewrite.loc10_46.2 = requirement_rewrite %impl.elem0.loc10_43.2, %.loc10_49.2 [concrete]
// CHECK:STDOUT: %rewrite.loc10_58.2 = requirement_rewrite %impl.elem1.loc10_55.2, %.loc10_60 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %M.loc10_25.2: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_25.1 (constants.%M)]
// CHECK:STDOUT: %M.loc10_33.2: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_33.1 (constants.%M)]
// CHECK:STDOUT: }
// CHECK:STDOUT: %Reversed.decl: %Reversed.type = fn_decl @Reversed [concrete = constants.%Reversed] {
// CHECK:STDOUT: %N.patt.loc12_14.1: %pattern_type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_14.2 (constants.%N.patt)]
// CHECK:STDOUT: %N.patt.loc12_22.1: %pattern_type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_22.2 (constants.%N.patt)]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.2 [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc12_14: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %.loc12_26.1: type = splice_block %.loc12_26.2 [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %.Self.frozen.loc12_22: %type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.197]
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
// CHECK:STDOUT: %.Self.frozen.loc12_19: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.frozen.loc12_26: %J.type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %J.ref [concrete]
// CHECK:STDOUT: %.Self.ref.loc12_25: %J.type = name_ref .Self, %.Self.frozen.loc12_19 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc12_25: type = facet_access_type %.Self.ref.loc12_25 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc12_25: type = converted %.Self.ref.loc12_25, %.Self.as_type.loc12_25 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.Self.ref.loc12_32: %J.type = name_ref .Self, %.Self.frozen.loc12_26 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc12_32: type = facet_access_type %.Self.ref.loc12_32 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc12_32: type = converted %.Self.ref.loc12_32, %.Self.as_type.loc12_32 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %L.ref: %J.assoc_type = name_ref L, @L.%assoc1 [concrete = constants.%assoc1]
// CHECK:STDOUT: %impl.elem1.loc12_25.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element1 [symbolic_self = constants.%impl.elem1.eed]
// CHECK:STDOUT: %.loc12_30: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %rewrite.loc12_28.1 = requirement_rewrite %impl.elem1.loc12_25.1, %.loc12_30 [concrete]
// CHECK:STDOUT: %.Self.ref.loc12_39: %J.type = name_ref .Self, %.Self.frozen.loc12_19 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc12_39: type = facet_access_type %.Self.ref.loc12_39 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc12_39: type = converted %.Self.ref.loc12_39, %.Self.as_type.loc12_39 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %impl.elem1.loc12_32.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element1 [symbolic_self = constants.%impl.elem1.eed]
// CHECK:STDOUT: %.loc12_37: type = type_literal bool [concrete = bool]
// CHECK:STDOUT: %rewrite.loc12_35.1 = requirement_rewrite %impl.elem1.loc12_32.1, %.loc12_37 [concrete]
// CHECK:STDOUT: %.Self.ref.loc12_46: %J.type = name_ref .Self, %.Self.frozen.loc12_26 [symbolic_self = constants.%.Self.frozen.99c]
// CHECK:STDOUT: %.Self.as_type.loc12_46: type = facet_access_type %.Self.ref.loc12_46 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %.loc12_46: type = converted %.Self.ref.loc12_46, %.Self.as_type.loc12_46 [symbolic_self = constants.%.Self.frozen.as_type]
// CHECK:STDOUT: %K.ref: %J.assoc_type = name_ref K, @K.%assoc0 [concrete = constants.%assoc0]
// CHECK:STDOUT: %impl.elem0.loc12_39.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element0 [symbolic_self = constants.%impl.elem0.221]
// CHECK:STDOUT: %.loc12_45.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc12_45.2: type = converted %.loc12_45.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %rewrite.loc12_42.1 = requirement_rewrite %impl.elem0.loc12_39.1, %.loc12_45.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc12_25.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element1 [symbolic_self = constants.%impl.elem1.fb5]
// CHECK:STDOUT: %rewrite.loc12_28.2 = requirement_rewrite %impl.elem1.loc12_25.2, %.loc12_30 [concrete]
// CHECK:STDOUT: %impl.elem0.loc12_39.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element0 [symbolic_self = constants.%impl.elem0.bbd]
// CHECK:STDOUT: %rewrite.loc12_42.2 = requirement_rewrite %impl.elem0.loc12_39.2, %.loc12_45.2 [concrete]
// CHECK:STDOUT: %.loc12_19.2: type = where_expr [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %impl.elem0.loc12_46.1: type = impl_witness_access constants.%J.lookup_impl_witness.cb1, element0 [symbolic_self = constants.%impl.elem0.221]
// CHECK:STDOUT: %.loc12_52.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc12_52.2: type = converted %.loc12_52.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: %rewrite.loc12_49.1 = requirement_rewrite %impl.elem0.loc12_46.1, %.loc12_52.2 [concrete]
// CHECK:STDOUT: %impl.elem1.loc12_32.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element1 [symbolic_self = constants.%impl.elem1.fb5]
// CHECK:STDOUT: %rewrite.loc12_35.2 = requirement_rewrite %impl.elem1.loc12_32.2, %.loc12_37 [concrete]
// CHECK:STDOUT: %impl.elem0.loc12_46.2: type = impl_witness_access constants.%J.lookup_impl_witness.df8, element0 [symbolic_self = constants.%impl.elem0.bbd]
// CHECK:STDOUT: %rewrite.loc12_49.2 = requirement_rewrite %impl.elem0.loc12_46.2, %.loc12_52.2 [concrete]
// CHECK:STDOUT: %.loc12_26.2: type = where_expr [concrete = constants.%J_where.type] {
// CHECK:STDOUT: %base_facet_type = requirement_base_facet_type %J.ref [concrete]
// CHECK:STDOUT: %rewrite.loc12_28.2 = requirement_rewrite %impl.elem1.loc12_25.2, %.loc12_30 [concrete]
// CHECK:STDOUT: %rewrite.loc12_42.2 = requirement_rewrite %impl.elem0.loc12_39.2, %.loc12_45.2 [concrete]
// CHECK:STDOUT: %rewrite.loc12_35.2 = requirement_rewrite %impl.elem1.loc12_32.2, %.loc12_37 [concrete]
// CHECK:STDOUT: %rewrite.loc12_49.2 = requirement_rewrite %impl.elem0.loc12_46.2, %.loc12_52.2 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT: %N.loc12_14.2: %J_where.type = symbolic_binding N, 0 [symbolic = %N.loc12_14.1 (constants.%N)]
// CHECK:STDOUT: %N.loc12_22.2: %J_where.type = symbolic_binding N, 0 [symbolic = %N.loc12_22.1 (constants.%N)]
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Alphabetical(%M.loc10_25.2: %J_where.type) {
// CHECK:STDOUT: %M.patt.loc10_25.2: %pattern_type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc10_25.2 (constants.%M.patt)]
// CHECK:STDOUT: %M.loc10_25.1: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_25.1 (constants.%M)]
// CHECK:STDOUT: generic fn @Alphabetical(%M.loc10_33.2: %J_where.type) {
// CHECK:STDOUT: %M.patt.loc10_33.2: %pattern_type = symbolic_binding_pattern M, 0 [symbolic = %M.patt.loc10_33.2 (constants.%M.patt)]
// CHECK:STDOUT: %M.loc10_33.1: %J_where.type = symbolic_binding M, 0 [symbolic = %M.loc10_33.1 (constants.%M)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT:
@@ -644,9 +644,9 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: generic fn @Reversed(%N.loc12_14.2: %J_where.type) {
// CHECK:STDOUT: %N.patt.loc12_14.2: %pattern_type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_14.2 (constants.%N.patt)]
// CHECK:STDOUT: %N.loc12_14.1: %J_where.type = symbolic_binding N, 0 [symbolic = %N.loc12_14.1 (constants.%N)]
// CHECK:STDOUT: generic fn @Reversed(%N.loc12_22.2: %J_where.type) {
// CHECK:STDOUT: %N.patt.loc12_22.2: %pattern_type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_22.2 (constants.%N.patt)]
// CHECK:STDOUT: %N.loc12_22.1: %J_where.type = symbolic_binding N, 0 [symbolic = %N.loc12_22.1 (constants.%N)]
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: <elided>
@@ -660,18 +660,18 @@ let K: (E where .F = .Self.G) = bool;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Alphabetical(constants.%M) {
// CHECK:STDOUT: %M.patt.loc10_25.2 => constants.%M.patt
// CHECK:STDOUT: %M.loc10_25.1 => constants.%M
// CHECK:STDOUT: %M.patt.loc10_33.2 => constants.%M.patt
// CHECK:STDOUT: %M.loc10_33.1 => constants.%M
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Reversed(constants.%N) {
// CHECK:STDOUT: %N.patt.loc12_14.2 => constants.%N.patt
// CHECK:STDOUT: %N.loc12_14.1 => constants.%N
// CHECK:STDOUT: %N.patt.loc12_22.2 => constants.%N.patt
// CHECK:STDOUT: %N.loc12_22.1 => constants.%N
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: specific @Alphabetical(constants.%N) {
// CHECK:STDOUT: %M.patt.loc10_25.2 => constants.%M.patt
// CHECK:STDOUT: %M.loc10_25.1 => constants.%N
// CHECK:STDOUT: %M.patt.loc10_33.2 => constants.%M.patt
// CHECK:STDOUT: %M.loc10_33.1 => constants.%N
// CHECK:STDOUT:
// CHECK:STDOUT: !definition:
// CHECK:STDOUT: }
+8 -8
View File
@@ -14,21 +14,21 @@
library "[[@TEST_NAME]]";
// CHECK:STDERR: fail_left_where_not_facet.carbon:[[@LINE+4]]:10: error: left argument of `where` operator must be a facet type [WhereOnNonFacetType]
// CHECK:STDERR: fn F(T:! i32 where .Self == bool);
// CHECK:STDERR: ^~~
// CHECK:STDERR: fail_left_where_not_facet.carbon:[[@LINE+4]]:17: error: left argument of `where` operator must be a facet type [WhereOnNonFacetType]
// CHECK:STDERR: fn F(generic T: i32 where .Self == bool);
// CHECK:STDERR: ^~~
// CHECK:STDERR:
fn F(T:! i32 where .Self == bool);
fn F(generic T: i32 where .Self == bool);
// --- fail_left_where_unknown.carbon
library "[[@TEST_NAME]]";
// CHECK:STDERR: fail_left_where_unknown.carbon:[[@LINE+4]]:10: error: name `NOT_DECLARED` not found [NameNotFound]
// CHECK:STDERR: fn G(U:! NOT_DECLARED where .Self == bool);
// CHECK:STDERR: ^~~~~~~~~~~~
// CHECK:STDERR: fail_left_where_unknown.carbon:[[@LINE+4]]:17: error: name `NOT_DECLARED` not found [NameNotFound]
// CHECK:STDERR: fn G(generic U: NOT_DECLARED where .Self == bool);
// CHECK:STDERR: ^~~~~~~~~~~~
// CHECK:STDERR:
fn G(U:! NOT_DECLARED where .Self == bool);
fn G(generic U: NOT_DECLARED where .Self == bool);
// --- fail_var.carbon
+1 -1
View File
@@ -10,7 +10,7 @@
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/where_expr/non_generic.carbon
interface I { let T:! type; }
interface I { let T: type; }
// Ensure that we don't crash when checking this `where` in a non-generic context.
//@dump-sem-ir-begin