mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 14:42:40 +00:00
This is the final step in landing the _structural_ updates to diagnostic rendering. The key idea here is that we want the primary diagnostic to have a message clearly explaining the problem and attached to the code that has that problem. This should be the starting point for readers working to address the issue, but is rendered attached to the code snippet in question so errors are always "in context" of the code with the error. Everything else in a diagnostic is an additional label attached to code to explain or help the reader understand the problem in the primary message. Previously, `ContextScope` resulted in some confusion here, as diagnostic consumers turned messages into labels and made the message in the context scope the message. In essence, this isn't a scope with context _for_ a diagnostic (with two exceptions that should probably have been an `AnnotationScope`), but a context within `check` where we have a preferred message for a diagnostic emitted by general purpose code we call into. For example, "class was forward declared here" starts as an error, and then consumers render it as a label to make the message from the context scope the error. We also grew an `AnnotationScope` to handle the contextual information we want to show for a diagnostic (what I would have assumed `ContextScope` actually did). Now we have a `Diagnoser`: code in `check` that can better explain the problem than shared logic it is calling into passes a callback that builds a caller-specific diagnostic. The callee then can attach relevant labels and emit it. Diagnostics no longer store `contexts` and consumers no longer need the logic to restructure things. We move all (but two) of the old contexts to be normal messages emitted in this way, and we move some diagnostics to become labels. Each of the new normal messages corresponds to a new diagnostic kind as usual. Common code following this pattern now _requires_ the `Diagnoser` to be passed (or emit nothing), and this uncovered three places where an empty context was used that made the rendered form miss key information. All three are fixed with new diagnostics, one already covered by tests, and two with TODOs to add test coverage. We also completely remove the old `ContextScope` and `CARBON_DIAGNOSTIC_CONTEXT` and rename `AnnotationScope` to `ContextScope`. It is only used to attach information about when/where a diagnostic occurred. Labels also no longer have categories. What were `Primary` are now `ExtraRange`s on the diagnostic rather than labels. Labels are now always informational. `DeclaredName` now narrows the range of a label when the range is a declaration of a named entity to only be the range of that name. For entities that don't have a declared name, the entire declaration remains the range. The code building and emitting these diagnostics can skip them if the declared location isn't distinct from the diagnostic location. Wording is largely unchanged here so we can just review the _structural_ change. #7991 iterates using this to improve locations and adds missing labels. A subsequent PR will iterate on the wording to increasingly fit within this structural model. This is separated out as a way to review incrementally, and so that subsequently we don't have to review wording improvements that only make sense in a new structure that you cannot see yet. It seems easier to look at the structure here even with awkward wording. Assisted-by: Claude Code
723 lines
46 KiB
Plaintext
723 lines
46 KiB
Plaintext
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
|
// Exceptions. See /LICENSE for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/primitives.carbon
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/where_expr/equal_rewrite.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/where_expr/equal_rewrite.carbon
|
|
|
|
// --- equal_constraint.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface N {
|
|
let P: type;
|
|
}
|
|
|
|
//@dump-sem-ir-begin
|
|
fn Equal(generic T: N where .P = {});
|
|
//@dump-sem-ir-end
|
|
|
|
// --- nested_rewrites.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface A {
|
|
let B: type;
|
|
let C: type;
|
|
}
|
|
|
|
//@dump-sem-ir-begin
|
|
fn NestedRewrite(generic D: (A where .B = bool) where .C = ());
|
|
//@dump-sem-ir-end
|
|
|
|
// --- repeated_rewrite.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface E {
|
|
let F: type;
|
|
}
|
|
|
|
//@dump-sem-ir-begin
|
|
fn OneRewrite(unused generic G: E where .F = i32) {}
|
|
|
|
fn RepeatedRewrite(generic H: E where .F = i32 and .F = i32) {
|
|
//@dump-sem-ir-end
|
|
OneRewrite(H);
|
|
}
|
|
|
|
fn OneRewriteAgain(generic I: E where .F = i32) {
|
|
RepeatedRewrite(I);
|
|
}
|
|
|
|
// --- rewrites_reordered.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface J {
|
|
let K: type;
|
|
let L: type;
|
|
}
|
|
|
|
//@dump-sem-ir-begin
|
|
fn Alphabetical(unused generic M: J where .K = () and .L = bool) {}
|
|
|
|
fn Reversed(generic N: J where .L = bool and .K = ()) {
|
|
//@dump-sem-ir-end
|
|
Alphabetical(N);
|
|
}
|
|
|
|
// --- fail_rewrites_mismatch_right.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface O {
|
|
let P: type;
|
|
}
|
|
|
|
fn WithInteger(unused generic Q: O where .P = i32) {}
|
|
|
|
fn WithBool(generic R: O where .P = bool) {
|
|
// CHECK:STDERR: ╭─┤ fail_rewrites_mismatch_right.carbon:[[@LINE+14]]:3
|
|
// CHECK:STDERR: │ fn WithInteger(unused generic Q: O where .P = i32) {}
|
|
// CHECK:STDERR: · ┬──────────────────
|
|
// CHECK:STDERR: · ╰──┤ initializing generic parameter `Q` declared
|
|
// CHECK:STDERR: · │ here
|
|
// CHECK:STDERR: · │ [InitializingGenericParam]
|
|
// CHECK:STDERR: ┆
|
|
// CHECK:STDERR: -> │ WithInteger(R);
|
|
// CHECK:STDERR: · ┳━━━━━━━━━━━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `R` that implements `O where .(O.P) = bool`
|
|
// CHECK:STDERR: · ┃ into type implementing `O where .(O.P) = i32`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureFacetToFacet]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
WithInteger(R);
|
|
}
|
|
|
|
// --- fail_rewrites_mismatch_left.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface S {
|
|
let T: type;
|
|
let U: type;
|
|
}
|
|
|
|
fn WithT(unused generic V: S where .T = ()) {}
|
|
|
|
fn WithU(generic W: S where .U = ()) {
|
|
// CHECK:STDERR: ╭─┤ fail_rewrites_mismatch_left.carbon:[[@LINE+13]]:3
|
|
// CHECK:STDERR: │ fn WithT(unused generic V: S where .T = ()) {}
|
|
// CHECK:STDERR: · ───┬──────────────
|
|
// CHECK:STDERR: · ╰──┤ initializing generic parameter `V` declared here
|
|
// CHECK:STDERR: · │ [InitializingGenericParam]
|
|
// CHECK:STDERR: ┆
|
|
// CHECK:STDERR: -> │ WithT(W);
|
|
// CHECK:STDERR: · ┳━━━━━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `W` that implements `S where .(S.U) = ()` into
|
|
// CHECK:STDERR: · ┃ type implementing `S where .(S.T) = ()`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureFacetToFacet]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
WithT(W);
|
|
}
|
|
|
|
// --- fail_import_rewrites.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "equal_constraint";
|
|
import library "nested_rewrites";
|
|
|
|
fn Calls() {
|
|
// CHECK:STDERR: ╭─┤ fail_import_rewrites.carbon:[[@LINE+14]]:3
|
|
// CHECK:STDERR: -> │ Equal(bool);
|
|
// CHECK:STDERR: · ┳━━━━━━━━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `bool` into type implementing
|
|
// CHECK:STDERR: · ┃ `N where .(N.P) = {}`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
|
// CHECK:STDERR: ┆
|
|
// CHECK:STDERR: ├─┤ equal_constraint.carbon
|
|
// CHECK:STDERR: │ fn Equal(generic T: N where .P = {});
|
|
// CHECK:STDERR: · ─────────┬────────
|
|
// CHECK:STDERR: · ╰──┤ initializing generic parameter `T` declared here
|
|
// CHECK:STDERR: · │ [InitializingGenericParam]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
Equal(bool);
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_import_rewrites.carbon:[[@LINE+14]]:3
|
|
// CHECK:STDERR: -> │ NestedRewrite(i32);
|
|
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `i32` into type implementing
|
|
// CHECK:STDERR: · ┃ `A where .(A.C) = () and .(A.B) = bool`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
|
// CHECK:STDERR: ┆
|
|
// CHECK:STDERR: ├─┤ nested_rewrites.carbon
|
|
// CHECK:STDERR: │ fn NestedRewrite(generic D: (A where .B = bool) where .C = ());
|
|
// CHECK:STDERR: · ──┬─────────────────────────────────
|
|
// CHECK:STDERR: · ╰──┤ initializing generic parameter `D` declared here
|
|
// CHECK:STDERR: · │ [InitializingGenericParam]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
NestedRewrite(i32);
|
|
}
|
|
|
|
// --- fail_check_rewrite_constraints.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface I {
|
|
let Member: type;
|
|
}
|
|
|
|
// `2` can't be converted to the type of `I.Member`
|
|
// CHECK:STDERR: ╭─┤ fail_check_rewrite_constraints.carbon:[[@LINE+9]]:53
|
|
// CHECK:STDERR: -> │ fn RewriteTypeMismatch(generic X: I where .Member = 2);
|
|
// CHECK:STDERR: · ┳
|
|
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
// CHECK:STDERR: · ┃ error: cannot implicitly convert non-type value of type `Core.IntLiteral` to
|
|
// CHECK:STDERR: · ┃ `type`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureNonTypeToFacet]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn RewriteTypeMismatch(generic X: I where .Member = 2);
|
|
|
|
// --- fail_todo_let.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface A {}
|
|
class D {}
|
|
impl D as A {}
|
|
|
|
fn F() {
|
|
// CHECK:STDERR: ╭─┤ fail_todo_let.carbon:[[@LINE+9]]:15
|
|
// CHECK:STDERR: -> │ let generic E: type where .Self impls A = D;
|
|
// CHECK:STDERR: · ━━━━━━━━━━━━━┳━━━━━━━━━━━━━
|
|
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
// CHECK:STDERR: · ┃ error: semantics TODO:
|
|
// CHECK:STDERR: · ┃ `local generic `let` bindings are currently unsupported`
|
|
// CHECK:STDERR: · ┃ [SemanticsTodo]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
let generic E: type where .Self impls A = D;
|
|
}
|
|
|
|
// --- fail_todo_let_compile_time.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
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+9]]:13
|
|
// CHECK:STDERR: -> │ let generic B: type where .Self impls A = D;
|
|
// CHECK:STDERR: · ━━━━━━━━━━━━━┳━━━━━━━━━━━━━
|
|
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
// CHECK:STDERR: · ┃ error: semantics TODO:
|
|
// CHECK:STDERR: · ┃ ``let` compile time binding outside function or interface`
|
|
// CHECK:STDERR: · ┃ [SemanticsTodo]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
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;
|
|
}
|
|
// Testing how these types get stringified in error messages.
|
|
|
|
// TODO: This should be a compile-time binding, once that is supported.
|
|
// CHECK:STDERR: ╭─┤ fail_type_does_not_implement_where.carbon:[[@LINE+9]]:42
|
|
// CHECK:STDERR: -> │ let H: (E where .F = bool and .G = ()) = f64;
|
|
// CHECK:STDERR: · ━┳━
|
|
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
// CHECK:STDERR: · ┃ error: cannot convert type `f64` into type implementing
|
|
// CHECK:STDERR: · ┃ `E where .(E.F) = bool and .(E.G) = ()`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
let H: (E where .F = bool and .G = ()) = f64;
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_type_does_not_implement_where.carbon:[[@LINE+9]]:45
|
|
// CHECK:STDERR: -> │ let J: ((E where .F = {}) where .G = i32) = bool;
|
|
// CHECK:STDERR: · ━━┳━
|
|
// CHECK:STDERR: · ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
|
|
// CHECK:STDERR: · ┃ error: cannot convert type `bool` into type implementing
|
|
// CHECK:STDERR: · ┃ `E where .(E.F) = {} and .(E.G) = i32`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
let J: ((E where .F = {}) where .G = i32) = bool;
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_type_does_not_implement_where.carbon:[[@LINE+9]]:33
|
|
// CHECK:STDERR: -> │ let K: (E where .F = .Self.G) = bool;
|
|
// CHECK:STDERR: · ┳━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: cannot convert type `bool` into type
|
|
// CHECK:STDERR: · ┃ implementing
|
|
// CHECK:STDERR: · ┃ `E where .(E.F) = .(E.G)`
|
|
// CHECK:STDERR: · ┃ [ConversionFailureTypeToFacet]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
let K: (E where .F = .Self.G) = bool;
|
|
|
|
// CHECK:STDOUT: --- equal_constraint.carbon = $equal_constraint
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %N.type: type = facet_type <@N> [concrete]
|
|
// CHECK:STDOUT: %N.assoc_type: type = assoc_entity_type @N [concrete]
|
|
// CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.WithSelf.%P [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen.e58: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.098: %N.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.098 [symbolic_self]
|
|
// CHECK:STDOUT: %N.lookup_impl_witness.e97: <witness> = lookup_impl_witness %.Self.frozen.098, @N [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.892: type = impl_witness_access %N.lookup_impl_witness.e97, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.Self: %N.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %N.lookup_impl_witness.98e: <witness> = lookup_impl_witness %.Self, @N [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.48c: type = impl_witness_access %N.lookup_impl_witness.98e, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0.48c = %empty_struct_type> [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %N_where.type [concrete]
|
|
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [symbolic]
|
|
// CHECK:STDOUT: %T: %N_where.type = symbolic_binding T, 0 [symbolic]
|
|
// CHECK:STDOUT: %Equal.type: type = fn_type @Equal [concrete]
|
|
// CHECK:STDOUT: %Equal: %Equal.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: %Equal.decl: %Equal.type = fn_decl @Equal [concrete = constants.%Equal] {
|
|
// 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_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.e58]
|
|
// CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [concrete = constants.%N.type]
|
|
// 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_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_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_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_32.2 = requirement_rewrite %impl.elem0.loc9_29.2, %.loc9_35.2 [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// 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_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_19.2 => constants.%T.patt
|
|
// CHECK:STDOUT: %T.loc9_19.1 => constants.%T
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- nested_rewrites.carbon = $nested_rewrites
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %A.type: type = facet_type <@A> [concrete]
|
|
// CHECK:STDOUT: %A.assoc_type: type = assoc_entity_type @A [concrete]
|
|
// CHECK:STDOUT: %assoc0: %A.assoc_type = assoc_entity element0, @A.WithSelf.%B [concrete]
|
|
// CHECK:STDOUT: %assoc1: %A.assoc_type = assoc_entity element1, @A.WithSelf.%C [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen.e58: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.d4e: %A.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.d4e [symbolic_self]
|
|
// CHECK:STDOUT: %A.lookup_impl_witness.5db: <witness> = lookup_impl_witness %.Self.frozen.d4e, @A [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.6ea: type = impl_witness_access %A.lookup_impl_witness.5db, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %.Self: %A.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %A.lookup_impl_witness.937: <witness> = lookup_impl_witness %.Self, @A [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.0e0: type = impl_witness_access %A.lookup_impl_witness.937, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %A_where.type.beb: type = facet_type <@A where %impl.elem0.0e0 = bool> [concrete]
|
|
// CHECK:STDOUT: %impl.elem1.06a: type = impl_witness_access %A.lookup_impl_witness.5db, element1 [symbolic_self]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %impl.elem1.844: type = impl_witness_access %A.lookup_impl_witness.937, element1 [symbolic_self]
|
|
// CHECK:STDOUT: %A_where.type.0ba: type = facet_type <@A where %impl.elem0.0e0 = bool and %impl.elem1.844 = %empty_tuple.type> [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %A_where.type.0ba [concrete]
|
|
// CHECK:STDOUT: %D.patt: %pattern_type = symbolic_binding_pattern D, 0 [symbolic]
|
|
// CHECK:STDOUT: %D: %A_where.type.0ba = symbolic_binding D, 0 [symbolic]
|
|
// CHECK:STDOUT: %NestedRewrite.type: type = fn_type @NestedRewrite [concrete]
|
|
// CHECK:STDOUT: %NestedRewrite: %NestedRewrite.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: %NestedRewrite.decl: %NestedRewrite.type = fn_decl @NestedRewrite [concrete = constants.%NestedRewrite] {
|
|
// 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_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.e58]
|
|
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A.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_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_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_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_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_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_27.2 => constants.%D.patt
|
|
// CHECK:STDOUT: %D.loc10_27.1 => constants.%D
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- repeated_rewrite.carbon = $repeated_rewrite
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %E.type: type = facet_type <@E> [concrete]
|
|
// CHECK:STDOUT: %E.assoc_type: type = assoc_entity_type @E [concrete]
|
|
// CHECK:STDOUT: %assoc0: %E.assoc_type = assoc_entity element0, @E.WithSelf.%F [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen.e58: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.64b: %E.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.64b [symbolic_self]
|
|
// CHECK:STDOUT: %E.lookup_impl_witness.b1b: <witness> = lookup_impl_witness %.Self.frozen.64b, @E [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.efe: type = impl_witness_access %E.lookup_impl_witness.b1b, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: %.Self: %E.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %E.lookup_impl_witness.8bd: <witness> = lookup_impl_witness %.Self, @E [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.554: type = impl_witness_access %E.lookup_impl_witness.8bd, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %E_where.type: type = facet_type <@E where %impl.elem0.554 = %i32> [concrete]
|
|
// CHECK:STDOUT: %pattern_type.b17: type = pattern_type %E_where.type [concrete]
|
|
// CHECK:STDOUT: %G.patt: %pattern_type.b17 = symbolic_binding_pattern G, 0 [symbolic]
|
|
// CHECK:STDOUT: %G: %E_where.type = symbolic_binding G, 0 [symbolic]
|
|
// CHECK:STDOUT: %OneRewrite.type: type = fn_type @OneRewrite [concrete]
|
|
// CHECK:STDOUT: %OneRewrite: %OneRewrite.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %H.patt: %pattern_type.b17 = symbolic_binding_pattern H, 0 [symbolic]
|
|
// CHECK:STDOUT: %H: %E_where.type = symbolic_binding H, 0 [symbolic]
|
|
// CHECK:STDOUT: %RepeatedRewrite.type: type = fn_type @RepeatedRewrite [concrete]
|
|
// CHECK:STDOUT: %RepeatedRewrite: %RepeatedRewrite.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %I: %E_where.type = symbolic_binding I, 0 [symbolic]
|
|
// CHECK:STDOUT: %OneRewrite.specific_fn.c00382.2: <specific function> = specific_function %OneRewrite, @OneRewrite(%I) [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: %OneRewrite.decl: %OneRewrite.type = fn_decl @OneRewrite [concrete = constants.%OneRewrite] {
|
|
// CHECK:STDOUT: %G.patt.loc9_31.1: %pattern_type.b17 = symbolic_binding_pattern G, 0 [symbolic = %G.patt.loc9_31.2 (constants.%G.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// 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.e58]
|
|
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
|
|
// 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_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_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_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_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_44.2 = requirement_rewrite %impl.elem0.loc9_41.2, %i32 [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// 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_29.1: %pattern_type.b17 = symbolic_binding_pattern H, 0 [symbolic = %H.patt.loc11_29.2 (constants.%H.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// 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.e58]
|
|
// CHECK:STDOUT: %E.ref: type = name_ref E, file.%E.decl [concrete = constants.%E.type]
|
|
// 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_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_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_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_31.2: %E_where.type) {
|
|
// CHECK:STDOUT: %G.patt.loc9_31.2: %pattern_type.b17 = 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:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @RepeatedRewrite(%H.loc11_29.2: %E_where.type) {
|
|
// CHECK:STDOUT: %H.patt.loc11_29.2: %pattern_type.b17 = 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>
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @OneRewrite(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_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_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_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.c00382.2
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @OneRewrite(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: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- rewrites_reordered.carbon = $rewrites_reordered
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete]
|
|
// CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete]
|
|
// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.WithSelf.%K [concrete]
|
|
// CHECK:STDOUT: %assoc1: %J.assoc_type = assoc_entity element1, @J.WithSelf.%L [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen.e58: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.99c: %J.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %.Self.frozen.as_type: type = facet_access_type %.Self.frozen.99c [symbolic_self]
|
|
// CHECK:STDOUT: %J.lookup_impl_witness.cb1: <witness> = lookup_impl_witness %.Self.frozen.99c, @J [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.221: type = impl_witness_access %J.lookup_impl_witness.cb1, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %impl.elem1.eed: type = impl_witness_access %J.lookup_impl_witness.cb1, element1 [symbolic_self]
|
|
// CHECK:STDOUT: %.Self: %J.type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %J.lookup_impl_witness.df8: <witness> = lookup_impl_witness %.Self, @J [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem0.bbd: type = impl_witness_access %J.lookup_impl_witness.df8, element0 [symbolic_self]
|
|
// CHECK:STDOUT: %impl.elem1.fb5: type = impl_witness_access %J.lookup_impl_witness.df8, element1 [symbolic_self]
|
|
// CHECK:STDOUT: %J_where.type: type = facet_type <@J where %impl.elem0.bbd = %empty_tuple.type and %impl.elem1.fb5 = bool> [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %J_where.type [concrete]
|
|
// CHECK:STDOUT: %M.patt: %pattern_type = symbolic_binding_pattern M, 0 [symbolic]
|
|
// CHECK:STDOUT: %M: %J_where.type = symbolic_binding M, 0 [symbolic]
|
|
// CHECK:STDOUT: %Alphabetical.type: type = fn_type @Alphabetical [concrete]
|
|
// CHECK:STDOUT: %Alphabetical: %Alphabetical.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %N.patt: %pattern_type = symbolic_binding_pattern N, 0 [symbolic]
|
|
// CHECK:STDOUT: %N: %J_where.type = symbolic_binding N, 0 [symbolic]
|
|
// CHECK:STDOUT: %Reversed.type: type = fn_type @Reversed [concrete]
|
|
// CHECK:STDOUT: %Reversed: %Reversed.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: %Alphabetical.decl: %Alphabetical.type = fn_decl @Alphabetical [concrete = constants.%Alphabetical] {
|
|
// 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_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.e58]
|
|
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
|
|
// 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_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_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_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_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_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_22.1: %pattern_type = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc12_22.2 (constants.%N.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// 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.e58]
|
|
// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type]
|
|
// 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_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_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_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_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_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_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:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// 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>
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: <elided>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Alphabetical(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_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_33.2 => constants.%M.patt
|
|
// CHECK:STDOUT: %M.loc10_33.1 => constants.%N
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|