mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-23 20:12:38 +00:00
Diagnostic rendering was part of the data model: `Loc::FormatLocation` and `Loc::FormatSnippet` wrote plain text to a stream, so no capability, color, or terminal width could reach them. A diagnostic is now one message with labels, contexts, and location information attached, and `Diagnostics::Renderer` draws it into a `Terminal::Buffer`. The design is in `toolchain/docs/diagnostics_rendering.md` (#7668), authoring in `toolchain/docs/diagnostics.md`. Before: ``` example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments Run0(1); ^~~~~~~ example.carbon:3:1: note: calling function declared here fn Run0() {} ^~~~~~~~~~~ ``` After: ``` error: 1 argument passed to function expecting 0 arguments ╭─┤ example.carbon:6:3 ┆ 3 │ fn Run0() {} · ─────┬───── · ╰──┤ calling function declared here ┆ -> 6 │ Run0(1); · ─────── ╰──────────── ``` `--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`. File tests use it; the rendering tests under `toolchain/diagnostics/testdata` ask for snippets. C++ interop diagnostics are data now rather than text Clang drew: `SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang location is marked as the point it names. `StreamConsumer` moves to a `:renderer` target that `:emitter` does not depend on, keeping `common/terminal` out of `consumer.h`. Capabilities come from the file behind the error stream, so tests get plain ASCII. `renderer_fuzzer` draws diagnostics built from fuzzer bytes with every capability combination, since a shape the renderer doesn't expect must never be why the compiler dies while reporting a problem. TODOs mark the follow-ups: line weights and crossing lines, wrapping that keeps a quoted type whole, and ordering diagnostics that share a byte offset. Also: `IncorrectExtension`'s hint moves into its message, since its note had no location of its own, and `strip_noise` in `check_diagnostics.py` blanks multi-line `#define`s instead of deleting them. Assisted-by: Claude Code
801 lines
46 KiB
Plaintext
801 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/int.carbon
|
|
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
|
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
|
|
//
|
|
// This is mostly checking against crashes for compile time bindings in
|
|
// difficult contexts.
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/compile_time_bindings.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/compile_time_bindings.carbon
|
|
|
|
// --- fail_let_after.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {
|
|
fn F() -> () { return x; }
|
|
// CHECK:STDERR: fail_let_after.carbon:[[@LINE+2]]:15-19: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic x: () = ();
|
|
}
|
|
|
|
// --- fail_let_before.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {
|
|
// CHECK:STDERR: fail_let_before.carbon:[[@LINE+2]]:15-19: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic x: () = ();
|
|
fn F() -> () { return x; }
|
|
}
|
|
|
|
// --- fail_multiple_lets.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {
|
|
// CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+2]]:15-19: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic a: () = ();
|
|
fn F(generic b: ((),)) {
|
|
let generic c: ((), ()) = ((), ());
|
|
|
|
var unused a1: () = a;
|
|
var unused b1: ((),) = b;
|
|
var unused c1: ((), ()) = c;
|
|
var unused d1: ((), (), ()) = d;
|
|
}
|
|
// CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE+4]]:15-29: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
// CHECK:STDERR: fail_multiple_lets.carbon:[[@LINE-9]]:17-27: error: semantics TODO: `local generic `let` bindings are currently unsupported` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic d: ((), (), ()) = ((), (), ());
|
|
}
|
|
|
|
// --- fail_invalid_let_after.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {
|
|
fn F() -> () { return x; }
|
|
// CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+4]]:15-19: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
// CHECK:STDERR: fail_invalid_let_after.carbon:[[@LINE+2]]:20: error: expected `=`; `let` declaration must have an initializer [ExpectedInitializerAfterLet]
|
|
// CHECK:STDERR:
|
|
let generic x: ();
|
|
}
|
|
|
|
// --- fail_todo_use_in_function.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn F() -> i32 {
|
|
// CHECK:STDERR: fail_todo_use_in_function.carbon:[[@LINE+2]]:15-23: error: semantics TODO: `local generic `let` bindings are currently unsupported` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic Zero: i32 = 0;
|
|
return Zero;
|
|
}
|
|
|
|
// --- fail_todo_use_in_block.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
fn F() -> i32 {
|
|
if (true) {
|
|
// CHECK:STDERR: fail_todo_use_in_block.carbon:[[@LINE+2]]:17-25: error: semantics TODO: `local generic `let` bindings are currently unsupported` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic Zero: i32 = 0;
|
|
return Zero;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
// --- return_in_interface.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface I {
|
|
let T: type = i32;
|
|
fn F() -> T;
|
|
}
|
|
|
|
// --- fail_return_in_class.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class I {
|
|
// CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+2]]:15-21: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic T: type = i32;
|
|
// CHECK:STDERR: fail_return_in_class.carbon:[[@LINE+2]]:13: error: cannot evaluate type expression [TypeExprEvaluationFailure]
|
|
// CHECK:STDERR:
|
|
fn F() -> T;
|
|
}
|
|
|
|
// --- fail_return_in_package_scope.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
// CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+2]]:13-19: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic T: type = i32;
|
|
// CHECK:STDERR: fail_return_in_package_scope.carbon:[[@LINE+2]]:11: error: cannot evaluate type expression [TypeExprEvaluationFailure]
|
|
// CHECK:STDERR:
|
|
fn F() -> T;
|
|
|
|
// --- fail_use_in_impl.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
interface Empty {}
|
|
|
|
impl i32 as Empty {
|
|
// CHECK:STDERR: fail_use_in_impl.carbon:[[@LINE+2]]:15-23: error: semantics TODO: ``let` compile time binding outside function or interface` [SemanticsTodo]
|
|
// CHECK:STDERR:
|
|
let generic Zero: i32 = 0;
|
|
}
|
|
|
|
// CHECK:STDOUT: --- fail_let_after.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .C = %C.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C {
|
|
// CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] {
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc5_14.2 [concrete = constants.%return.patt]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc5_14.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc5_14.3: Core.Form = init_form %.loc5_14.2 [concrete = constants.%.262]
|
|
// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
|
|
// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc8_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc8_24.2: %empty_tuple.type = converted %.loc8_24.1, %empty_tuple [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc8_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc8_19.3: type = converted %.loc8_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: %empty_tuple.type = wrapper_binding x, %.loc8_24.2
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete = constants.%x.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: .F = %C.F.decl
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F() -> out %return.param: %empty_tuple.type {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, @C.%x
|
|
// CHECK:STDOUT: %.loc5_25: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc5_26: init %empty_tuple.type = converted %x.ref, %.loc5_25 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: return %.loc5_26
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_let_before.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .C = %C.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C {
|
|
// CHECK:STDOUT: %.loc7_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc7_24.2: %empty_tuple.type = converted %.loc7_24.1, %empty_tuple [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc7_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: %empty_tuple.type = wrapper_binding x, %.loc7_24.2
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete = constants.%x.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] {
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc8_14.2 [concrete = constants.%return.patt]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc8_14.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc8_14.2: type = converted %.loc8_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc8_14.3: Core.Form = init_form %.loc8_14.2 [concrete = constants.%.262]
|
|
// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
|
|
// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: .F = %C.F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F() -> out %return.param: %empty_tuple.type {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, @C.%x
|
|
// CHECK:STDOUT: %.loc8_25: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc8_26: init %empty_tuple.type = converted %x.ref, %.loc8_25 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: return %.loc8_26
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_multiple_lets.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.cb1 = value_binding_pattern a [concrete]
|
|
// CHECK:STDOUT: %tuple.type.9fb: type = tuple_type (%empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: %tuple.f41: %tuple.type.9fb = tuple_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %pattern_type.559: type = pattern_type %tuple.type.9fb [concrete]
|
|
// CHECK:STDOUT: %b.patt: %pattern_type.559 = symbolic_binding_pattern b, 0 [symbolic]
|
|
// CHECK:STDOUT: %b: %tuple.type.9fb = symbolic_binding b, 0 [symbolic]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %tuple.type.2d5: type = tuple_type (%empty_tuple.type, %empty_tuple.type, %empty_tuple.type) [concrete]
|
|
// CHECK:STDOUT: %tuple.7e4: %tuple.type.2d5 = tuple_value (%empty_tuple, %empty_tuple, %empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %pattern_type.8c1: type = pattern_type %tuple.type.2d5 [concrete]
|
|
// CHECK:STDOUT: %d.patt: %pattern_type.8c1 = value_binding_pattern d [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C {
|
|
// CHECK:STDOUT: %.loc7_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %empty_tuple.loc7: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc7_24.2: %empty_tuple.type = converted %.loc7_24.1, %empty_tuple.loc7 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc7_19.1: type = splice_block %.loc7_19.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.Self.frozen.loc7: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc7_19.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc7_19.3: type = converted %.loc7_19.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %a: %empty_tuple.type = wrapper_binding a, %.loc7_24.2
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.cb1 = value_binding_pattern a [concrete = constants.%a.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] {
|
|
// CHECK:STDOUT: %b.patt.loc8_17.1: %pattern_type.559 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc8_17.2 (constants.%b.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc8_23.1: type = splice_block %.loc8_23.4 [concrete = constants.%tuple.type.9fb] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc8_21: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc8_23.2: %tuple.type.9fb = tuple_literal (%.loc8_21) [concrete = constants.%tuple.f41]
|
|
// CHECK:STDOUT: %.loc8_23.3: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc8_23.4: type = converted %.loc8_23.2, constants.%tuple.type.9fb [concrete = constants.%tuple.type.9fb]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %b.loc8_17.2: %tuple.type.9fb = symbolic_binding b, 0 [symbolic = %b.loc8_17.1 (constants.%b)]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc20_35: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_39: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_43: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_44.1: %tuple.type.2d5 = tuple_literal (%.loc20_35, %.loc20_39, %.loc20_43) [concrete = constants.%tuple.7e4]
|
|
// CHECK:STDOUT: %empty_tuple.loc20_35: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_44.2: %empty_tuple.type = converted %.loc20_35, %empty_tuple.loc20_35 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %empty_tuple.loc20_39: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_44.3: %empty_tuple.type = converted %.loc20_39, %empty_tuple.loc20_39 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %empty_tuple.loc20_43: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_44.4: %empty_tuple.type = converted %.loc20_43, %empty_tuple.loc20_43 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %tuple: %tuple.type.2d5 = tuple_value (%.loc20_44.2, %.loc20_44.3, %.loc20_44.4) [concrete = constants.%tuple.7e4]
|
|
// CHECK:STDOUT: %.loc20_44.5: %tuple.type.2d5 = converted %.loc20_44.1, %tuple [concrete = constants.%tuple.7e4]
|
|
// CHECK:STDOUT: %.loc20_29.1: type = splice_block %.loc20_29.6 [concrete = constants.%tuple.type.2d5] {
|
|
// CHECK:STDOUT: %.Self.frozen.loc20: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc20_20: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_24: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_28: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc20_29.2: %tuple.type.2d5 = tuple_literal (%.loc20_20, %.loc20_24, %.loc20_28) [concrete = constants.%tuple.7e4]
|
|
// CHECK:STDOUT: %.loc20_29.3: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc20_29.4: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc20_29.5: type = converted constants.%empty_tuple, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc20_29.6: type = converted %.loc20_29.2, constants.%tuple.type.2d5 [concrete = constants.%tuple.type.2d5]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %d: %tuple.type.2d5 = wrapper_binding d, %.loc20_44.5
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %d.patt: %pattern_type.8c1 = value_binding_pattern d [concrete = constants.%d.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: .a = %a
|
|
// CHECK:STDOUT: .F = %C.F.decl
|
|
// CHECK:STDOUT: .d = %d
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @C.F(%b.loc8_17.2: %tuple.type.9fb) {
|
|
// CHECK:STDOUT: %b.patt.loc8_17.2: %pattern_type.559 = symbolic_binding_pattern b, 0 [symbolic = %b.patt.loc8_17.2 (constants.%b.patt)]
|
|
// CHECK:STDOUT: %b.loc8_17.1: %tuple.type.9fb = symbolic_binding b, 0 [symbolic = %b.loc8_17.1 (constants.%b)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn();
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @C.F(constants.%b) {
|
|
// CHECK:STDOUT: %b.patt.loc8_17.2 => constants.%b.patt
|
|
// CHECK:STDOUT: %b.loc8_17.1 => constants.%b
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_invalid_let_after.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .C = %C.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C {
|
|
// CHECK:STDOUT: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] {
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type = out_param_pattern [concrete = constants.%return.param_patt]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc5_14.2 [concrete = constants.%return.patt]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %.loc5_14.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc5_14.2: type = converted %.loc5_14.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: %.loc5_14.3: Core.Form = init_form %.loc5_14.2 [concrete = constants.%.262]
|
|
// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param0
|
|
// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = value_binding_pattern x [concrete = constants.%x.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: .F = %C.F.decl
|
|
// CHECK:STDOUT: .x = <unexpected>.inst{{[0-9A-F]+}}.loc10_16
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F() -> out %return.param: %empty_tuple.type {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %x.ref: %empty_tuple.type = name_ref x, <unexpected>.inst{{[0-9A-F]+}}.loc10_16
|
|
// CHECK:STDOUT: %.loc5_25: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc5_26: init %empty_tuple.type = converted %x.ref, %.loc5_25 [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: return %.loc5_26
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_use_in_function.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F() -> out %return.param: %i32;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_use_in_block.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F() -> out %return.param: %i32;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- return_in_interface.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete]
|
|
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %Int.type: type = parameterized_class_name_type @Int [concrete]
|
|
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic]
|
|
// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic]
|
|
// CHECK:STDOUT: %.157: Core.Form = init_form %impl.elem0 [symbolic]
|
|
// CHECK:STDOUT: %pattern_type.0a2: type = pattern_type %impl.elem0 [symbolic]
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.0a2 = out_param_pattern [symbolic]
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.0a2 = return_slot_pattern %return.param_patt, %impl.elem0 [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.F.type: type = fn_type @I.WithSelf.F, @I.WithSelf(%Self) [symbolic]
|
|
// CHECK:STDOUT: %I.WithSelf.F: %I.WithSelf.F.type = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, @I.WithSelf.%I.WithSelf.F.decl [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: .Int = %Core.Int
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .I = %I.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @I {
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT: %I.WithSelf.decl = interface_with_self_decl @I [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !with Self:
|
|
// CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] {
|
|
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.WithSelf.%T [concrete = constants.%assoc0]
|
|
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %I.WithSelf.F.decl: @I.WithSelf.%I.WithSelf.F.type (%I.WithSelf.F.type) = fn_decl @I.WithSelf.F [symbolic = @I.WithSelf.%I.WithSelf.F (constants.%I.WithSelf.F)] {
|
|
// CHECK:STDOUT: %return.param_patt.loc6_13.1: @I.WithSelf.F.%pattern_type (%pattern_type.0a2) = out_param_pattern [symbolic = %return.param_patt.loc6_13.2 (constants.%return.param_patt)]
|
|
// CHECK:STDOUT: %return.patt.loc6_10.1: @I.WithSelf.F.%pattern_type (%pattern_type.0a2) = return_slot_pattern %return.param_patt.loc6_13.1, %T.ref [symbolic = %return.patt.loc6_10.2 (constants.%return.patt)]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %impl.elem0.loc6_13.2: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_13.1 (constants.%impl.elem0)]
|
|
// CHECK:STDOUT: %T.ref: type = name_ref T, %impl.elem0.loc6_13.2 [symbolic = %impl.elem0.loc6_13.1 (constants.%impl.elem0)]
|
|
// CHECK:STDOUT: %.loc6_13.2: Core.Form = init_form %T.ref [symbolic = %.loc6_13.1 (constants.%.157)]
|
|
// CHECK:STDOUT: %return.param: ref @I.WithSelf.F.%impl.elem0.loc6_13.1 (%impl.elem0) = out_param call_param0
|
|
// CHECK:STDOUT: %return: ref @I.WithSelf.F.%impl.elem0.loc6_13.1 (%impl.elem0) = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %assoc1: %I.assoc_type = assoc_entity element1, %I.WithSelf.F.decl [concrete = constants.%assoc1]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: .T = @T.%assoc0
|
|
// CHECK:STDOUT: .F = @I.WithSelf.%assoc1
|
|
// CHECK:STDOUT: witness = (@I.WithSelf.%T, @I.WithSelf.%I.WithSelf.F.decl)
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: generic fn @I.WithSelf.F(@I.%Self: %I.type) {
|
|
// CHECK:STDOUT: %Self: %I.type = symbolic_binding Self, 0 [symbolic = %Self (constants.%Self)]
|
|
// CHECK:STDOUT: %I.lookup_impl_witness: <witness> = lookup_impl_witness %Self, @I [symbolic = %I.lookup_impl_witness (constants.%I.lookup_impl_witness)]
|
|
// CHECK:STDOUT: %impl.elem0.loc6_13.1: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc6_13.1 (constants.%impl.elem0)]
|
|
// CHECK:STDOUT: %.loc6_13.1: Core.Form = init_form %impl.elem0.loc6_13.1 [symbolic = %.loc6_13.1 (constants.%.157)]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %impl.elem0.loc6_13.1 [symbolic = %pattern_type (constants.%pattern_type.0a2)]
|
|
// CHECK:STDOUT: %return.param_patt.loc6_13.2: @I.WithSelf.F.%pattern_type (%pattern_type.0a2) = out_param_pattern [symbolic = %return.param_patt.loc6_13.2 (constants.%return.param_patt)]
|
|
// CHECK:STDOUT: %return.patt.loc6_10.2: @I.WithSelf.F.%pattern_type (%pattern_type.0a2) = return_slot_pattern %return.param_patt.loc6_13.2, %impl.elem0.loc6_13.1 [symbolic = %return.patt.loc6_10.2 (constants.%return.patt)]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn() -> out %return.param: @I.WithSelf.F.%impl.elem0.loc6_13.1 (%impl.elem0);
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf(constants.%Self) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @I.WithSelf.F(constants.%Self) {
|
|
// CHECK:STDOUT: %Self => constants.%Self
|
|
// CHECK:STDOUT: %I.lookup_impl_witness => constants.%I.lookup_impl_witness
|
|
// CHECK:STDOUT: %impl.elem0.loc6_13.1 => constants.%impl.elem0
|
|
// CHECK:STDOUT: %.loc6_13.1 => constants.%.157
|
|
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.0a2
|
|
// CHECK:STDOUT: %return.param_patt.loc6_13.2 => constants.%return.param_patt
|
|
// CHECK:STDOUT: %return.patt.loc6_10.2 => constants.%return.patt
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_return_in_class.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %I: type = class_type @I [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
|
|
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = value_binding_pattern T [concrete]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %Int.type: type = parameterized_class_name_type @Int [concrete]
|
|
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: %I.F.type: type = fn_type @I.F [concrete]
|
|
// CHECK:STDOUT: %I.F: %I.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: .Int = %Core.Int
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .I = %I.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %I.decl: type = class_decl @I [concrete = constants.%I] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @I {
|
|
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
|
// CHECK:STDOUT: %.loc7_18.1: type = splice_block %.loc7_18.2 [concrete = type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc7_18.2: type = type_literal type [concrete = type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %T: type = wrapper_binding T, %i32
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = value_binding_pattern T [concrete = constants.%T.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %I.F.decl: %I.F.type = fn_decl @I.F [concrete = constants.%I.F] {
|
|
// CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %T.ref: type = name_ref T, @I.%T
|
|
// CHECK:STDOUT: %return: <error> = return_slot <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type.357]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%I
|
|
// CHECK:STDOUT: .T = %T
|
|
// CHECK:STDOUT: .F = %I.F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @I.F() -> <error>;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_return_in_package_scope.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %pattern_type.9a5: type = pattern_type type [concrete]
|
|
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = value_binding_pattern T [concrete]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %Int.type: type = parameterized_class_name_type @Int [concrete]
|
|
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: .Int = %Core.Int
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .T = %T
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %.loc6_16.1: type = splice_block %.loc6_16.2 [concrete = type] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %.loc6_16.2: type = type_literal type [concrete = type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %T: type = wrapper_binding T, @__global_init.%i32
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = value_binding_pattern T [concrete = constants.%T.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %return.patt: <error> = return_slot_pattern <error>, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %T.ref: type = name_ref T, file.%T
|
|
// CHECK:STDOUT: %return: <error> = return_slot <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F() -> <error>;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_use_in_impl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Empty.type: type = facet_type <@Empty> [concrete]
|
|
// CHECK:STDOUT: %Self.d44: %Empty.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
// CHECK:STDOUT: %Int.type: type = parameterized_class_name_type @Int [concrete]
|
|
// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
// CHECK:STDOUT: %.2dc: <witness> = impl_self_witness %i32, @Empty [concrete]
|
|
// CHECK:STDOUT: %Empty.impl_witness: <witness> = impl_witness @i32.as.Empty.impl.%Empty.impl_witness_table [concrete]
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self]
|
|
// CHECK:STDOUT: %pattern_type.d94: type = pattern_type %i32 [concrete]
|
|
// CHECK:STDOUT: %Zero.patt: %pattern_type.d94 = value_binding_pattern Zero [concrete]
|
|
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
|
|
// CHECK:STDOUT: %ImplicitAs.type.0ff: type = generic_interface_type @ImplicitAs [concrete]
|
|
// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.0ff = struct_value () [concrete]
|
|
// CHECK:STDOUT: %ImplicitAs.type.6b0: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
|
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.6f2: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6 = struct_value () [symbolic]
|
|
// CHECK:STDOUT: %ImplicitAs.impl_witness.d73: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.f53, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.766: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%int_32) [concrete]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.766 = struct_value () [concrete]
|
|
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.6b0 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.d73) [concrete]
|
|
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.58f: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%i32, %ImplicitAs.facet) [concrete]
|
|
// CHECK:STDOUT: %.33a: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.58f, %ImplicitAs.facet [concrete]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.bound: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60 [concrete]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.ImplicitAs.impl.Convert.f60, @Core.IntLiteral.as.ImplicitAs.impl.Convert(%int_32) [concrete]
|
|
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0.5c6, %Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn [concrete]
|
|
// CHECK:STDOUT: %int_0.753: %i32 = int_value 0 [concrete]
|
|
// CHECK:STDOUT: %Empty.facet: %Empty.type = facet_value %i32, (%Empty.impl_witness) [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
// CHECK:STDOUT: .Int = %Core.Int
|
|
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
|
// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.0ff = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
|
// CHECK:STDOUT: %Core.import_ref.e47: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.3c6) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.6f2)]
|
|
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.f53 = impl_witness_table (%Core.import_ref.e47), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Empty = %Empty.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [concrete = constants.%Empty.type] {} {}
|
|
// CHECK:STDOUT: impl_decl @i32.as.Empty.impl [concrete] {} {
|
|
// CHECK:STDOUT: %i32.loc6: type = type_literal constants.%i32 [concrete = constants.%i32]
|
|
// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc6: <witness> = impl_self_witness @i32.as.Empty.impl.%i32.loc6, @Empty [concrete = constants.%.2dc]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Empty {
|
|
// CHECK:STDOUT: %Self: %Empty.type = symbolic_binding Self, 0 [symbolic = constants.%Self.d44]
|
|
// CHECK:STDOUT: %Empty.WithSelf.decl = interface_with_self_decl @Empty [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: impl @i32.as.Empty.impl: %i32.loc6 as %Empty.ref {
|
|
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
|
// CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
|
// CHECK:STDOUT: %bound_method.loc9_27.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
|
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
// CHECK:STDOUT: %bound_method.loc9_27.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
|
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc9_27.2(%int_0) [concrete = constants.%int_0.753]
|
|
// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
|
// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_0, %.loc9_27.1 [concrete = constants.%int_0.753]
|
|
// CHECK:STDOUT: %.loc9_21: type = splice_block %i32.loc9 [concrete = constants.%i32] {
|
|
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
|
// CHECK:STDOUT: %i32.loc9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Zero: %i32 = wrapper_binding Zero, %.loc9_27.2
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %Zero.patt: %pattern_type.d94 = value_binding_pattern Zero [concrete = constants.%Zero.patt]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Empty.impl_witness_table = impl_witness_table (), @i32.as.Empty.impl [concrete]
|
|
// CHECK:STDOUT: %Empty.impl_witness: <witness> = impl_witness %Empty.impl_witness_table [concrete = constants.%Empty.impl_witness]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Zero = %Zero
|
|
// CHECK:STDOUT: extend %Empty.ref
|
|
// CHECK:STDOUT: witness = %Empty.impl_witness
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Empty.WithSelf(constants.%Self.d44) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Empty.WithSelf(constants.%Empty.facet) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|