mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-22 07:32:38 +00:00
Render diagnostics through the terminal library (#7683)
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
This commit is contained in:
1 parent
e1c8c1f855
commit
2c9739799b
1205 files changed
+20291
-24988
No files matched your search
@@ -45,9 +45,7 @@ class MyIntLiteral {
|
||||
adapt {};
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_bad_adapt.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.make_type_signed" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR: fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_adapt.carbon:[[@LINE+2]]:1-33: error: invalid signature for builtin function "int.make_type_signed" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR:
|
||||
fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
|
||||
|
||||
@@ -289,10 +287,10 @@ fn Int(N: MyIntLiteral) -> type = "int.make_type_signed";
|
||||
// CHECK:STDOUT: %N.param_patt: %pattern_type.129 = value_param_pattern [concrete = constants.%N.param_patt]
|
||||
// CHECK:STDOUT: %N.patt: %pattern_type.129 = wrapper_binding_pattern N, %N.param_patt [concrete = constants.%N.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.9a5 = out_param_pattern [concrete = constants.%return.param_patt]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc12_28.1 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.9a5 = return_slot_pattern %return.param_patt, %.loc10_28.1 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc12_28.1: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc12_28.2: Core.Form = init_form %.loc12_28.1 [concrete = constants.%.576]
|
||||
// CHECK:STDOUT: %.loc10_28.1: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc10_28.2: Core.Form = init_form %.loc10_28.1 [concrete = constants.%.576]
|
||||
// CHECK:STDOUT: %N.param: %MyIntLiteral = value_param call_param0
|
||||
// CHECK:STDOUT: %MyIntLiteral.ref: type = name_ref MyIntLiteral, file.%MyIntLiteral.decl [concrete = constants.%MyIntLiteral]
|
||||
// CHECK:STDOUT: %N: %MyIntLiteral = wrapper_binding N, %N.param
|
||||
|
||||
+66
-78
@@ -13,32 +13,20 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_redefined.carbon
|
||||
|
||||
fn A(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn A` [RedeclRedef]
|
||||
// CHECK:STDERR: fn A(n: i32, unused m: i32) -> i32 { return n; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR: fn A(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+3]]:1-36: error: redefinition of `fn A` [RedeclRedef]
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE-2]]:1-29: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn A(n: i32, unused m: i32) -> i32 { return n; }
|
||||
|
||||
fn B(n: i32, unused m: i32) -> i32 { return n; }
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn B` [RedeclRedef]
|
||||
// CHECK:STDERR: fn B(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR: fn B(n: i32, unused m: i32) -> i32 { return n; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+3]]:1-29: error: redefinition of `fn B` [RedeclRedef]
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE-2]]:1-36: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn B(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
|
||||
fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+7]]:1: error: redefinition of `fn C` [RedeclRedef]
|
||||
// CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR: fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE+3]]:1-29: error: redefinition of `fn C` [RedeclRedef]
|
||||
// CHECK:STDERR: fail_redefined.carbon:[[@LINE-2]]:1-29: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
|
||||
@@ -61,7 +49,7 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: %return.patt.6fa: %pattern_type.d94 = return_slot_pattern %return.param_patt.299, %i32 [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.1: type = fn_type @A.loc15 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.1: %A.type.9f4a6d.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc23 [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc19 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.2: %A.type.9f4a6d.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.a1d: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
|
||||
@@ -73,13 +61,13 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.f76: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %.2b9: type = fn_type_with_self_type %Copy.WithSelf.Op.type.f76, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.cae, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %B.type.573c71.1: type = fn_type @B.loc25 [concrete]
|
||||
// CHECK:STDOUT: %B.type.573c71.1: type = fn_type @B.loc21 [concrete]
|
||||
// CHECK:STDOUT: %B.08ed21.1: %B.type.573c71.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %B.type.573c71.2: type = fn_type @B.loc33 [concrete]
|
||||
// CHECK:STDOUT: %B.type.573c71.2: type = fn_type @B.loc25 [concrete]
|
||||
// CHECK:STDOUT: %B.08ed21.2: %B.type.573c71.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.1: type = fn_type @C.loc35 [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.1: type = fn_type @C.loc27 [concrete]
|
||||
// CHECK:STDOUT: %C.010386.1: %C.type.322e3b.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.2: type = fn_type @C.loc43 [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.2: type = fn_type @C.loc31 [concrete]
|
||||
// CHECK:STDOUT: %C.010386.2: %C.type.322e3b.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -100,8 +88,8 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .A = %A.decl.loc15
|
||||
// CHECK:STDOUT: .B = %B.decl.loc25
|
||||
// CHECK:STDOUT: .C = %C.decl.loc35
|
||||
// CHECK:STDOUT: .B = %B.decl.loc21
|
||||
// CHECK:STDOUT: .C = %C.decl.loc27
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %A.decl.loc15: %A.type.9f4a6d.1 = fn_decl @A.loc15 [concrete = constants.%A.921eb9.1] {
|
||||
@@ -123,97 +111,97 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %A.decl.loc23: %A.type.9f4a6d.2 = fn_decl @A.loc23 [concrete = constants.%A.921eb9.2] {
|
||||
// CHECK:STDOUT: %A.decl.loc19: %A.type.9f4a6d.2 = fn_decl @A.loc19 [concrete = constants.%A.921eb9.2] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%m.param_patt]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.d94 = wrapper_binding_pattern m, %m.param_patt [concrete = constants.%m.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.d94 = out_param_pattern [concrete = constants.%return.param_patt.299]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc23_32 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc19_32 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc23_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc23: Core.Form = init_form %i32.loc23_32 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc19_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc19: Core.Form = init_form %i32.loc19_32 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc23_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc19_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %m.param: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc23_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc19_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %m: %i32 = wrapper_binding m, %m.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl.loc25: %B.type.573c71.1 = fn_decl @B.loc25 [concrete = constants.%B.08ed21.1] {
|
||||
// CHECK:STDOUT: %B.decl.loc21: %B.type.573c71.1 = fn_decl @B.loc21 [concrete = constants.%B.08ed21.1] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%m.param_patt]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.d94 = wrapper_binding_pattern m, %m.param_patt [concrete = constants.%m.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.d94 = out_param_pattern [concrete = constants.%return.param_patt.299]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc25_32 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc21_32 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc25_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc25: Core.Form = init_form %i32.loc25_32 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc21_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc21: Core.Form = init_form %i32.loc21_32 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc21_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %m.param: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc21_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %m: %i32 = wrapper_binding m, %m.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl.loc25: %B.type.573c71.2 = fn_decl @B.loc25 [concrete = constants.%B.08ed21.2] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%m.param_patt]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.d94 = wrapper_binding_pattern m, %m.param_patt [concrete = constants.%m.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.d94 = out_param_pattern [concrete = constants.%return.param_patt.299]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc25_25 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc25_25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc25: Core.Form = init_form %i32.loc25_25 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc25_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %m.param: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc25_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc25_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %m: %i32 = wrapper_binding m, %m.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl.loc33: %B.type.573c71.2 = fn_decl @B.loc33 [concrete = constants.%B.08ed21.2] {
|
||||
// CHECK:STDOUT: %C.decl.loc27: %C.type.322e3b.1 = fn_decl @C.loc27 [concrete = constants.%C.010386.1] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%m.param_patt]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.d94 = wrapper_binding_pattern m, %m.param_patt [concrete = constants.%m.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.d94 = out_param_pattern [concrete = constants.%return.param_patt.299]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc33_25 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc27_25 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc33_25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc33: Core.Form = init_form %i32.loc33_25 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc27_25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc27: Core.Form = init_form %i32.loc27_25 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc33_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc27_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %m.param: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc33_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc27_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %m: %i32 = wrapper_binding m, %m.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl.loc35: %C.type.322e3b.1 = fn_decl @C.loc35 [concrete = constants.%C.010386.1] {
|
||||
// CHECK:STDOUT: %C.decl.loc31: %C.type.322e3b.2 = fn_decl @C.loc31 [concrete = constants.%C.010386.2] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%m.param_patt]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.d94 = wrapper_binding_pattern m, %m.param_patt [concrete = constants.%m.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.d94 = out_param_pattern [concrete = constants.%return.param_patt.299]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc35_25 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc31_25 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc35_25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc35: Core.Form = init_form %i32.loc35_25 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc31_25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc31: Core.Form = init_form %i32.loc31_25 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc35_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc31_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %m.param: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc35_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %m: %i32 = wrapper_binding m, %m.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl.loc43: %C.type.322e3b.2 = fn_decl @C.loc43 [concrete = constants.%C.010386.2] {
|
||||
// CHECK:STDOUT: %n.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %m.param_patt: %pattern_type.d94 = value_param_pattern [concrete = constants.%m.param_patt]
|
||||
// CHECK:STDOUT: %m.patt: %pattern_type.d94 = wrapper_binding_pattern m, %m.param_patt [concrete = constants.%m.patt]
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.d94 = out_param_pattern [concrete = constants.%return.param_patt.299]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32.loc43_25 [concrete = constants.%return.patt.6fa]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32.loc43_25: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc43: Core.Form = init_form %i32.loc43_25 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc43_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %m.param: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc43_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc31_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %m: %i32 = wrapper_binding m, %m.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
@@ -222,31 +210,31 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.loc15(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.loc23(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: fn @A.loc19(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae]
|
||||
// CHECK:STDOUT: %bound_method.loc23_45.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %bound_method.loc19_45.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc23_45.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc23_45.2(%n.ref)
|
||||
// CHECK:STDOUT: %bound_method.loc19_45.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc19_45.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B.loc25(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: fn @B.loc21(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %impl.elem0: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae]
|
||||
// CHECK:STDOUT: %bound_method.loc25_45.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %bound_method.loc21_45.1: <bound method> = bound_method %n.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc25_45.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc25_45.2(%n.ref)
|
||||
// CHECK:STDOUT: %bound_method.loc21_45.2: <bound method> = bound_method %n.ref, %specific_fn
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc21_45.2(%n.ref)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B.loc33(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT: fn @B.loc25(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C.loc35(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT: fn @C.loc27(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C.loc43(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT: fn @C.loc31(%n.param: %i32, %m.param: %i32) -> out %return.param: %i32 = "int.sadd";
|
||||
// CHECK:STDOUT:
|
||||
@@ -12,9 +12,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/fail_unknown.carbon
|
||||
|
||||
// CHECK:STDERR: fail_unknown.carbon:[[@LINE+4]]:23: error: unknown builtin function name "unknown.builtin.name" [UnknownBuiltinFunctionName]
|
||||
// CHECK:STDERR: fn UnknownBuiltin() = "unknown.builtin.name";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_unknown.carbon:[[@LINE+2]]:23-44: error: unknown builtin function name "unknown.builtin.name" [UnknownBuiltinFunctionName]
|
||||
// CHECK:STDERR:
|
||||
fn UnknownBuiltin() = "unknown.builtin.name";
|
||||
|
||||
|
||||
+5
-13
@@ -14,23 +14,15 @@
|
||||
|
||||
// --- fail_positional.carbon
|
||||
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+8]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn Add -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+4]]:1-15: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR: fn Add -> i32 = "int.sadd";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+2]]:1-15: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR:
|
||||
fn Add -> i32 = "int.sadd";
|
||||
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+8]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn Mul = "int.smul";
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+4]]:1-8: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.smul" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR: fn Mul = "int.smul";
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_positional.carbon:[[@LINE+2]]:1-8: error: invalid signature for builtin function "int.smul" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR:
|
||||
fn Mul = "int.smul";
|
||||
|
||||
@@ -73,7 +65,7 @@ fn Mul = "int.smul";
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.d94 = return_slot_pattern %return.param_patt, %i32 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc10: Core.Form = init_form %i32 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %.loc6: Core.Form = init_form %i32 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -18,19 +18,11 @@ fn F(unused x: C = {}, unused y: C = {}, unused z: C = {}) {}
|
||||
fn H(unused x: C = {}, (unused y: C = {}, unused z: C = {}) = ({}, {})) {}
|
||||
|
||||
fn G() {
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE+14]]:3: error: 4 arguments passed to function expecting 3 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: F({}, {}, {}, {});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE-7]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn F(unused x: C = {}, unused y: C = {}, unused z: C = {}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE+6]]:3-19: error: 4 arguments passed to function expecting 3 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE-5]]:1-60: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE-10]]:24: error: tuple pattern expects 2 elements, but tuple literal has 3 [TuplePatternSizeDoesntMatchLiteral]
|
||||
// CHECK:STDERR: fn H(unused x: C = {}, (unused y: C = {}, unused z: C = {}) = ({}, {})) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE-13]]:24: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn H(unused x: C = {}, (unused y: C = {}, unused z: C = {}) = ({}, {})) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE-6]]:24-59: error: tuple pattern expects 2 elements, but tuple literal has 3 [TuplePatternSizeDoesntMatchLiteral]
|
||||
// CHECK:STDERR: fail_caller_too_many_arguments.carbon:[[@LINE-7]]:24-70: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
F({}, {}, {}, {});
|
||||
H({}, ({}, {}, {}));
|
||||
@@ -43,12 +35,8 @@ class C {}
|
||||
fn F(unused x: C, unused y: C = {}) {}
|
||||
|
||||
fn G() {
|
||||
// CHECK:STDERR: fail_caller_too_few_arguments.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: F();
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_caller_too_few_arguments.carbon:[[@LINE-6]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn F(unused x: C, unused y: C = {}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_caller_too_few_arguments.carbon:[[@LINE+3]]:3-5: error: 0 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_caller_too_few_arguments.carbon:[[@LINE-4]]:1-37: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
F();
|
||||
}
|
||||
|
||||
+4
-12
@@ -29,12 +29,8 @@ library "[[@TEST_NAME]]";
|
||||
musteval fn MustEval(unused n: i32) {}
|
||||
|
||||
fn RuntimeArg(n: i32) {
|
||||
// CHECK:STDERR: fail_no_eval_musteval.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: MustEval(n);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_eval_musteval.carbon:[[@LINE-6]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: musteval fn MustEval(unused n: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_eval_musteval.carbon:[[@LINE+3]]:3-13: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_no_eval_musteval.carbon:[[@LINE-4]]:1-37: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
MustEval(n);
|
||||
}
|
||||
@@ -61,12 +57,8 @@ musteval fn MustEval(unused n: i32) {}
|
||||
|
||||
// TODO: This should be accepted.
|
||||
musteval fn CallMustEval(n: i32) {
|
||||
// CHECK:STDERR: fail_todo_musteval_calls_musteval.carbon:[[@LINE+7]]:3: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: MustEval(n);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_musteval_calls_musteval.carbon:[[@LINE-7]]:1: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: musteval fn MustEval(unused n: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_musteval_calls_musteval.carbon:[[@LINE+3]]:3-13: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_todo_musteval_calls_musteval.carbon:[[@LINE-5]]:1-37: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
MustEval(n);
|
||||
}
|
||||
@@ -11,9 +11,7 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_not_callable.carbon
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_not_callable.carbon:[[@LINE+4]]:23: error: value of type `str` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR: var unused x: i32 = "hello"();
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_not_callable.carbon:[[@LINE+2]]:23-31: error: value of type `str` is not callable [CallToNonCallable]
|
||||
// CHECK:STDERR:
|
||||
var unused x: i32 = "hello"();
|
||||
}
|
||||
+22
-46
@@ -17,54 +17,30 @@ fn Run1(unused a: i32) {}
|
||||
fn Run2(unused a: i32, unused b: i32) {}
|
||||
|
||||
fn Main() {
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: Run0(1);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-8]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn Run0() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+3]]:3-9: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-6]]:1-11: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
Run0(1);
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 arguments passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: Run0(0, 1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-16]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn Run0() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+3]]:3-12: error: 2 arguments passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-10]]:1-11: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
Run0(0, 1);
|
||||
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: Run1();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-24]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn Run1(unused a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+3]]:3-8: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-14]]:1-24: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
Run1();
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: Run1(0, 1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-32]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn Run1(unused a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+3]]:3-12: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-18]]:1-24: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
Run1(0, 1);
|
||||
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 0 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: Run2();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-40]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn Run2(unused a: i32, unused b: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+3]]:3-8: error: 0 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-22]]:1-39: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
Run2();
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+7]]:3: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: Run2(0);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-48]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn Run2(unused a: i32, unused b: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE+3]]:3-9: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_param_count.carbon:[[@LINE-26]]:1-39: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
Run2(0);
|
||||
}
|
||||
@@ -155,18 +131,18 @@ fn Main() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Main() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Run0.ref.loc23: %Run0.type = name_ref Run0, file.%Run0.decl [concrete = constants.%Run0]
|
||||
// CHECK:STDOUT: %int_1.loc23: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Run0.ref.loc27: %Run0.type = name_ref Run0, file.%Run0.decl [concrete = constants.%Run0]
|
||||
// CHECK:STDOUT: %int_0.loc27: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Run0.ref.loc35: %Run0.type = name_ref Run0, file.%Run0.decl [concrete = constants.%Run0]
|
||||
// CHECK:STDOUT: %int_0.loc35: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %int_1.loc35: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Run1.ref.loc44: %Run1.type = name_ref Run1, file.%Run1.decl [concrete = constants.%Run1]
|
||||
// CHECK:STDOUT: %Run1.ref.loc52: %Run1.type = name_ref Run1, file.%Run1.decl [concrete = constants.%Run1]
|
||||
// CHECK:STDOUT: %int_0.loc52: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %int_1.loc52: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Run2.ref.loc61: %Run2.type = name_ref Run2, file.%Run2.decl [concrete = constants.%Run2]
|
||||
// CHECK:STDOUT: %Run2.ref.loc69: %Run2.type = name_ref Run2, file.%Run2.decl [concrete = constants.%Run2]
|
||||
// CHECK:STDOUT: %int_0.loc69: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %Run1.ref.loc32: %Run1.type = name_ref Run1, file.%Run1.decl [concrete = constants.%Run1]
|
||||
// CHECK:STDOUT: %Run1.ref.loc36: %Run1.type = name_ref Run1, file.%Run1.decl [concrete = constants.%Run1]
|
||||
// CHECK:STDOUT: %int_0.loc36: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Run2.ref.loc41: %Run2.type = name_ref Run2, file.%Run2.decl [concrete = constants.%Run2]
|
||||
// CHECK:STDOUT: %Run2.ref.loc45: %Run2.type = name_ref Run2, file.%Run2.decl [concrete = constants.%Run2]
|
||||
// CHECK:STDOUT: %int_0.loc45: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -15,15 +15,9 @@
|
||||
fn G(unused a: i32) {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+10]]:5: error: cannot implicitly convert expression of type `Core.FloatLiteral` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: G(1.0);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+7]]:5: note: type `Core.FloatLiteral` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: G(1.0);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE-9]]:13: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn G(unused a: i32) {}
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+4]]:5-7: error: cannot implicitly convert expression of type `Core.FloatLiteral` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE+3]]:5-7: note: type `Core.FloatLiteral` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_param_type.carbon:[[@LINE-5]]:13-18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
G(1.0);
|
||||
}
|
||||
@@ -87,7 +81,7 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %float: Core.FloatLiteral = float_literal_value 10e-1 [concrete = constants.%float]
|
||||
// CHECK:STDOUT: %.loc28: %i32 = converted %float, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc22: %i32 = converted %float, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %G.call: init %empty_tuple.type = call %G.ref(<error>)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -15,12 +15,8 @@
|
||||
fn Foo() -> f64 { return 1.0; }
|
||||
|
||||
fn Run() {
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `f64` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: var unused x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+4]]:3: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: var unused x: i32 = Foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+3]]:3-19: error: cannot implicitly convert expression of type `f64` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_return_type_mismatch.carbon:[[@LINE+2]]:3-19: note: type `f64` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
var unused x: i32 = Foo();
|
||||
}
|
||||
@@ -69,11 +65,11 @@ fn Run() {
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.0c5: %pattern_type.d94 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.749: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt.0c5 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc25 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc21 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc25 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc21 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc25 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc21 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -95,14 +91,14 @@ fn Run() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc25 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc21 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d94 = ref_param_pattern [concrete = constants.%self.param_patt.0c5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.749]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc25 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc21 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d94 = ref_param_pattern [concrete = constants.%self.param_patt.0c5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.749]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -147,7 +143,7 @@ fn Run() {
|
||||
// CHECK:STDOUT: %x.var: ref %i32 = var_storage %x.var_patt
|
||||
// CHECK:STDOUT: %Foo.ref: %Foo.type = name_ref Foo, file.%Foo.decl [concrete = constants.%Foo]
|
||||
// CHECK:STDOUT: %Foo.call: init %f64.761 = call %Foo.ref()
|
||||
// CHECK:STDOUT: %.loc25: %i32 = converted %Foo.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc21: %i32 = converted %Foo.call, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: assign %x.var, <error>
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %x: ref %i32 = wrapper_binding x, %x.var
|
||||
@@ -160,11 +156,11 @@ fn Run() {
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc25(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc21(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc25(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc21(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc25(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc21(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param)
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon
|
||||
|
||||
// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+4]]:6: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fn F[runtime s: ()]();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+2]]:6-18: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR:
|
||||
fn F[runtime s: ()]();
|
||||
|
||||
|
||||
+22
-66
@@ -61,30 +61,20 @@ fn F(x:? form(ref ()));
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> Core.Form;
|
||||
// CHECK:STDERR: fail_param_form_not_constant.carbon:[[@LINE+4]]:10: error: cannot evaluate form expression [FormExprEvaluationFailure]
|
||||
// CHECK:STDERR: fn G(x:? F());
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_param_form_not_constant.carbon:[[@LINE+2]]:10-12: error: cannot evaluate form expression [FormExprEvaluationFailure]
|
||||
// CHECK:STDERR:
|
||||
fn G(x:? F());
|
||||
|
||||
// --- fail_form_param_not_form.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+7]]:10: error: cannot implicitly convert expression of type `type` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: fn F(x:? i32);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+4]]:10: note: type `type` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fn F(x:? i32);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+3]]:10-12: error: cannot implicitly convert expression of type `type` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+2]]:10-12: note: type `type` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
fn F(x:? i32);
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+8]]:6: error: `ref` is only allowed on a runtime binding [ExpectedRuntimeBindingPatternAfterRef]
|
||||
// CHECK:STDERR: fn G(ref x:? i32);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+4]]:6-8: error: `ref` is only allowed on a runtime binding [ExpectedRuntimeBindingPatternAfterRef]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+4]]:11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn G(ref x:? i32);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_form_param_not_form.carbon:[[@LINE+2]]:11-12: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn G(ref x:? i32);
|
||||
|
||||
@@ -95,12 +85,8 @@ fn F(x:? form(ref i32));
|
||||
|
||||
fn G() {
|
||||
var y: i32 = 0;
|
||||
// CHECK:STDERR: fail_missing_ref_tag.carbon:[[@LINE+7]]:5: error: argument to `ref` parameter not marked with `ref` [RefParamNoRefTag]
|
||||
// CHECK:STDERR: F(y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_missing_ref_tag.carbon:[[@LINE-7]]:6: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn F(x:? form(ref i32));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_ref_tag.carbon:[[@LINE+3]]:5: error: argument to `ref` parameter not marked with `ref` [RefParamNoRefTag]
|
||||
// CHECK:STDERR: fail_missing_ref_tag.carbon:[[@LINE-5]]:6-22: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
F(y);
|
||||
}
|
||||
@@ -122,15 +108,9 @@ fn F(generic Fm: Core.Form, unused x:? Fm) {}
|
||||
|
||||
fn G() {
|
||||
var x: i32;
|
||||
// CHECK:STDERR: fail_todo_composite_generic_form.carbon:[[@LINE+10]]:3: error: cannot implicitly convert expression of type `(Core.Form, Core.Form)` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: F((form(var i32), form(ref i32)), (x, ref x));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_composite_generic_form.carbon:[[@LINE+7]]:3: note: type `(Core.Form, Core.Form)` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: F((form(var i32), form(ref i32)), (x, ref x));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_composite_generic_form.carbon:[[@LINE-10]]:14: note: initializing generic parameter `Fm` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn F(generic Fm: Core.Form, unused x:? Fm) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_composite_generic_form.carbon:[[@LINE+4]]:3-47: error: cannot implicitly convert expression of type `(Core.Form, Core.Form)` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_composite_generic_form.carbon:[[@LINE+3]]:3-47: note: type `(Core.Form, Core.Form)` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_todo_composite_generic_form.carbon:[[@LINE-6]]:14-26: note: initializing generic parameter `Fm` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
F((form(var i32), form(ref i32)), (x, ref x));
|
||||
}
|
||||
@@ -142,12 +122,8 @@ fn F[Fm: Core.Form](v:? Fm);
|
||||
|
||||
fn G() {
|
||||
var v: i32 = 0;
|
||||
// CHECK:STDERR: fail_todo_deduce_generic_form.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `Fm` [DeductionIncomplete]
|
||||
// CHECK:STDERR: F(ref v);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_deduce_generic_form.carbon:[[@LINE-7]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn F[Fm: Core.Form](v:? Fm);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_deduce_generic_form.carbon:[[@LINE+3]]:3-10: error: cannot deduce value for generic parameter `Fm` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_todo_deduce_generic_form.carbon:[[@LINE-5]]:1-28: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
F(ref v);
|
||||
}
|
||||
@@ -159,15 +135,9 @@ fn F(generic Fm: Core.Form, unused x:? Fm) {}
|
||||
|
||||
fn G() {
|
||||
var x: i32;
|
||||
// CHECK:STDERR: fail_form_generic_arg_not_form.carbon:[[@LINE+10]]:3: error: cannot implicitly convert expression of type `type` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: F(i32, x);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_form_generic_arg_not_form.carbon:[[@LINE+7]]:3: note: type `type` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: F(i32, x);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_form_generic_arg_not_form.carbon:[[@LINE-10]]:14: note: initializing generic parameter `Fm` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn F(generic Fm: Core.Form, unused x:? Fm) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_form_generic_arg_not_form.carbon:[[@LINE+4]]:3-11: error: cannot implicitly convert expression of type `type` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_form_generic_arg_not_form.carbon:[[@LINE+3]]:3-11: note: type `type` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_form_generic_arg_not_form.carbon:[[@LINE-6]]:14-26: note: initializing generic parameter `Fm` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
F(i32, x);
|
||||
}
|
||||
@@ -179,13 +149,9 @@ fn F(generic Fm: Core.Form, unused x:? Fm) {}
|
||||
|
||||
fn G() {
|
||||
var x: i32;
|
||||
// CHECK:STDERR: fail_form_generic_missing_ref_tag.carbon:[[@LINE+8]]:20: error: argument to `ref` parameter not marked with `ref` [RefParamNoRefTag]
|
||||
// CHECK:STDERR: F(form(ref i32), x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_form_generic_missing_ref_tag.carbon:[[@LINE+4]]:20: error: argument to `ref` parameter not marked with `ref` [RefParamNoRefTag]
|
||||
// CHECK:STDERR: fail_form_generic_missing_ref_tag.carbon: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fail_form_generic_missing_ref_tag.carbon:[[@LINE-8]]:36: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn F(generic Fm: Core.Form, unused x:? Fm) {}
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_form_generic_missing_ref_tag.carbon:[[@LINE-6]]:36-41: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
F(form(ref i32), x);
|
||||
}
|
||||
@@ -194,9 +160,7 @@ fn G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_local_init_form_binding.carbon:[[@LINE+4]]:7: error: semantics TODO: `support local form bindings` [SemanticsTodo]
|
||||
// CHECK:STDERR: let x:? form(var i32) = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_local_init_form_binding.carbon:[[@LINE+2]]:7-23: error: semantics TODO: `support local form bindings` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let x:? form(var i32) = 0;
|
||||
}
|
||||
@@ -207,9 +171,7 @@ library "[[@TEST_NAME]]";
|
||||
// TODO: this code should fail for a different reason, but right now we don't
|
||||
// have a way to write correct code that reaches the TODO we're exercising here.
|
||||
fn F(generic Form: Core.Form) {
|
||||
// CHECK:STDERR: fail_todo_local_symbolic_form_binding.carbon:[[@LINE+4]]:7: error: semantics TODO: `support local form bindings` [SemanticsTodo]
|
||||
// CHECK:STDERR: let y:? Form = 0;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_local_symbolic_form_binding.carbon:[[@LINE+2]]:7-14: error: semantics TODO: `support local form bindings` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let y:? Form = 0;
|
||||
}
|
||||
@@ -310,17 +272,11 @@ fn G[T: I](x: T) {
|
||||
// --- fail_return_form_not_form.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_return_form_not_form.carbon:[[@LINE+7]]:12: error: cannot implicitly convert expression of type `type` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: fn F() ->? i32;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_return_form_not_form.carbon:[[@LINE+4]]:12: note: type `type` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fn F() ->? i32;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_return_form_not_form.carbon:[[@LINE+3]]:12-14: error: cannot implicitly convert expression of type `type` to `Core.Form` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_return_form_not_form.carbon:[[@LINE+2]]:12-14: note: type `type` does not implement interface `Core.ImplicitAs(Core.Form)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
fn F() ->? i32;
|
||||
// CHECK:STDERR: fail_return_form_not_form.carbon:[[@LINE+4]]:12: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: fn F() ->? ref i32;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_return_form_not_form.carbon:[[@LINE+2]]:12-18: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR:
|
||||
fn F() ->? ref i32;
|
||||
|
||||
|
||||
+7
-21
@@ -49,12 +49,8 @@ fn F(ref x: i32);
|
||||
|
||||
fn G() {
|
||||
let y: i32 = 0;
|
||||
// CHECK:STDERR: fail_ref_not_durable_ref.carbon:[[@LINE+7]]:5: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: F(ref y);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_ref_not_durable_ref.carbon:[[@LINE-7]]:6: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn F(ref x: i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_ref_not_durable_ref.carbon:[[@LINE+3]]:5-9: error: value expression passed to reference parameter [ValueForRefParam]
|
||||
// CHECK:STDERR: fail_ref_not_durable_ref.carbon:[[@LINE-5]]:6-15: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
F(ref y);
|
||||
}
|
||||
@@ -67,12 +63,8 @@ fn F(ref x: i32);
|
||||
|
||||
fn G() {
|
||||
var y: i32 = 0;
|
||||
// CHECK:STDERR: fail_missing_ref.carbon:[[@LINE+7]]:5: error: argument to `ref` parameter not marked with `ref` [RefParamNoRefTag]
|
||||
// CHECK:STDERR: F(y);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_missing_ref.carbon:[[@LINE-7]]:6: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn F(ref x: i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_ref.carbon:[[@LINE+3]]:5: error: argument to `ref` parameter not marked with `ref` [RefParamNoRefTag]
|
||||
// CHECK:STDERR: fail_missing_ref.carbon:[[@LINE-5]]:6-15: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
F(y);
|
||||
}
|
||||
@@ -86,17 +78,11 @@ fn F(x: i32);
|
||||
fn G() {
|
||||
var y: i32 = 0;
|
||||
|
||||
// CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+4]]:27: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: var unused z: (i32,) = (ref y,);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+2]]:27-31: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR:
|
||||
var unused z: (i32,) = (ref y,);
|
||||
// CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+7]]:5: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: F(ref y);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE-13]]:6: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fn F(x: i32);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE+3]]:5-9: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: fail_unnecessary_ref.carbon:[[@LINE-9]]:6-11: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
F(ref y);
|
||||
}
|
||||
|
||||
@@ -24,9 +24,7 @@ fn Test() {
|
||||
}
|
||||
|
||||
// Intentionally include an error here so we skip dominance checking, which CHECK-fails for the above example.
|
||||
// CHECK:STDERR: fail_todo_reference_uncaptured.carbon:[[@LINE+4]]:14: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR: fn Error() { error; }
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_reference_uncaptured.carbon:[[@LINE+2]]:14-18: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
fn Error() { error; }
|
||||
|
||||
@@ -44,8 +42,6 @@ fn Test() {
|
||||
}
|
||||
|
||||
// Intentionally include an error here so we skip dominance checking, which CHECK-fails for the above example.
|
||||
// CHECK:STDERR: fail_todo_reference_uncaptured_lambda.carbon:[[@LINE+4]]:14: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR: fn Error() { error; }
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_reference_uncaptured_lambda.carbon:[[@LINE+2]]:14-18: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
fn Error() { error; }
|
||||
@@ -15,9 +15,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_value_not_constant.carbon:[[@LINE+4]]:19: error: default value is not a constant [PatternDefaultValueNotConstant]
|
||||
// CHECK:STDERR: fn H(x: C, y: C = x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_value_not_constant.carbon:[[@LINE+2]]:19: error: default value is not a constant [PatternDefaultValueNotConstant]
|
||||
// CHECK:STDERR:
|
||||
fn H(x: C, y: C = x);
|
||||
|
||||
@@ -27,12 +25,8 @@ library "[[@TEST_NAME]]";
|
||||
class C {}
|
||||
class D {}
|
||||
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:13: error: cannot implicitly convert expression of type `D` to `C` [ConversionFailure]
|
||||
// CHECK:STDERR: fn K(x: C = {} as D);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+4]]:13: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fn K(x: C = {} as D);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:13-19: error: cannot implicitly convert expression of type `D` to `C` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+2]]:13-19: note: type `D` does not implement interface `Core.ImplicitAs(C)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
fn K(x: C = {} as D);
|
||||
|
||||
@@ -41,9 +35,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_pattern_defaults_not_in_parameter_list.carbon:[[@LINE+4]]:19: error: default values are only supported in parameter lists [PatternDefaultValueNotInParameterList]
|
||||
// CHECK:STDERR: let (y: C, x: C = {}) = ({}, {});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_pattern_defaults_not_in_parameter_list.carbon:[[@LINE+2]]:19-20: error: default values are only supported in parameter lists [PatternDefaultValueNotInParameterList]
|
||||
// CHECK:STDERR:
|
||||
let (y: C, x: C = {}) = ({}, {});
|
||||
|
||||
@@ -52,22 +44,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+17]]:35: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fn Z(v: C, x: C = {}, (y: C = {}, z: C), w: C = {}, k: C);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+14]]:24: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR: fn Z(v: C, x: C = {}, (y: C = {}, z: C), w: C = {}, k: C);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+7]]:35-38: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+6]]:24-27: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+10]]:23: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fn Z(v: C, x: C = {}, (y: C = {}, z: C), w: C = {}, k: C);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+7]]:53: note: this pattern is also missing a required default value. [RequiredPatternDefaultValueMissingAdditional]
|
||||
// CHECK:STDERR: fn Z(v: C, x: C = {}, (y: C = {}, z: C), w: C = {}, k: C);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+4]]:12: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR: fn Z(v: C, x: C = {}, (y: C = {}, z: C), w: C = {}, k: C);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+4]]:23-39: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+3]]:53-56: note: this pattern is also missing a required default value. [RequiredPatternDefaultValueMissingAdditional]
|
||||
// CHECK:STDERR: fail_required_default_values_missing.carbon:[[@LINE+2]]:12-15: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR:
|
||||
fn Z(v: C, x: C = {}, (y: C = {}, z: C), w: C = {}, k: C);
|
||||
|
||||
@@ -76,19 +58,11 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+14]]:36: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fn F(a: C, (b: C = {}, (c: C = {}, (d: C, e: C))));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+11]]:25: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR: fn F(a: C, (b: C = {}, (c: C = {}, (d: C, e: C))));
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+6]]:36-47: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+5]]:25-28: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+7]]:24: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fn F(a: C, (b: C = {}, (c: C = {}, (d: C, e: C))));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+4]]:13: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR: fn F(a: C, (b: C = {}, (c: C = {}, (d: C, e: C))));
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+3]]:24-48: error: this pattern is missing a required default value. [RequiredPatternDefaultValueMissing]
|
||||
// CHECK:STDERR: fail_nesting_required_default_values_missing.carbon:[[@LINE+2]]:13-16: note: all patterns to the right of this first pattern with a default value must also specify a default value. [RequiredPatternDefaultValueFirstDefault]
|
||||
// CHECK:STDERR:
|
||||
fn F(a: C, (b: C = {}, (c: C = {}, (d: C, e: C))));
|
||||
|
||||
@@ -101,12 +75,8 @@ impl C as Core.As(D) {
|
||||
fn Convert(unused self: C) -> D { return {} as D; }
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_explicit_conversion_not_supported.carbon:[[@LINE+7]]:13: error: cannot implicitly convert expression of type `C` to `D` [ConversionFailure]
|
||||
// CHECK:STDERR: fn F(a: D = {} as C);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_explicit_conversion_not_supported.carbon:[[@LINE+4]]:13: note: type `C` does not implement interface `Core.ImplicitAs(D)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fn F(a: D = {} as C);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_explicit_conversion_not_supported.carbon:[[@LINE+3]]:13-19: error: cannot implicitly convert expression of type `C` to `D` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_explicit_conversion_not_supported.carbon:[[@LINE+2]]:13-19: note: type `C` does not implement interface `Core.ImplicitAs(D)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
fn F(a: D = {} as C);
|
||||
|
||||
|
||||
@@ -38,12 +38,8 @@ private musteval fn MustEval() -> i32 { return 0; }
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+7]]:6: error: `musteval` not allowed on declaration with `eval` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: eval musteval fn Mixed();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:1: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: eval musteval fn Mixed();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:6-13: error: `musteval` not allowed on declaration with `eval` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+2]]:1-4: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
eval musteval fn Mixed();
|
||||
|
||||
@@ -51,31 +47,19 @@ eval musteval fn Mixed();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:6: error: `export` must appear before `eval` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: eval export fn ExportEval();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+4]]:1: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: eval export fn ExportEval();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+3]]:6-11: error: `export` must appear before `eval` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+2]]:1-4: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
eval export fn ExportEval();
|
||||
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:6: error: `private` must appear before `eval` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: eval private fn PrivateEval();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+4]]:1: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: eval private fn PrivateEval();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+3]]:6-12: error: `private` must appear before `eval` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+2]]:1-4: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
eval private fn PrivateEval();
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+7]]:8: error: `virtual` must appear before `eval` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: eval virtual fn VirtualEval();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+4]]:3: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: eval virtual fn VirtualEval();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+3]]:8-14: error: `virtual` must appear before `eval` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: fail_order.carbon:[[@LINE+2]]:3-6: note: `eval` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
eval virtual fn VirtualEval();
|
||||
}
|
||||
@@ -84,15 +68,11 @@ class C {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_not_fn.carbon:[[@LINE+4]]:1: error: `eval` not allowed on `var` declaration [ModifierNotAllowedOnDeclaration]
|
||||
// CHECK:STDERR: eval var x: i32;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_not_fn.carbon:[[@LINE+2]]:1-4: error: `eval` not allowed on `var` declaration [ModifierNotAllowedOnDeclaration]
|
||||
// CHECK:STDERR:
|
||||
eval var x: i32;
|
||||
|
||||
// CHECK:STDERR: fail_not_fn.carbon:[[@LINE+4]]:1: error: `eval` not allowed on `class` declaration [ModifierNotAllowedOnDeclaration]
|
||||
// CHECK:STDERR: eval class C {};
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_not_fn.carbon:[[@LINE+2]]:1-4: error: `eval` not allowed on `class` declaration [ModifierNotAllowedOnDeclaration]
|
||||
// CHECK:STDERR:
|
||||
eval class C {};
|
||||
|
||||
@@ -117,56 +97,32 @@ eval fn EvalThenMustEval();
|
||||
musteval fn MustEvalThenNone();
|
||||
musteval fn MustEvalThenEval();
|
||||
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+7]]:1: error: function redeclaration differs because new function is `eval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: eval fn NoneThenEval() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-10]]:1: note: previously not declared as `eval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR: fn NoneThenEval();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+3]]:1-24: error: function redeclaration differs because new function is `eval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-8]]:1-18: note: previously not declared as `eval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR:
|
||||
eval fn NoneThenEval() {}
|
||||
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+7]]:1: error: function redeclaration differs because new function is `musteval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: musteval fn NoneThenMustEval() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-18]]:1: note: previously not declared as `musteval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR: fn NoneThenMustEval();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+3]]:1-32: error: function redeclaration differs because new function is `musteval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-12]]:1-22: note: previously not declared as `musteval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR:
|
||||
musteval fn NoneThenMustEval() {}
|
||||
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+7]]:1: error: function redeclaration differs because new function is not `eval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fn EvalThenNone() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-26]]:1: note: previously declared as `eval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR: eval fn EvalThenNone();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+3]]:1-19: error: function redeclaration differs because new function is not `eval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-16]]:1-23: note: previously declared as `eval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR:
|
||||
fn EvalThenNone() {}
|
||||
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+7]]:1: error: function redeclaration differs because new function is `musteval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: musteval fn EvalThenMustEval() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-34]]:1: note: previously declared as `eval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR: eval fn EvalThenMustEval();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+3]]:1-32: error: function redeclaration differs because new function is `musteval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-20]]:1-27: note: previously declared as `eval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR:
|
||||
musteval fn EvalThenMustEval() {}
|
||||
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+7]]:1: error: function redeclaration differs because new function is not `musteval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fn MustEvalThenNone() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-42]]:1: note: previously declared as `musteval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR: musteval fn MustEvalThenNone();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+3]]:1-23: error: function redeclaration differs because new function is not `musteval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-24]]:1-31: note: previously declared as `musteval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR:
|
||||
fn MustEvalThenNone() {}
|
||||
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+7]]:1: error: function redeclaration differs because new function is `eval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: eval fn MustEvalThenEval() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-50]]:1: note: previously declared as `musteval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR: musteval fn MustEvalThenEval();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE+3]]:1-28: error: function redeclaration differs because new function is `eval` [FunctionRedeclEvaluationModeDiffers]
|
||||
// CHECK:STDERR: fail_differ_in_redecl.carbon:[[@LINE-28]]:1-31: note: previously declared as `musteval` [FunctionRedeclEvaluationModePrevious]
|
||||
// CHECK:STDERR:
|
||||
eval fn MustEvalThenEval() {}
|
||||
+11
-27
@@ -29,12 +29,8 @@ var x: () = F();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+3]]:1-14: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-2]]:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
@@ -43,12 +39,8 @@ extern fn F();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE+3]]:1-7: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_redecl_extern.carbon:[[@LINE-2]]:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F();
|
||||
|
||||
@@ -57,14 +49,10 @@ fn F();
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error: `extern` not allowed; requires file or namespace scope [ModifierExternNotAllowed]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+2]]:3-8: error: `extern` not allowed; requires file or namespace scope [ModifierExternNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+4]]:3: error: `extern` not allowed; requires file or namespace scope [ModifierExternNotAllowed]
|
||||
// CHECK:STDERR: extern fn G(self);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_member_extern.carbon:[[@LINE+2]]:3-8: error: `extern` not allowed; requires file or namespace scope [ModifierExternNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
extern fn G(self);
|
||||
}
|
||||
@@ -75,13 +63,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "basic";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_in_importer.carbon:[[@LINE+8]]:1: error: cannot declare imported `fn F` as `extern library` [ExternLibraryInImporter]
|
||||
// CHECK:STDERR: extern library "basic" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_in_importer.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: basic.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_in_importer.carbon:[[@LINE+4]]:1-30: error: cannot declare imported `fn F` as `extern library` [ExternLibraryInImporter]
|
||||
// CHECK:STDERR: imported from: fail_extern_library_in_importer.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: basic.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern library "basic" fn F();
|
||||
|
||||
@@ -160,7 +144,7 @@ extern library "basic" fn F();
|
||||
// CHECK:STDOUT: .F = %F.decl.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @F();
|
||||
@@ -178,7 +162,7 @@ extern library "basic" fn F();
|
||||
// CHECK:STDOUT: .F = %F.decl.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @F();
|
||||
|
||||
@@ -32,13 +32,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+8]]:1: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_nonowner.carbon:[[@LINE+4]]:1-14: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: imported from: fail_extern_library_nonowner.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-45: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
@@ -48,13 +44,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_nonextern.carbon:[[@LINE+4]]:1-7: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_library_nonextern.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-45: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F();
|
||||
|
||||
@@ -64,13 +56,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+8]]:1: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_redecl.carbon:[[@LINE+4]]:1-45: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: imported from: fail_extern_library_redecl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-45: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern library "extern_library_owner" fn F();
|
||||
|
||||
@@ -84,14 +72,10 @@ extern library "extern_library_owner" fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_library_copy.carbon:4:1: error: duplicate name `F` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_collision.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_extern_library_collision.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_library_copy.carbon:4:1-45: error: duplicate name `F` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_extern_library_collision.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-45: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "extern_library";
|
||||
import library "extern_library_copy";
|
||||
@@ -108,13 +92,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library_mismatch"
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+8]]:1: error: `import` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE+4]]:1-6: error: `import` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE-6]]:1: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: import library "extern_library_mismatch"
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_mismatch_owner.carbon:[[@LINE-4]]:1-40: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
@@ -122,9 +102,7 @@ extern fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+4]]:1: error: `extern library` cannot specify the current library [ExternLibraryIsCurrentLibrary]
|
||||
// CHECK:STDERR: extern library "extern_self_library" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_self_library.carbon:[[@LINE+2]]:1-36: error: `extern library` cannot specify the current library [ExternLibraryIsCurrentLibrary]
|
||||
// CHECK:STDERR:
|
||||
extern library "extern_self_library" fn F();
|
||||
|
||||
@@ -140,13 +118,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_of_import";
|
||||
|
||||
// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern library "extern_of_import" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_of_import.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_of_import_redecl.carbon:[[@LINE+4]]:1-41: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_of_import_redecl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_of_import.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern library "extern_of_import" fn F();
|
||||
|
||||
@@ -154,9 +128,7 @@ extern library "extern_of_import" fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_library_on_definition.carbon:[[@LINE+4]]:1: error: a library cannot be provided for an `extern` modifier on a definition [ExternLibraryOnDefinition]
|
||||
// CHECK:STDERR: extern library "extern_library_owner" fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_library_on_definition.carbon:[[@LINE+2]]:1-37: error: a library cannot be provided for an `extern` modifier on a definition [ExternLibraryOnDefinition]
|
||||
// CHECK:STDERR:
|
||||
extern library "extern_library_owner" fn F() {}
|
||||
|
||||
|
||||
+3
-7
@@ -32,13 +32,9 @@ package Foo library "[[@TEST_NAME]]";
|
||||
|
||||
import library default;
|
||||
|
||||
// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+8]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: default.carbon:4:1: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR: extern library "expected" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+4]]:1-14: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: imported from: fail_wrong_library.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: default.carbon:4:1-33: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
|
||||
+3
-7
@@ -30,13 +30,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+8]]:1: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR: extern library default fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_library.carbon:[[@LINE+4]]:1-14: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: imported from: fail_wrong_library.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-30: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
|
||||
+41
-67
@@ -25,26 +25,14 @@ fn ReturnDUnused() -> D;
|
||||
fn ReturnDUsed() -> D;
|
||||
|
||||
fn Call() {
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: ReturnCUsed();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-12]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-11]]:18: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+4]]:3-15: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-10]]:1-8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-7]]:18-21: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
ReturnCUsed();
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+10]]:3: error: function returns incomplete type `D` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: ReturnDUsed();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-22]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class D;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-20]]:18: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnDUsed() -> D;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE+4]]:3-15: error: function returns incomplete type `D` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-14]]:1-8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:[[@LINE-10]]:18-21: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
ReturnDUsed();
|
||||
}
|
||||
@@ -58,30 +46,16 @@ library "[[@TEST_NAME]]";
|
||||
import library "incomplete_return";
|
||||
|
||||
fn CallFAndGIncomplete() {
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: ReturnCUnused();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-6]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-10]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:7:20: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnCUnused() -> C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+5]]:3-17: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: imported from: fail_use_imported.carbon:[[@LINE-4]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:4:1-8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:7:20-23: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
ReturnCUnused();
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+12]]:3: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: ReturnCUsed();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-19]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:4:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE-23]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:8:18: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: fn ReturnCUsed() -> C;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_use_imported.carbon:[[@LINE+5]]:3-15: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: imported from: fail_use_imported.carbon:[[@LINE-10]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:4:1-8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: fail_incomplete_return.carbon:8:18-21: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
ReturnCUsed();
|
||||
ReturnDUnused();
|
||||
@@ -174,7 +148,7 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: %return: ref %D = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [concrete = constants.%Call] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc37: type = class_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc25: type = class_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C;
|
||||
@@ -225,17 +199,17 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.52f: %pattern_type.a96 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.4b1: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt.52f [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc33_17.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_17.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc33_17.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19_17.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.b8e: %pattern_type.d8d = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.86b: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt.b8e [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc33_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc19_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc33_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc19_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc33_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19_17.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ReturnDUsed.type: type = fn_type @ReturnDUsed [concrete]
|
||||
// CHECK:STDOUT: %ReturnDUsed: %ReturnDUsed.type = struct_value () [concrete]
|
||||
@@ -254,34 +228,34 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//incomplete_return, loc37_10, loaded [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//incomplete_return, loc25_10, loaded [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: %Main.import_ref.54a = import_ref Main//incomplete_return, inst{{[0-9A-F]+}} [no loc], unloaded
|
||||
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc33_17.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.1 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_17.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc33_17.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19_17.1 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.a96 = ref_param_pattern [concrete = constants.%self.param_patt.52f]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.a96 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.4b1]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %empty_struct_type = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %empty_struct_type = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc33_17.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc19_17.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d8d = ref_param_pattern [concrete = constants.%self.param_patt.b8e]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86b]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %D = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %D = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc33_17.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc19_17.2 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d8d = ref_param_pattern [concrete = constants.%self.param_patt.b8e]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d8d = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.86b]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -323,17 +297,17 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT: %ReturnCUsed.ref: %ReturnCUsed.type = name_ref ReturnCUsed, imports.%Main.ReturnCUsed [concrete = constants.%ReturnCUsed]
|
||||
// CHECK:STDOUT: %ReturnCUsed.call: init <error> = call %ReturnCUsed.ref()
|
||||
// CHECK:STDOUT: %ReturnDUnused.ref: %ReturnDUnused.type = name_ref ReturnDUnused, imports.%Main.ReturnDUnused [concrete = constants.%ReturnDUnused]
|
||||
// CHECK:STDOUT: %.loc33_17.1: ref %D = temporary_storage
|
||||
// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc33_17.1 = call %ReturnDUnused.ref()
|
||||
// CHECK:STDOUT: %.loc33_17.2: ref %D = temporary %.loc33_17.1, %ReturnDUnused.call
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc33: <bound method> = bound_method %.loc33_17.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc33(%.loc33_17.2)
|
||||
// CHECK:STDOUT: %.loc19_17.1: ref %D = temporary_storage
|
||||
// CHECK:STDOUT: %ReturnDUnused.call: init %D to %.loc19_17.1 = call %ReturnDUnused.ref()
|
||||
// CHECK:STDOUT: %.loc19_17.2: ref %D = temporary %.loc19_17.1, %ReturnDUnused.call
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %.loc19_17.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_17.2)
|
||||
// CHECK:STDOUT: %ReturnDUsed.ref: %ReturnDUsed.type = name_ref ReturnDUsed, imports.%Main.ReturnDUsed [concrete = constants.%ReturnDUsed]
|
||||
// CHECK:STDOUT: %.loc34_15.1: ref %D = temporary_storage
|
||||
// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc34_15.1 = call %ReturnDUsed.ref()
|
||||
// CHECK:STDOUT: %.loc34_15.2: ref %D = temporary %.loc34_15.1, %ReturnDUsed.call
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc34: <bound method> = bound_method %.loc34_15.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc34(%.loc34_15.2)
|
||||
// CHECK:STDOUT: %.loc20_15.1: ref %D = temporary_storage
|
||||
// CHECK:STDOUT: %ReturnDUsed.call: init %D to %.loc20_15.1 = call %ReturnDUsed.ref()
|
||||
// CHECK:STDOUT: %.loc20_15.2: ref %D = temporary %.loc20_15.1, %ReturnDUsed.call
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc20: <bound method> = bound_method %.loc20_15.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc20(%.loc20_15.2)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -343,22 +317,22 @@ fn CallFAndGIncomplete() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @ReturnDUnused [from "fail_incomplete_return.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc33_17.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_17.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_17.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_17.1(%self.param: ref %empty_struct_type) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc33_17.1(%self.param: ref %empty_struct_type) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_17.1(%self.param: ref %empty_struct_type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc33_17.2(%self.param: ref %D) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc19_17.2(%self.param: ref %D) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc33_17.2(%self.param: ref %D) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19_17.2(%self.param: ref %D) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc33_17.2(%self.param: ref %D) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19_17.2(%self.param: ref %D) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param)
|
||||
|
||||
@@ -12,86 +12,48 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_modifiers.carbon
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:9: error: `protected` must appear before `default` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: default protected fn WrongOrder();
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `default` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: default protected fn WrongOrder();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+5]]:9-17: error: `protected` must appear before `default` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1-7: note: `default` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
|
||||
// CHECK:STDERR: default protected fn WrongOrder();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-7: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
|
||||
// CHECK:STDERR:
|
||||
default protected fn WrongOrder();
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:9: error: `virtual` repeated on declaration [ModifierRepeated]
|
||||
// CHECK:STDERR: virtual virtual fn DuplicateVirtual() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `virtual` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: virtual virtual fn DuplicateVirtual() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+5]]:9-15: error: `virtual` repeated on declaration [ModifierRepeated]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1-7: note: `virtual` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `virtual` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR: virtual virtual fn DuplicateVirtual() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-7: error: `virtual` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR:
|
||||
virtual virtual fn DuplicateVirtual() {}
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:9: error: `protected` not allowed on declaration with `private` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: private protected fn TwoAccess();
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `private` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: private protected fn TwoAccess();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:9-17: error: `protected` not allowed on declaration with `private` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-7: note: `private` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
private protected fn TwoAccess();
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:10: error: `virtual` not allowed on declaration with `abstract` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: abstract virtual fn ModifiersConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `abstract` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: abstract virtual fn ModifiersConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+5]]:10-16: error: `virtual` not allowed on declaration with `abstract` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1-8: note: `abstract` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `abstract` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR: abstract virtual fn ModifiersConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-8: error: `abstract` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR:
|
||||
abstract virtual fn ModifiersConflict() {}
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `base` not allowed on `fn` declaration [ModifierNotAllowedOnDeclaration]
|
||||
// CHECK:STDERR: base fn InvalidModifier();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-4: error: `base` not allowed on `fn` declaration [ModifierNotAllowedOnDeclaration]
|
||||
// CHECK:STDERR:
|
||||
base fn InvalidModifier();
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+18]]:9: error: `final` not allowed on declaration with `default` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+15]]:1: note: `default` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:9-13: error: `final` not allowed on declaration with `default` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:1-7: note: `default` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:15: error: `virtual` not allowed on declaration with `default` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+8]]:1: note: `default` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+5]]:15-21: error: `virtual` not allowed on declaration with `default` [ModifierNotAllowedWith]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1-7: note: `default` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
|
||||
// CHECK:STDERR: default final virtual fn ModifiersConflict2() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-7: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
|
||||
// CHECK:STDERR:
|
||||
default final virtual fn ModifiersConflict2() {}
|
||||
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+7]]:8: error: `private` must appear before `extern` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: extern private fn ExternOrderAndConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: note: `extern` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR: extern private fn ExternOrderAndConflict() {}
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:8-14: error: `private` must appear before `extern` [ModifierMustAppearBefore]
|
||||
// CHECK:STDERR: fail_modifiers.carbon:[[@LINE+2]]:1-6: note: `extern` previously appeared here [ModifierPrevious]
|
||||
// CHECK:STDERR:
|
||||
extern private fn ExternOrderAndConflict() {}
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_in_type.carbon
|
||||
|
||||
// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+4]]:28: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR: fn F(n: i32, a: array(i32, n)*);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_param_in_type.carbon:[[@LINE+2]]:28: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR:
|
||||
fn F(n: i32, a: array(i32, n)*);
|
||||
|
||||
@@ -55,11 +53,11 @@ fn F(n: i32, a: array(i32, n)*);
|
||||
// CHECK:STDOUT: %a.patt: <error> = wrapper_binding_pattern a, %a.param_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %n.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc19_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc17_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n: %i32 = wrapper_binding n, %n.param
|
||||
// CHECK:STDOUT: %a.param: <error> = value_param call_param1
|
||||
// CHECK:STDOUT: %.loc19: type = splice_block %ptr [concrete = <error>] {
|
||||
// CHECK:STDOUT: %i32.loc19_23: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17: type = splice_block %ptr [concrete = <error>] {
|
||||
// CHECK:STDOUT: %i32.loc17_23: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n.ref: %i32 = name_ref n, %n
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -12,12 +12,8 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_param_redecl.carbon
|
||||
|
||||
// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+7]]:14: error: duplicate name `n` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn F(n: i32, n: i32);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+4]]:6: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: fn F(n: i32, n: i32);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+3]]:14: error: duplicate name `n` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fail_param_redecl.carbon:[[@LINE+2]]:6-11: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(n: i32, n: i32);
|
||||
|
||||
@@ -52,19 +48,19 @@ fn F(n: i32, n: i32);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %n.param_patt.loc22_7: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt.loc22_7: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt.loc22_7 [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %n.param_patt.loc22_15: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt.loc22_15: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt.loc22_15 [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %n.param_patt.loc18_7: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt.loc18_7: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt.loc18_7 [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: %n.param_patt.loc18_15: %pattern_type.d94 = value_param_pattern [concrete = constants.%n.param_patt]
|
||||
// CHECK:STDOUT: %n.patt.loc18_15: %pattern_type.d94 = wrapper_binding_pattern n, %n.param_patt.loc18_15 [concrete = constants.%n.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %n.param.loc22_7: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc22_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n.loc22_7: %i32 = wrapper_binding n, %n.param.loc22_7
|
||||
// CHECK:STDOUT: %n.param.loc22_15: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc22_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n.loc22_15: %i32 = wrapper_binding n, %n.param.loc22_15
|
||||
// CHECK:STDOUT: %n.param.loc18_7: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc18_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n.loc18_7: %i32 = wrapper_binding n, %n.param.loc18_7
|
||||
// CHECK:STDOUT: %n.param.loc18_15: %i32 = value_param call_param1
|
||||
// CHECK:STDOUT: %i32.loc18_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %n.loc18_15: %i32 = wrapper_binding n, %n.param.loc18_15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%n.param.loc22_7: %i32, %n.param.loc22_15: %i32);
|
||||
// CHECK:STDOUT: fn @F(%n.param.loc18_7: %i32, %n.param.loc18_15: %i32);
|
||||
// CHECK:STDOUT:
|
||||
@@ -13,52 +13,32 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_redecl.carbon
|
||||
|
||||
fn A();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+3]]:1-7: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-2]]:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
fn B(x: ());
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn B` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn B(x: ());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn B(x: ());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+3]]:1-12: error: redeclaration of `fn B` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-2]]:1-12: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn B(x: ());
|
||||
|
||||
fn C();
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: fn C(x: ());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR: fn C();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+3]]:1-12: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-2]]:1-7: note: previously declared with parameter count of 0 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn C(x: ());
|
||||
|
||||
fn D() {}
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn D();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn D() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+3]]:1-7: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-2]]:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn D();
|
||||
|
||||
fn E() {}
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redefinition of `fn E` [RedeclRedef]
|
||||
// CHECK:STDERR: fn E() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR: fn E() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE+3]]:1-8: error: redefinition of `fn E` [RedeclRedef]
|
||||
// CHECK:STDERR: fail_redecl.carbon:[[@LINE-2]]:1-8: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn E() {}
|
||||
|
||||
@@ -75,28 +55,39 @@ fn E() {}
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = wrapper_binding_pattern x, %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: %B.type: type = fn_type @B [concrete]
|
||||
// CHECK:STDOUT: %B: %B.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.1: type = fn_type @C.loc35 [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.1: type = fn_type @C.loc27 [concrete]
|
||||
// CHECK:STDOUT: %C.010386.1: %C.type.322e3b.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.2: type = fn_type @C.loc43 [concrete]
|
||||
// CHECK:STDOUT: %C.type.322e3b.2: type = fn_type @C.loc31 [concrete]
|
||||
// CHECK:STDOUT: %C.010386.2: %C.type.322e3b.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %D.type: type = fn_type @D [concrete]
|
||||
// CHECK:STDOUT: %D: %D.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %E.type.53e05b.1: type = fn_type @E.loc55 [concrete]
|
||||
// CHECK:STDOUT: %E.type.53e05b.1: type = fn_type @E.loc39 [concrete]
|
||||
// CHECK:STDOUT: %E.3f2512.1: %E.type.53e05b.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %E.type.53e05b.2: type = fn_type @E.loc63 [concrete]
|
||||
// CHECK:STDOUT: %E.type.53e05b.2: type = fn_type @E.loc43 [concrete]
|
||||
// CHECK:STDOUT: %E.3f2512.2: %E.type.53e05b.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .A = %A.decl.loc15
|
||||
// CHECK:STDOUT: .B = %B.decl.loc25
|
||||
// CHECK:STDOUT: .C = %C.decl.loc35
|
||||
// CHECK:STDOUT: .D = %D.decl.loc45
|
||||
// CHECK:STDOUT: .E = %E.decl.loc55
|
||||
// CHECK:STDOUT: .B = %B.decl.loc21
|
||||
// CHECK:STDOUT: .C = %C.decl.loc27
|
||||
// CHECK:STDOUT: .D = %D.decl.loc33
|
||||
// CHECK:STDOUT: .E = %E.decl.loc39
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %A.decl.loc15: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc23: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc19: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %B.decl.loc21: %B.type = fn_decl @B [concrete = constants.%B] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param.loc21: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc21_10.1: type = splice_block %.loc21_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc21_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc21_10.3: type = converted %.loc21_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.loc21: %empty_tuple.type = wrapper_binding x, %x.param.loc21
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl.loc25: %B.type = fn_decl @B [concrete = constants.%B] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt]
|
||||
@@ -108,54 +99,43 @@ fn E() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.loc25: %empty_tuple.type = wrapper_binding x, %x.param.loc25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl.loc33: %B.type = fn_decl @B [concrete = constants.%B] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param.loc33: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc33_10.1: type = splice_block %.loc33_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc33_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc33_10.3: type = converted %.loc33_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.loc33: %empty_tuple.type = wrapper_binding x, %x.param.loc33
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl.loc35: %C.type.322e3b.1 = fn_decl @C.loc35 [concrete = constants.%C.010386.1] {} {}
|
||||
// CHECK:STDOUT: %C.decl.loc43: %C.type.322e3b.2 = fn_decl @C.loc43 [concrete = constants.%C.010386.2] {
|
||||
// CHECK:STDOUT: %C.decl.loc27: %C.type.322e3b.1 = fn_decl @C.loc27 [concrete = constants.%C.010386.1] {} {}
|
||||
// CHECK:STDOUT: %C.decl.loc31: %C.type.322e3b.2 = fn_decl @C.loc31 [concrete = constants.%C.010386.2] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc43_10.1: type = splice_block %.loc43_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc43_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc43_10.3: type = converted %.loc43_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc31_10.1: type = splice_block %.loc31_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc31_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc31_10.3: type = converted %.loc31_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %D.decl.loc45: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc53: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %E.decl.loc55: %E.type.53e05b.1 = fn_decl @E.loc55 [concrete = constants.%E.3f2512.1] {} {}
|
||||
// CHECK:STDOUT: %E.decl.loc63: %E.type.53e05b.2 = fn_decl @E.loc63 [concrete = constants.%E.3f2512.2] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc33: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc37: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %E.decl.loc39: %E.type.53e05b.1 = fn_decl @E.loc39 [concrete = constants.%E.3f2512.1] {} {}
|
||||
// CHECK:STDOUT: %E.decl.loc43: %E.type.53e05b.2 = fn_decl @E.loc43 [concrete = constants.%E.3f2512.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B(%x.param.loc25: %empty_tuple.type);
|
||||
// CHECK:STDOUT: fn @B(%x.param.loc21: %empty_tuple.type);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C.loc35();
|
||||
// CHECK:STDOUT: fn @C.loc27();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @C.loc43(%x.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT: fn @C.loc31(%x.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @D() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @E.loc55() {
|
||||
// CHECK:STDOUT: fn @E.loc39() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @E.loc63() {
|
||||
// CHECK:STDOUT: fn @E.loc43() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -15,18 +15,14 @@
|
||||
// --- fail_no_body.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_no_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn A;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_no_body.carbon:[[@LINE+2]]:1-5: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn A;
|
||||
|
||||
// --- fail_todo_brace_body.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn A {
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_brace_body.carbon:[[@LINE+2]]:1-6: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn A {
|
||||
}
|
||||
@@ -34,18 +30,14 @@ fn A {
|
||||
// --- fail_todo_return_type.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_return_type.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn A -> ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_return_type.carbon:[[@LINE+2]]:1-11: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn A -> ();
|
||||
|
||||
// --- fail_todo_implicit_only.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_implicit_only.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn A[] -> ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_implicit_only.carbon:[[@LINE+2]]:1-13: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn A[] -> ();
|
||||
|
||||
@@ -53,13 +45,9 @@ fn A[] -> ();
|
||||
|
||||
// TODO: We don't have parsing support for this yet.
|
||||
library "[[@TEST_NAME]]";
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+8]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn A => 0;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+4]]:1-7: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+4]]:1: error: semantics TODO: `HandleFunctionTerseDefinition` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn A => 0;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_arrow_body.carbon:[[@LINE+2]]:1-10: error: semantics TODO: `HandleFunctionTerseDefinition` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn A => 0;
|
||||
|
||||
@@ -67,13 +55,9 @@ fn A => 0;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_invalid_file_generic_regression_test.carbon:[[@LINE+8]]:13: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: var generic x: () = ();
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_invalid_file_generic_regression_test.carbon:[[@LINE+4]]:13-17: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_invalid_file_generic_regression_test.carbon:[[@LINE+4]]:19: error: found generic binding inside `var` pattern [NonRegularBindingInVarDecl]
|
||||
// CHECK:STDERR: var generic x: () = ();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_invalid_file_generic_regression_test.carbon:[[@LINE+2]]:19: error: found generic binding inside `var` pattern [NonRegularBindingInVarDecl]
|
||||
// CHECK:STDERR:
|
||||
var generic x: () = ();
|
||||
|
||||
@@ -138,11 +122,11 @@ fn A {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] {
|
||||
// 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, %.loc7_10.2 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc5_10.2 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc7_10.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc7_10.2: type = converted %.loc7_10.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc7_10.3: Core.Form = init_form %.loc7_10.2 [concrete = constants.%.262]
|
||||
// CHECK:STDOUT: %.loc5_10.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_10.2: type = converted %.loc5_10.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_10.3: Core.Form = init_form %.loc5_10.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: }
|
||||
@@ -170,11 +154,11 @@ fn A {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] {
|
||||
// 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, %.loc7_12.2 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type = return_slot_pattern %return.param_patt, %.loc5_12.2 [concrete = constants.%return.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc7_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc7_12.2: type = converted %.loc7_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc7_12.3: Core.Form = init_form %.loc7_12.2 [concrete = constants.%.262]
|
||||
// CHECK:STDOUT: %.loc5_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc5_12.2: type = converted %.loc5_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc5_12.3: Core.Form = init_form %.loc5_12.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: }
|
||||
|
||||
@@ -34,17 +34,11 @@ extern fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+12]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+6]]:1-7: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_api.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+2]]:1-7: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
@@ -58,13 +52,9 @@ fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+4]]:1-14: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn A();
|
||||
|
||||
|
||||
+163
-223
@@ -62,49 +62,29 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "api";
|
||||
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+4]]:1-14: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_api.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn A();
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn B` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-14]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:5:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+4]]:1-27: error: redeclarations of `fn B` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_api.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:5:1-20: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-23]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:6:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+4]]:1-36: error: redeclarations of `fn C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_api.carbon:[[@LINE-13]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:6:1-29: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: extern fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-32]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:7:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+4]]:1-14: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_redecl_api.carbon:[[@LINE-18]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:7:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn D();
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+8]]:1: error: redeclarations of `fn E` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE-41]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:10:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_api.carbon:[[@LINE+4]]:1-17: error: redeclarations of `fn E` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_api.carbon:[[@LINE-23]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:10:1-10: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn NS.E();
|
||||
|
||||
@@ -136,50 +116,30 @@ var e: () = NS.E();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+45]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1: error: duplicate name `A` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+41]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:4:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+25]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1-42: error: duplicate name `A` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+23]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:4:1-7: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+36]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:5:1: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+32]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:5:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+20]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:5:1-55: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+18]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:5:1-20: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+27]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:6:1: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+23]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:6:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+15]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:6:1-64: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+13]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:6:1-29: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+18]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:7:1: error: duplicate name `D` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+14]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:7:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+10]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:7:1-42: error: duplicate name `D` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+8]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:7:1-14: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:10:1: error: duplicate name `E` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:10:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:10:1-45: error: duplicate name `E` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:10:1-10: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "api";
|
||||
import library "extern_api";
|
||||
@@ -194,50 +154,30 @@ var e: () = NS.E();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+45]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:4:1: error: duplicate name `A` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+41]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+25]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:4:1-7: error: duplicate name `A` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+23]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1-42: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+36]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:5:1: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+32]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:5:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+20]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:5:1-20: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+18]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:5:1-55: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+27]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:6:1: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+23]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:6:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn C(c: (i32,)) -> {.c: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+15]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:6:1-29: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+13]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:6:1-64: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+18]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:7:1: error: duplicate name `D` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+14]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:7:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+10]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:7:1-14: error: duplicate name `D` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+8]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:7:1-42: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api.carbon:10:1: error: duplicate name `E` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_merge_reverse.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:10:1: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: extern library "redecl_extern_api" fn NS.E();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: api.carbon:10:1-10: error: duplicate name `E` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:10:1-45: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "extern_api";
|
||||
import library "api";
|
||||
@@ -764,23 +704,23 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [concrete = constants.%B] {} {
|
||||
// CHECK:STDOUT: %i32.loc23_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc23: Core.Form = init_form %i32.loc23_24 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc15_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15: Core.Form = init_form %i32.loc15_24 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %b.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc23_16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc15_16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %b: %i32 = wrapper_binding b, %b.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [concrete = constants.%C] {} {
|
||||
// CHECK:STDOUT: %i32.loc32_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc20_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: %.loc32_35: Core.Form = init_form %struct_type.c [concrete = constants.%.fc2]
|
||||
// CHECK:STDOUT: %.loc20_35: Core.Form = init_form %struct_type.c [concrete = constants.%.fc2]
|
||||
// CHECK:STDOUT: %c.param: %tuple.type.294 = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc32_21.1: type = splice_block %.loc32_21.3 [concrete = constants.%tuple.type.294] {
|
||||
// CHECK:STDOUT: %i32.loc32_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc32_21.2: %tuple.type.135 = tuple_literal (%i32.loc32_17) [concrete = constants.%tuple.f7a]
|
||||
// CHECK:STDOUT: %.loc32_21.3: type = converted %.loc32_21.2, constants.%tuple.type.294 [concrete = constants.%tuple.type.294]
|
||||
// CHECK:STDOUT: %.loc20_21.1: type = splice_block %.loc20_21.3 [concrete = constants.%tuple.type.294] {
|
||||
// CHECK:STDOUT: %i32.loc20_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc20_21.2: %tuple.type.135 = tuple_literal (%i32.loc20_17) [concrete = constants.%tuple.f7a]
|
||||
// CHECK:STDOUT: %.loc20_21.3: type = converted %.loc20_21.2, constants.%tuple.type.294 [concrete = constants.%tuple.type.294]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: %tuple.type.294 = wrapper_binding c, %c.param
|
||||
// CHECK:STDOUT: %return.param: ref %struct_type.c = out_param call_param1
|
||||
@@ -789,9 +729,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %E.decl: %E.type = fn_decl @E [concrete = constants.%E] {} {}
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var_storage %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc52_9.1: type = splice_block %.loc52_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc52_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc52_9.3: type = converted %.loc52_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc32_9.1: type = splice_block %.loc32_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc32_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc32_9.3: type = converted %.loc32_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = wrapper_binding a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -799,15 +739,15 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var_storage %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %i32.loc53: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc33: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %b: ref %i32 = wrapper_binding b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.d94 = ref_binding_pattern b [concrete = constants.%b.patt.920]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.d94 = var_pattern %b.patt [concrete = constants.%b.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var_storage %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc54: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc54: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc34: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc34: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = wrapper_binding c, %c.var [concrete = %c.var]
|
||||
@@ -816,9 +756,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.51a = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var_storage %d.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc55_9.1: type = splice_block %.loc55_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc55_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc55_9.3: type = converted %.loc55_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc35_9.1: type = splice_block %.loc35_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc35_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc35_9.3: type = converted %.loc35_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = wrapper_binding d, %d.var [concrete = %d.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -826,9 +766,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var_storage %e.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc56_9.1: type = splice_block %.loc56_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc56_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc56_9.3: type = converted %.loc56_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc36_9.1: type = splice_block %.loc36_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc36_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc36_9.3: type = converted %.loc36_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = wrapper_binding e, %e.var [concrete = %e.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -853,29 +793,29 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref()
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, file.%B.decl [concrete = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc53_16.1: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc53: <specific function> = specific_function %impl.elem0.loc53, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc53_16.2: <bound method> = bound_method %int_1.loc53, %specific_fn.loc53 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc53: init %i32 = call %bound_method.loc53_16.2(%int_1.loc53) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc53 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2)
|
||||
// CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc33: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc33_16.1: <bound method> = bound_method %int_1.loc33, %impl.elem0.loc33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc33: <specific function> = specific_function %impl.elem0.loc33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc33_16.2: <bound method> = bound_method %int_1.loc33, %specific_fn.loc33 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33: init %i32 = call %bound_method.loc33_16.2(%int_1.loc33) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc33_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc33_16.2: %i32 = converted %int_1.loc33, %.loc33_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc33_16.2)
|
||||
// CHECK:STDOUT: assign file.%b.var, %B.call
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc54_25.1: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc54: <specific function> = specific_function %impl.elem0.loc54, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc54_25.2: <bound method> = bound_method %int_1.loc54, %specific_fn.loc54 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc54: init %i32 = call %bound_method.loc54_25.2(%int_1.loc54) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc54 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc54_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc54_25.4: %tuple.type.294 = converted %.loc54_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc54_25.4)
|
||||
// CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc34_25.1: %tuple.type.985 = tuple_literal (%int_1.loc34) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc34: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc34_25.1: <bound method> = bound_method %int_1.loc34, %impl.elem0.loc34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc34: <specific function> = specific_function %impl.elem0.loc34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc34_25.2: <bound method> = bound_method %int_1.loc34, %specific_fn.loc34 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34: init %i32 = call %bound_method.loc34_25.2(%int_1.loc34) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc34_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc34_25.3: %i32 = converted %int_1.loc34, %.loc34_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc34_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc34_25.4: %tuple.type.294 = converted %.loc34_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc34_25.4)
|
||||
// CHECK:STDOUT: assign file.%c.var, %C.call
|
||||
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [concrete = constants.%D]
|
||||
// CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref()
|
||||
@@ -1202,9 +1142,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var_storage %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc52_9.1: type = splice_block %.loc52_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc52_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc52_9.3: type = converted %.loc52_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc32_9.1: type = splice_block %.loc32_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc32_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc32_9.3: type = converted %.loc32_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = wrapper_binding a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -1212,15 +1152,15 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var_storage %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %i32.loc53: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc33: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %b: ref %i32 = wrapper_binding b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.d94 = ref_binding_pattern b [concrete = constants.%b.patt.920]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.d94 = var_pattern %b.patt [concrete = constants.%b.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var_storage %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc54: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc54: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc34: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc34: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = wrapper_binding c, %c.var [concrete = %c.var]
|
||||
@@ -1229,9 +1169,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.51a = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var_storage %d.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc55_9.1: type = splice_block %.loc55_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc55_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc55_9.3: type = converted %.loc55_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc35_9.1: type = splice_block %.loc35_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc35_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc35_9.3: type = converted %.loc35_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = wrapper_binding d, %d.var [concrete = %d.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -1239,9 +1179,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var_storage %e.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc56_9.1: type = splice_block %.loc56_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc56_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc56_9.3: type = converted %.loc56_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc36_9.1: type = splice_block %.loc36_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc36_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc36_9.3: type = converted %.loc36_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = wrapper_binding e, %e.var [concrete = %e.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -1266,29 +1206,29 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref()
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [concrete = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc53_16.1: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc53: <specific function> = specific_function %impl.elem0.loc53, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc53_16.2: <bound method> = bound_method %int_1.loc53, %specific_fn.loc53 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc53: init %i32 = call %bound_method.loc53_16.2(%int_1.loc53) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc53 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2)
|
||||
// CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc33: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc33_16.1: <bound method> = bound_method %int_1.loc33, %impl.elem0.loc33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc33: <specific function> = specific_function %impl.elem0.loc33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc33_16.2: <bound method> = bound_method %int_1.loc33, %specific_fn.loc33 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33: init %i32 = call %bound_method.loc33_16.2(%int_1.loc33) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc33_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc33_16.2: %i32 = converted %int_1.loc33, %.loc33_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc33_16.2)
|
||||
// CHECK:STDOUT: assign file.%b.var, %B.call
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc54_25.1: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc54: <specific function> = specific_function %impl.elem0.loc54, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc54_25.2: <bound method> = bound_method %int_1.loc54, %specific_fn.loc54 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc54: init %i32 = call %bound_method.loc54_25.2(%int_1.loc54) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc54 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc54_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc54_25.4: %tuple.type.294 = converted %.loc54_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc54_25.4)
|
||||
// CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc34_25.1: %tuple.type.985 = tuple_literal (%int_1.loc34) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc34: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc34_25.1: <bound method> = bound_method %int_1.loc34, %impl.elem0.loc34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc34: <specific function> = specific_function %impl.elem0.loc34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc34_25.2: <bound method> = bound_method %int_1.loc34, %specific_fn.loc34 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34: init %i32 = call %bound_method.loc34_25.2(%int_1.loc34) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc34_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc34_25.3: %i32 = converted %int_1.loc34, %.loc34_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc34_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc34_25.4: %tuple.type.294 = converted %.loc34_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc34_25.4)
|
||||
// CHECK:STDOUT: assign file.%c.var, %C.call
|
||||
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%Main.D [concrete = constants.%D]
|
||||
// CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref()
|
||||
@@ -1396,9 +1336,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %a.var: ref %empty_tuple.type = var_storage %a.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc52_9.1: type = splice_block %.loc52_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc52_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc52_9.3: type = converted %.loc52_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc32_9.1: type = splice_block %.loc32_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc32_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc32_9.3: type = converted %.loc32_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %empty_tuple.type = wrapper_binding a, %a.var [concrete = %a.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -1406,15 +1346,15 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.cb1 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %i32 = var_storage %b.var_patt [concrete]
|
||||
// CHECK:STDOUT: %i32.loc53: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc33: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %b: ref %i32 = wrapper_binding b, %b.var [concrete = %b.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type.d94 = ref_binding_pattern b [concrete = constants.%b.patt.920]
|
||||
// CHECK:STDOUT: %b.var_patt: %pattern_type.d94 = var_pattern %b.patt [concrete = constants.%b.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %struct_type.c = var_storage %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc54: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc54: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc34: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc34: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c: type = struct_type {.c: %i32} [concrete = constants.%struct_type.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %struct_type.c = wrapper_binding c, %c.var [concrete = %c.var]
|
||||
@@ -1423,9 +1363,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %c.var_patt: %pattern_type.51a = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var_storage %d.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc55_9.1: type = splice_block %.loc55_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc55_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc55_9.3: type = converted %.loc55_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc35_9.1: type = splice_block %.loc35_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc35_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc35_9.3: type = converted %.loc35_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %d: ref %empty_tuple.type = wrapper_binding d, %d.var [concrete = %d.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -1433,9 +1373,9 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete = constants.%d.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e.var: ref %empty_tuple.type = var_storage %e.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc56_9.1: type = splice_block %.loc56_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc56_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc56_9.3: type = converted %.loc56_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc36_9.1: type = splice_block %.loc36_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc36_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc36_9.3: type = converted %.loc36_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %e: ref %empty_tuple.type = wrapper_binding e, %e.var [concrete = %e.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -1460,29 +1400,29 @@ import library "extern_api";
|
||||
// CHECK:STDOUT: %A.call: init %empty_tuple.type = call %A.ref()
|
||||
// CHECK:STDOUT: assign file.%a.var, %A.call
|
||||
// CHECK:STDOUT: %B.ref: %B.type = name_ref B, imports.%Main.B [concrete = constants.%B]
|
||||
// CHECK:STDOUT: %int_1.loc53: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc53: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc53_16.1: <bound method> = bound_method %int_1.loc53, %impl.elem0.loc53 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc53: <specific function> = specific_function %impl.elem0.loc53, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc53_16.2: <bound method> = bound_method %int_1.loc53, %specific_fn.loc53 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc53: init %i32 = call %bound_method.loc53_16.2(%int_1.loc53) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc53_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc53 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc53_16.2: %i32 = converted %int_1.loc53, %.loc53_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc53_16.2)
|
||||
// CHECK:STDOUT: %int_1.loc33: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc33: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc33_16.1: <bound method> = bound_method %int_1.loc33, %impl.elem0.loc33 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc33: <specific function> = specific_function %impl.elem0.loc33, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc33_16.2: <bound method> = bound_method %int_1.loc33, %specific_fn.loc33 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33: init %i32 = call %bound_method.loc33_16.2(%int_1.loc33) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc33_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc33 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc33_16.2: %i32 = converted %int_1.loc33, %.loc33_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc33_16.2)
|
||||
// CHECK:STDOUT: assign file.%b.var, %B.call
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %int_1.loc54: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc54_25.1: %tuple.type.985 = tuple_literal (%int_1.loc54) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc54: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc54_25.1: <bound method> = bound_method %int_1.loc54, %impl.elem0.loc54 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc54: <specific function> = specific_function %impl.elem0.loc54, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc54_25.2: <bound method> = bound_method %int_1.loc54, %specific_fn.loc54 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc54: init %i32 = call %bound_method.loc54_25.2(%int_1.loc54) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc54_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc54 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc54_25.3: %i32 = converted %int_1.loc54, %.loc54_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc54_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc54_25.4: %tuple.type.294 = converted %.loc54_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc54_25.4)
|
||||
// CHECK:STDOUT: %int_1.loc34: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc34_25.1: %tuple.type.985 = tuple_literal (%int_1.loc34) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc34: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc34_25.1: <bound method> = bound_method %int_1.loc34, %impl.elem0.loc34 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc34: <specific function> = specific_function %impl.elem0.loc34, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc34_25.2: <bound method> = bound_method %int_1.loc34, %specific_fn.loc34 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34: init %i32 = call %bound_method.loc34_25.2(%int_1.loc34) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc34_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc34 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc34_25.3: %i32 = converted %int_1.loc34, %.loc34_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc34_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc34_25.4: %tuple.type.294 = converted %.loc34_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc34_25.4)
|
||||
// CHECK:STDOUT: assign file.%c.var, %C.call
|
||||
// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%Main.D [concrete = constants.%D]
|
||||
// CHECK:STDOUT: %D.call: init %empty_tuple.type = call %D.ref()
|
||||
|
||||
@@ -47,15 +47,11 @@ fn F1();
|
||||
|
||||
namespace N;
|
||||
// Use `package.F1` and poison `N.F1`.
|
||||
// CHECK:STDERR: fail_declare_after_poison.carbon:[[@LINE+3]]:14: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_declare_after_poison.carbon:[[@LINE+1]]:14-15: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
alias N.F2 = F1;
|
||||
|
||||
// Failure: `N.F1` declared after it was poisoned.
|
||||
// CHECK:STDERR: fail_declare_after_poison.carbon:[[@LINE+4]]:6: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N.F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_declare_after_poison.carbon:[[@LINE+2]]:6-7: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn N.F1();
|
||||
|
||||
@@ -69,9 +65,7 @@ fn F1();
|
||||
namespace N;
|
||||
alias N.F2 = F1;
|
||||
|
||||
// CHECK:STDERR: fail_use_poison.carbon:[[@LINE+4]]:14: error: member name `F1` not found in `N` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: alias N.F3 = N.F1;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_use_poison.carbon:[[@LINE+2]]:14-17: error: member name `F1` not found in `N` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
alias N.F3 = N.F1;
|
||||
|
||||
@@ -83,15 +77,11 @@ fn F1();
|
||||
|
||||
namespace N;
|
||||
// Use `package.F1` and poison `N.F1`.
|
||||
// CHECK:STDERR: fail_use_declaration_after_poison.carbon:[[@LINE+3]]:14: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_use_declaration_after_poison.carbon:[[@LINE+1]]:14-15: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
alias N.F2 = F1;
|
||||
|
||||
// Failure: `N.F1` declared after it was poisoned.
|
||||
// CHECK:STDERR: fail_use_declaration_after_poison.carbon:[[@LINE+4]]:6: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N.F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_use_declaration_after_poison.carbon:[[@LINE+2]]:6-7: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn N.F1();
|
||||
|
||||
@@ -111,30 +101,18 @@ namespace N1.N2.N3;
|
||||
// * `N1.F1`
|
||||
// * `N1.N2.F1`
|
||||
// * `N1.N2.N3.F1`
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+3]]:21: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N1.N2.N3.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+1]]:21-22: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
alias N1.N2.N3.F2 = F1;
|
||||
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+7]]:7: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N1.F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+3]]:7-8: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE-6]]:21: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N1.N2.N3.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE-4]]:21-22: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
fn N1.F1();
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+7]]:10: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N1.N2.F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+3]]:10-11: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE-14]]:21: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N1.N2.N3.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE-8]]:21-22: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
fn N1.N2.F1();
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+4]]:13: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N1.N2.N3.F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_multiple_scopes.carbon:[[@LINE+2]]:13-14: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn N1.N2.N3.F1();
|
||||
|
||||
@@ -145,12 +123,8 @@ library "[[@TEST_NAME]]";
|
||||
fn F();
|
||||
|
||||
namespace N;
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:13: error: name `F` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N.F = F;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+4]]:9: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: alias N.F = F;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+3]]:13: error: name `F` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+2]]:9: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
alias N.F = F;
|
||||
|
||||
@@ -175,27 +149,17 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
namespace N;
|
||||
// `N.F1` poisoned when not found.
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+7]]:14: error: name `F1` not found [NameNotFound]
|
||||
// CHECK:STDERR: alias N.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+3]]:14-15: error: name `F1` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+3]]:14: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+1]]:14-15: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
alias N.F2 = F1;
|
||||
|
||||
// TODO: We should ideally only produce one diagnostic here.
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+7]]:4: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+3]]:4-5: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE-7]]:14: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias N.F2 = F1;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE-5]]:14-15: error: name `F1` used before it was declared [NameUseBeforeDecl]
|
||||
fn F1();
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+4]]:6: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn N.F1();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_when_lookup_fails.carbon:[[@LINE+2]]:6-7: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn N.F1();
|
||||
|
||||
@@ -207,14 +171,10 @@ fn F1() {
|
||||
fn F2();
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_poison_with_lexical_result.carbon:[[@LINE+3]]:16: error: name `F2` used before it was declared [NameUseBeforeDecl]
|
||||
// CHECK:STDERR: alias F3 = F2;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_with_lexical_result.carbon:[[@LINE+1]]:16-17: error: name `F2` used before it was declared [NameUseBeforeDecl]
|
||||
alias F3 = F2;
|
||||
|
||||
// CHECK:STDERR: fail_poison_with_lexical_result.carbon:[[@LINE+4]]:8: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR: fn F2();
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_poison_with_lexical_result.carbon:[[@LINE+2]]:8-9: note: declared here [NameUseBeforeDeclNote]
|
||||
// CHECK:STDERR:
|
||||
fn F2();
|
||||
}
|
||||
|
||||
+8
-20
@@ -52,17 +52,11 @@ fn C();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+12]]:1: error: redeclaration of `fn C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn C();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: decl_in_api_decl_in_impl.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn C();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+6]]:1-7: error: redeclaration of `fn C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: decl_in_api_decl_in_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR: fn C();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+2]]:1-7: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR:
|
||||
fn C();
|
||||
|
||||
@@ -76,13 +70,9 @@ fn D();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+8]]:1: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn D();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: decl_in_api_decl_and_definition_in_impl.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn D();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+4]]:1-7: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: decl_in_api_decl_and_definition_in_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn D();
|
||||
|
||||
@@ -96,8 +86,6 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR: fn E();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_only_in_impl.impl.carbon:[[@LINE+2]]:1-7: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR:
|
||||
fn E();
|
||||
@@ -33,9 +33,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: Per p5434, a return form starting with `(` is a compound form, which
|
||||
// isn't supported yet.
|
||||
// CHECK:STDERR: fail_todo_ref_return_parenthesized.carbon:[[@LINE+4]]:12: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: fn F() -> (ref i32);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_ref_return_parenthesized.carbon:[[@LINE+2]]:12-18: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> (ref i32);
|
||||
|
||||
|
||||
@@ -67,12 +67,8 @@ fn F() -> var i32 {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> val i32 {
|
||||
// CHECK:STDERR: fail_val_return_returned_var.carbon:[[@LINE+7]]:3: error: `returned var` declaration in function with non-initializing return form [ReturnedVarNotInit]
|
||||
// CHECK:STDERR: returned var v: i32 = 1;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_val_return_returned_var.carbon:[[@LINE-4]]:11: note: return form declared here [ReturnFormHereNote]
|
||||
// CHECK:STDERR: fn F() -> val i32 {
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_val_return_returned_var.carbon:[[@LINE+3]]:3-10: error: `returned var` declaration in function with non-initializing return form [ReturnedVarNotInit]
|
||||
// CHECK:STDERR: fail_val_return_returned_var.carbon:[[@LINE-2]]:11-17: note: return form declared here [ReturnFormHereNote]
|
||||
// CHECK:STDERR:
|
||||
returned var v: i32 = 1;
|
||||
return var;
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
interface I {
|
||||
// CHECK:STDERR: fail_interface.carbon:[[@LINE+4]]:10: error: interface member with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: fn F() -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_interface.carbon:[[@LINE+2]]:10-16: error: interface member with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto;
|
||||
}
|
||||
@@ -25,9 +23,7 @@ interface I {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
interface I {
|
||||
// CHECK:STDERR: fail_interface_default.carbon:[[@LINE+4]]:18: error: interface member with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: default fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_interface_default.carbon:[[@LINE+2]]:18-24: error: interface member with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
default fn F() -> auto { return 0 as i32; }
|
||||
}
|
||||
@@ -36,9 +32,7 @@ interface I {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
base class B {
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+4]]:29: error: virtual function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: virtual fn F(unused self) -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+2]]:29-35: error: virtual function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
virtual fn F(unused self) -> auto { return 0 as i32; }
|
||||
}
|
||||
@@ -47,9 +41,7 @@ base class B {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
abstract class A {
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+4]]:23: error: virtual function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: abstract fn F(self) -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_abstract.carbon:[[@LINE+2]]:23-29: error: virtual function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
abstract fn F(self) -> auto;
|
||||
}
|
||||
@@ -63,9 +55,7 @@ base class B {
|
||||
|
||||
class D {
|
||||
extend base: B;
|
||||
// CHECK:STDERR: fail_override.carbon:[[@LINE+4]]:30: error: virtual function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: override fn F(unused self) -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_override.carbon:[[@LINE+2]]:30-36: error: virtual function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
override fn F(unused self) -> auto { return 0 as i32; }
|
||||
}
|
||||
@@ -80,9 +70,7 @@ interface I {
|
||||
class C {}
|
||||
|
||||
impl C as I {
|
||||
// CHECK:STDERR: fail_todo_impl.carbon:[[@LINE+4]]:10: error: semantics TODO: `deduced return type for `impl` member` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_impl.carbon:[[@LINE+2]]:10-16: error: semantics TODO: `deduced return type for `impl` member` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
}
|
||||
@@ -13,26 +13,18 @@
|
||||
// --- fail_forward_decl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+4]]:8: error: forward declaration of function with deduced return type [DeducedReturnTypeNotDefinition]
|
||||
// CHECK:STDERR: fn F() -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_forward_decl.carbon:[[@LINE+2]]:8-14: error: forward declaration of function with deduced return type [DeducedReturnTypeNotDefinition]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto;
|
||||
|
||||
// --- fail_forward_decl_then_def.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_forward_decl_then_def.carbon:[[@LINE+4]]:8: error: forward declaration of function with deduced return type [DeducedReturnTypeNotDefinition]
|
||||
// CHECK:STDERR: fn F() -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_forward_decl_then_def.carbon:[[@LINE+2]]:8-14: error: forward declaration of function with deduced return type [DeducedReturnTypeNotDefinition]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto;
|
||||
// CHECK:STDERR: fail_forward_decl_then_def.carbon:[[@LINE+7]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_forward_decl_then_def.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_forward_decl_then_def.carbon:[[@LINE+3]]:1-16: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fail_forward_decl_then_def.carbon:[[@LINE-2]]:1-15: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
|
||||
@@ -40,12 +32,8 @@ fn F() -> auto { return 0 as i32; }
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> i32;
|
||||
// CHECK:STDERR: fail_decl_then_auto_def.carbon:[[@LINE+7]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_then_auto_def.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_then_auto_def.carbon:[[@LINE+3]]:1-16: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fail_decl_then_auto_def.carbon:[[@LINE-2]]:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
|
||||
@@ -53,12 +41,8 @@ fn F() -> auto { return 0 as i32; }
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: fail_auto_def_then_decl.carbon:[[@LINE+7]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn F() -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_auto_def_then_decl.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_auto_def_then_decl.carbon:[[@LINE+3]]:1-14: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fail_auto_def_then_decl.carbon:[[@LINE-2]]:1-16: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> i32;
|
||||
|
||||
@@ -66,12 +50,8 @@ fn F() -> i32;
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+7]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE+3]]:1-16: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fail_redefinition.carbon:[[@LINE-2]]:1-16: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
|
||||
@@ -79,41 +59,29 @@ fn F() -> auto { return 0 as i32; }
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_member_out_of_line.carbon:[[@LINE+4]]:10: error: forward declaration of function with deduced return type [DeducedReturnTypeNotDefinition]
|
||||
// CHECK:STDERR: fn F() -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_member_out_of_line.carbon:[[@LINE+2]]:10-16: error: forward declaration of function with deduced return type [DeducedReturnTypeNotDefinition]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto;
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_member_out_of_line.carbon:[[@LINE+7]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn C.F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_member_out_of_line.carbon:[[@LINE-6]]:3: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> auto;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_member_out_of_line.carbon:[[@LINE+3]]:1-18: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fail_member_out_of_line.carbon:[[@LINE-4]]:3-17: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn C.F() -> auto { return 0 as i32; }
|
||||
|
||||
// --- fail_builtin.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+8]]:26: error: builtin function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: fn F(n: Core.IntLiteral) -> auto = "int.make_type_signed";
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:26-32: error: builtin function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.make_type_signed" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR: fn F(n: Core.IntLiteral) -> auto = "int.make_type_signed";
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_builtin.carbon:[[@LINE+2]]:1-34: error: invalid signature for builtin function "int.make_type_signed" [InvalidBuiltinSignature]
|
||||
// CHECK:STDERR:
|
||||
fn F(n: Core.IntLiteral) -> auto = "int.make_type_signed";
|
||||
|
||||
// --- fail_extern.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern.carbon:[[@LINE+4]]:15: error: `extern` function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR: extern fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern.carbon:[[@LINE+2]]:15-21: error: `extern` function with deduced return type [DeducedReturnTypeNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
extern fn F() -> auto { return 0 as i32; }
|
||||
|
||||
@@ -125,17 +93,11 @@ fn F() -> auto { return 0 as i32; }
|
||||
// --- fail_api_def.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+12]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn F() -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api_def.carbon:3:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+6]]:1-14: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: imported from: fail_api_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: api_def.carbon:3:1-16: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+4]]:1: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR: fn F() -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+2]]:1-14: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> i32;
|
||||
|
||||
@@ -147,12 +109,8 @@ fn F() -> i32;
|
||||
// --- fail_api_decl.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_api_decl.impl.carbon:[[@LINE+8]]:1: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_api_decl.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: api_decl.carbon:3:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_api_decl.impl.carbon:[[@LINE+4]]:1-16: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: imported from: fail_api_decl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: api_decl.carbon:3:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
@@ -17,12 +17,8 @@ fn F(b: bool) -> auto {
|
||||
if (b) {
|
||||
return 1 as i32;
|
||||
}
|
||||
// CHECK:STDERR: fail_mismatch.carbon:[[@LINE+7]]:10: error: deduced return type `bool` does not match return type deduced earlier [DeducedReturnTypeMismatch]
|
||||
// CHECK:STDERR: return true;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_mismatch.carbon:[[@LINE-5]]:12: note: return type previously deduced as `i32` here [DeducedReturnTypeMismatchPrevious]
|
||||
// CHECK:STDERR: return 1 as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_mismatch.carbon:[[@LINE+3]]:10-13: error: deduced return type `bool` does not match return type deduced earlier [DeducedReturnTypeMismatch]
|
||||
// CHECK:STDERR: fail_mismatch.carbon:[[@LINE-3]]:12-19: note: return type previously deduced as `i32` here [DeducedReturnTypeMismatchPrevious]
|
||||
// CHECK:STDERR:
|
||||
return true;
|
||||
}
|
||||
@@ -35,12 +31,8 @@ fn F(b: bool) -> auto {
|
||||
return 1 as i32;
|
||||
}
|
||||
// TODO: This should work once we use CommonType in return type deduction.
|
||||
// CHECK:STDERR: fail_todo_mismatch_int_vs_int_literal.carbon:[[@LINE+7]]:10: error: deduced return type `Core.IntLiteral` does not match return type deduced earlier [DeducedReturnTypeMismatch]
|
||||
// CHECK:STDERR: return 0;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_mismatch_int_vs_int_literal.carbon:[[@LINE-6]]:12: note: return type previously deduced as `i32` here [DeducedReturnTypeMismatchPrevious]
|
||||
// CHECK:STDERR: return 1 as i32;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_mismatch_int_vs_int_literal.carbon:[[@LINE+3]]:10: error: deduced return type `Core.IntLiteral` does not match return type deduced earlier [DeducedReturnTypeMismatch]
|
||||
// CHECK:STDERR: fail_todo_mismatch_int_vs_int_literal.carbon:[[@LINE-4]]:12-19: note: return type previously deduced as `i32` here [DeducedReturnTypeMismatchPrevious]
|
||||
// CHECK:STDERR:
|
||||
return 0;
|
||||
}
|
||||
@@ -51,9 +43,7 @@ library "[[@TEST_NAME]]";
|
||||
// The erroneous `return` doesn't affect the deduced return type.
|
||||
fn F(b: bool) -> auto {
|
||||
if (b) {
|
||||
// CHECK:STDERR: fail_error_return_ignored.carbon:[[@LINE+4]]:12: error: name `Undeclared` not found [NameNotFound]
|
||||
// CHECK:STDERR: return Undeclared;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_error_return_ignored.carbon:[[@LINE+2]]:12-21: error: name `Undeclared` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
return Undeclared;
|
||||
}
|
||||
@@ -69,12 +59,8 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(b: bool) -> auto {
|
||||
if (b) {
|
||||
// CHECK:STDERR: fail_return_no_value.carbon:[[@LINE+7]]:5: error: missing return value [ReturnStatementMissingExpr]
|
||||
// CHECK:STDERR: return;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_return_no_value.carbon:[[@LINE-5]]:1: note: return type of function is deduced [ReturnTypeIsDeducedNote]
|
||||
// CHECK:STDERR: fn F(b: bool) -> auto {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_no_value.carbon:[[@LINE+3]]:5-11: error: missing return value [ReturnStatementMissingExpr]
|
||||
// CHECK:STDERR: fail_return_no_value.carbon:[[@LINE-3]]:1-23: note: return type of function is deduced [ReturnTypeIsDeducedNote]
|
||||
// CHECK:STDERR:
|
||||
return;
|
||||
}
|
||||
@@ -85,12 +71,8 @@ fn F(b: bool) -> auto {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> auto {
|
||||
// CHECK:STDERR: fail_return_no_value_only.carbon:[[@LINE+7]]:3: error: missing return value [ReturnStatementMissingExpr]
|
||||
// CHECK:STDERR: return;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_return_no_value_only.carbon:[[@LINE-4]]:1: note: return type of function is deduced [ReturnTypeIsDeducedNote]
|
||||
// CHECK:STDERR: fn F() -> auto {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_no_value_only.carbon:[[@LINE+3]]:3-9: error: missing return value [ReturnStatementMissingExpr]
|
||||
// CHECK:STDERR: fail_return_no_value_only.carbon:[[@LINE-2]]:1-16: note: return type of function is deduced [ReturnTypeIsDeducedNote]
|
||||
// CHECK:STDERR:
|
||||
return;
|
||||
}
|
||||
@@ -102,18 +84,14 @@ fn F(b: bool) -> auto {
|
||||
if (b) {
|
||||
return 1 as i32;
|
||||
}
|
||||
// CHECK:STDERR: fail_reachable_end.carbon:[[@LINE+4]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement]
|
||||
// CHECK:STDERR: }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_reachable_end.carbon:[[@LINE+2]]:1: error: missing `return` at end of function with declared return type [MissingReturnStatement]
|
||||
// CHECK:STDERR:
|
||||
}
|
||||
|
||||
// --- fail_no_return.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_no_return.carbon:[[@LINE+4]]:1: error: no `return` in function with deduced return type [DeducedReturnTypeWithoutReturn]
|
||||
// CHECK:STDERR: fn F() -> auto {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_no_return.carbon:[[@LINE+2]]:1-16: error: no `return` in function with deduced return type [DeducedReturnTypeWithoutReturn]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto {}
|
||||
|
||||
@@ -121,9 +99,7 @@ fn F() -> auto {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() -> auto {
|
||||
// CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+4]]:3: error: `return var;` with no `returned var` in scope [ReturnVarWithNoReturnedVar]
|
||||
// CHECK:STDERR: return var;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_var_no_returned_var.carbon:[[@LINE+2]]:3-13: error: `return var;` with no `returned var` in scope [ReturnVarWithNoReturnedVar]
|
||||
// CHECK:STDERR:
|
||||
return var;
|
||||
}
|
||||
@@ -136,12 +112,8 @@ class C;
|
||||
fn Make() -> C*;
|
||||
|
||||
fn F() -> auto {
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+7]]:10: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: return *Make();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-8]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE+3]]:10-16: error: function returns incomplete type `C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: fail_incomplete.carbon:[[@LINE-6]]:1-8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
return *Make();
|
||||
}
|
||||
@@ -22,9 +22,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F[T: Core.Copy](x: T) -> auto { return x; }
|
||||
|
||||
// CHECK:STDERR: fail_todo_call_generic.carbon:[[@LINE+4]]:24: error: semantics TODO: `call to generic function with deduced return type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn G() -> i32 { return F(0 as i32); }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_generic.carbon:[[@LINE+2]]:24-34: error: semantics TODO: `call to generic function with deduced return type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn G() -> i32 { return F(0 as i32); }
|
||||
|
||||
|
||||
@@ -79,17 +79,11 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(b: bool) -> auto {
|
||||
if (b) {
|
||||
// CHECK:STDERR: fail_return_before_returned_var.carbon:[[@LINE+6]]:5: error: cannot implicitly convert expression of type `bool` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: return true;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_before_returned_var.carbon:[[@LINE+3]]:5: note: type `bool` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: return true;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_before_returned_var.carbon:[[@LINE+2]]:5-16: error: cannot implicitly convert expression of type `bool` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_return_before_returned_var.carbon:[[@LINE+1]]:5-16: note: type `bool` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
return true;
|
||||
}
|
||||
// CHECK:STDERR: fail_return_before_returned_var.carbon:[[@LINE+4]]:19: note: return type deduced as `i32` [ReturnTypeDeducedAs]
|
||||
// CHECK:STDERR: returned var r: i32 = 0;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_return_before_returned_var.carbon:[[@LINE+2]]:19-21: note: return type deduced as `i32` [ReturnTypeDeducedAs]
|
||||
// CHECK:STDERR:
|
||||
returned var r: i32 = 0;
|
||||
return var;
|
||||
@@ -103,12 +97,8 @@ fn F(b: bool) -> auto {
|
||||
returned var r: i32 = 0;
|
||||
return var;
|
||||
}
|
||||
// CHECK:STDERR: fail_returned_var_mismatch.carbon:[[@LINE+7]]:19: error: type `bool` of `returned var` does not match return type of enclosing function [ReturnedVarWrongType]
|
||||
// CHECK:STDERR: returned var s: bool = true;
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_returned_var_mismatch.carbon:[[@LINE-6]]:21: note: return type of function is `i32` [ReturnTypeHereNote]
|
||||
// CHECK:STDERR: returned var r: i32 = 0;
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_returned_var_mismatch.carbon:[[@LINE+3]]:19-22: error: type `bool` of `returned var` does not match return type of enclosing function [ReturnedVarWrongType]
|
||||
// CHECK:STDERR: fail_returned_var_mismatch.carbon:[[@LINE-4]]:21-23: note: return type of function is `i32` [ReturnTypeHereNote]
|
||||
// CHECK:STDERR:
|
||||
returned var s: bool = true;
|
||||
return var;
|
||||
|
||||
+4
-12
@@ -15,12 +15,8 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(b: bool) -> auto {
|
||||
if (b) {
|
||||
// CHECK:STDERR: fail_recursion.carbon:[[@LINE+7]]:12: error: call to `F` before its return type is deduced [CallBeforeReturnTypeDeduced]
|
||||
// CHECK:STDERR: return F(false);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_recursion.carbon:[[@LINE-5]]:1: note: return type of `F` is deduced from its definition [ReturnTypeDeducedFromDefinition]
|
||||
// CHECK:STDERR: fn F(b: bool) -> auto {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_recursion.carbon:[[@LINE+3]]:12-19: error: call to `F` before its return type is deduced [CallBeforeReturnTypeDeduced]
|
||||
// CHECK:STDERR: fail_recursion.carbon:[[@LINE-3]]:1-23: note: return type of `F` is deduced from its definition [ReturnTypeDeducedFromDefinition]
|
||||
// CHECK:STDERR:
|
||||
return F(false);
|
||||
}
|
||||
@@ -32,13 +28,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {
|
||||
// The body of `F` is checked after the body of `G`.
|
||||
// CHECK:STDERR: fail_member_order.carbon:[[@LINE+3]]:26: error: call to `F` before its return type is deduced [CallBeforeReturnTypeDeduced]
|
||||
// CHECK:STDERR: fn G() -> i32 { return F(); }
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_member_order.carbon:[[@LINE+1]]:26-28: error: call to `F` before its return type is deduced [CallBeforeReturnTypeDeduced]
|
||||
fn G() -> i32 { return F(); }
|
||||
// CHECK:STDERR: fail_member_order.carbon:[[@LINE+4]]:3: note: return type of `F` is deduced from its definition [ReturnTypeDeducedFromDefinition]
|
||||
// CHECK:STDERR: fn F() -> auto { return 0 as i32; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_member_order.carbon:[[@LINE+2]]:3-18: note: return type of `F` is deduced from its definition [ReturnTypeDeducedFromDefinition]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
}
|
||||
|
||||
@@ -17,12 +17,8 @@
|
||||
|
||||
class C;
|
||||
|
||||
// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+7]]:13: error: parameter has incomplete type `C` in function definition [IncompleteTypeInFunctionParam]
|
||||
// CHECK:STDERR: fn F(unused n: C) {}
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-5]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE+3]]:13-16: error: parameter has incomplete type `C` in function definition [IncompleteTypeInFunctionParam]
|
||||
// CHECK:STDERR: fail_incomplete_type.carbon:[[@LINE-3]]:1-8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused n: C) {}
|
||||
|
||||
|
||||
@@ -14,12 +14,8 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(x: i32 = 0, y: i32 = 10);
|
||||
// CHECK:STDERR: fail_defaults_different_values_redecl.carbon:[[@LINE+7]]:25: error: redeclaration differs at parameter 2 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(unused x: i32 = 0, unused y: i32 = 22) { }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_defaults_different_values_redecl.carbon:[[@LINE-4]]:18: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn F(x: i32 = 0, y: i32 = 10);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_defaults_different_values_redecl.carbon:[[@LINE+3]]:25-42: error: redeclaration differs at parameter 2 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fail_defaults_different_values_redecl.carbon:[[@LINE-2]]:18-28: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused x: i32 = 0, unused y: i32 = 22) { }
|
||||
|
||||
@@ -31,13 +27,9 @@ fn F(x: i32 = 0, y: i32 = 1, z: i32 = 2);
|
||||
// --- fail_imported_default_presence_mismatch.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE+8]]:13: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(unused x: i32, unused y: i32 = 1, unused z: i32 = 2) { }
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: imported_default_presence_mismatch.carbon:3:6: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn F(x: i32 = 0, y: i32 = 1, z: i32 = 2);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE+4]]:13-18: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported from: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: imported_default_presence_mismatch.carbon:3:6-15: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused x: i32, unused y: i32 = 1, unused z: i32 = 2) { }
|
||||
|
||||
@@ -49,13 +41,9 @@ fn F(x: i32 = 0, y: i32 = 10);
|
||||
// --- fail_imported_defaults_different_values.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_imported_defaults_different_values.impl.carbon:[[@LINE+8]]:25: error: redeclaration differs at parameter 2 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(unused x: i32 = 0, unused y: i32 = 22) { }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_imported_defaults_different_values.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: imported_defaults_different_values.carbon:3:18: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn F(x: i32 = 0, y: i32 = 10);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_imported_defaults_different_values.impl.carbon:[[@LINE+4]]:25-42: error: redeclaration differs at parameter 2 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported from: fail_imported_defaults_different_values.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: imported_defaults_different_values.carbon:3:18-28: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused x: i32 = 0, unused y: i32 = 22) { }
|
||||
|
||||
|
||||
+15
-37
@@ -42,12 +42,8 @@ extern fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE+3]]:1-8: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fail_def_extern_mismatch.carbon:[[@LINE-2]]:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() {}
|
||||
|
||||
@@ -56,12 +52,8 @@ fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F();
|
||||
// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE+3]]:1-15: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fail_def_extern_mismatch_reverse.carbon:[[@LINE-2]]:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn F() {}
|
||||
|
||||
@@ -70,20 +62,12 @@ extern fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
extern fn F();
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+3]]:1-7: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-2]]:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F();
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+7]]:1: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-12]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE+3]]:1-8: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fail_extern_diag_suppressed.carbon:[[@LINE-6]]:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() {}
|
||||
|
||||
@@ -92,12 +76,8 @@ fn F() {}
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {}
|
||||
// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+7]]:1: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-4]]:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE+3]]:1-14: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fail_extern_decl_after_def.carbon:[[@LINE-2]]:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
@@ -109,9 +89,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile]
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+2]]:1-15: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile]
|
||||
// CHECK:STDERR:
|
||||
extern fn F() {}
|
||||
|
||||
@@ -208,7 +186,7 @@ extern fn F() {}
|
||||
// CHECK:STDOUT: .F = %F.decl.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @F() {
|
||||
@@ -229,7 +207,7 @@ extern fn F() {}
|
||||
// CHECK:STDOUT: .F = %F.decl.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
@@ -250,8 +228,8 @@ extern fn F() {}
|
||||
// CHECK:STDOUT: .F = %F.decl.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc20: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @F() {
|
||||
@@ -272,7 +250,7 @@ extern fn F() {}
|
||||
// CHECK:STDOUT: .F = %F.decl.loc4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc12: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc8: %F.type = fn_decl @F [concrete = constants.%F] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
|
||||
@@ -58,13 +58,9 @@ extern fn F();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+4]]:1-8: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() {}
|
||||
|
||||
@@ -82,10 +78,8 @@ impl library "no_decl_extern";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_no_decl.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: no_decl_extern.carbon:4:1: error: owning declaration required for non-owning declaration [MissingOwningDeclarationInApi]
|
||||
// CHECK:STDERR: extern library "no_decl" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_no_decl.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: no_decl_extern.carbon:4:1-32: error: owning declaration required for non-owning declaration [MissingOwningDeclarationInApi]
|
||||
// CHECK:STDERR:
|
||||
import library "no_decl_extern";
|
||||
|
||||
@@ -99,10 +93,8 @@ extern library "indirect_two_file" fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_indirect_two_file.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: indirect_two_file_extern.carbon:4:1: error: owning declaration required for non-owning declaration [MissingOwningDeclarationInApi]
|
||||
// CHECK:STDERR: extern library "indirect_two_file" fn F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_indirect_two_file.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: indirect_two_file_extern.carbon:4:1-42: error: owning declaration required for non-owning declaration [MissingOwningDeclarationInApi]
|
||||
// CHECK:STDERR:
|
||||
import library "indirect_two_file_extern";
|
||||
|
||||
@@ -110,9 +102,7 @@ import library "indirect_two_file_extern";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile]
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_indirect_two_file.impl.carbon:[[@LINE+2]]:1-15: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile]
|
||||
// CHECK:STDERR:
|
||||
extern fn F() {}
|
||||
|
||||
@@ -132,9 +122,7 @@ impl library "[[@TEST_NAME]]";
|
||||
|
||||
import library "in_impl_extern";
|
||||
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+4]]:1: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile]
|
||||
// CHECK:STDERR: extern fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_in_impl.impl.carbon:[[@LINE+2]]:1-15: error: `extern` entities must have a declaration in the API file [ExternRequiresDeclInApiFile]
|
||||
// CHECK:STDERR:
|
||||
extern fn F() {}
|
||||
|
||||
|
||||
+83
-105
@@ -13,59 +13,37 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon
|
||||
|
||||
fn F();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: fn F(unused x: ()) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 0 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR: fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+3]]:1-20: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-2]]:1-7: note: previously declared with parameter count of 0 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused x: ()) {}
|
||||
|
||||
fn G(x: ());
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 0 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: fn G() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with parameter count of 1 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR: fn G(x: ());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+3]]:1-8: error: redeclaration differs because of parameter count of 0 [RedeclParamCountDiffers]
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-2]]:1-12: note: previously declared with parameter count of 1 [RedeclParamCountPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn G() {}
|
||||
|
||||
fn H(x: ());
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+4]]:16: error: `Core.Bool` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
||||
// CHECK:STDERR: fn H(unused x: bool) {}
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+2]]:16-19: error: `Core.Bool` implicitly referenced here, but package `Core` not found [CoreNotFound]
|
||||
// CHECK:STDERR:
|
||||
fn H(unused x: bool) {}
|
||||
|
||||
fn I();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `()` [FunctionRedeclReturnTypeDiffers]
|
||||
// CHECK:STDERR: fn I() -> () { return (); }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with no return type [FunctionRedeclReturnTypePreviousNoReturn]
|
||||
// CHECK:STDERR: fn I();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+3]]:1-14: error: function redeclaration differs because return type is `()` [FunctionRedeclReturnTypeDiffers]
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-2]]:1-7: note: previously declared with no return type [FunctionRedeclReturnTypePreviousNoReturn]
|
||||
// CHECK:STDERR:
|
||||
fn I() -> () { return (); }
|
||||
|
||||
fn J() -> ();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because no return type is provided [FunctionRedeclReturnTypeDiffersNoReturn]
|
||||
// CHECK:STDERR: fn J() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` [FunctionRedeclReturnTypePrevious]
|
||||
// CHECK:STDERR: fn J() -> ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+3]]:1-8: error: function redeclaration differs because no return type is provided [FunctionRedeclReturnTypeDiffersNoReturn]
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-2]]:1-13: note: previously declared with return type `()` [FunctionRedeclReturnTypePrevious]
|
||||
// CHECK:STDERR:
|
||||
fn J() {}
|
||||
|
||||
fn K() -> ();
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `{}` [FunctionRedeclReturnTypeDiffers]
|
||||
// CHECK:STDERR: fn K() -> {} { return {}; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-4]]:1: note: previously declared with return type `()` [FunctionRedeclReturnTypePrevious]
|
||||
// CHECK:STDERR: fn K() -> ();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+3]]:1-14: error: function redeclaration differs because return type is `{}` [FunctionRedeclReturnTypeDiffers]
|
||||
// CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE-2]]:1-13: note: previously declared with return type `()` [FunctionRedeclReturnTypePrevious]
|
||||
// CHECK:STDERR:
|
||||
fn K() -> {} { return {}; }
|
||||
|
||||
@@ -80,29 +58,29 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %x.patt.2180a6.1: %pattern_type.cb1 = wrapper_binding_pattern x, %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc23 [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc19 [concrete]
|
||||
// CHECK:STDOUT: %F.7088cc.2: %F.type.eb3ec9.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %x.patt.2180a6.2: %pattern_type.cb1 = wrapper_binding_pattern x, %x.param_patt [concrete]
|
||||
// CHECK:STDOUT: %G.type.f42045.1: type = fn_type @G.loc25 [concrete]
|
||||
// CHECK:STDOUT: %G.type.f42045.1: type = fn_type @G.loc21 [concrete]
|
||||
// CHECK:STDOUT: %G.4228ed.1: %G.type.f42045.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %G.type.f42045.2: type = fn_type @G.loc33 [concrete]
|
||||
// CHECK:STDOUT: %G.type.f42045.2: type = fn_type @G.loc25 [concrete]
|
||||
// CHECK:STDOUT: %G.4228ed.2: %G.type.f42045.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %H.type.c0bf33.1: type = fn_type @H.loc35 [concrete]
|
||||
// CHECK:STDOUT: %H.type.c0bf33.1: type = fn_type @H.loc27 [concrete]
|
||||
// CHECK:STDOUT: %H.aacb46.1: %H.type.c0bf33.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %H.type.c0bf33.2: type = fn_type @H.loc40 [concrete]
|
||||
// CHECK:STDOUT: %H.type.c0bf33.2: type = fn_type @H.loc30 [concrete]
|
||||
// CHECK:STDOUT: %H.aacb46.2: %H.type.c0bf33.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %I.type.4c8936.1: type = fn_type @I.loc42 [concrete]
|
||||
// CHECK:STDOUT: %I.type.4c8936.1: type = fn_type @I.loc32 [concrete]
|
||||
// CHECK:STDOUT: %I.8a67f5.1: %I.type.4c8936.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %.262: Core.Form = init_form %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt.900: %pattern_type.cb1 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt.427: %pattern_type.cb1 = return_slot_pattern %return.param_patt.900, %empty_tuple.type [concrete]
|
||||
// CHECK:STDOUT: %I.type.4c8936.2: type = fn_type @I.loc50 [concrete]
|
||||
// CHECK:STDOUT: %I.type.4c8936.2: type = fn_type @I.loc36 [concrete]
|
||||
// CHECK:STDOUT: %I.8a67f5.2: %I.type.4c8936.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %J.type.6304f1.1: type = fn_type @J.loc52 [concrete]
|
||||
// CHECK:STDOUT: %J.type.6304f1.1: type = fn_type @J.loc38 [concrete]
|
||||
// CHECK:STDOUT: %J.64b370.1: %J.type.6304f1.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %J.type.6304f1.2: type = fn_type @J.loc60 [concrete]
|
||||
// CHECK:STDOUT: %J.type.6304f1.2: type = fn_type @J.loc42 [concrete]
|
||||
// CHECK:STDOUT: %J.64b370.2: %J.type.6304f1.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %K.type.b73f4f.1: type = fn_type @K.loc62 [concrete]
|
||||
// CHECK:STDOUT: %K.type.b73f4f.1: type = fn_type @K.loc44 [concrete]
|
||||
// CHECK:STDOUT: %K.4fd1e7.1: %K.type.b73f4f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
|
||||
@@ -110,101 +88,101 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT: %pattern_type.a96: type = pattern_type %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt.296: %pattern_type.a96 = out_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.patt.c45: %pattern_type.a96 = return_slot_pattern %return.param_patt.296, %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %K.type.b73f4f.2: type = fn_type @K.loc70 [concrete]
|
||||
// CHECK:STDOUT: %K.type.b73f4f.2: type = fn_type @K.loc48 [concrete]
|
||||
// CHECK:STDOUT: %K.4fd1e7.2: %K.type.b73f4f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .F = %F.decl.loc15
|
||||
// CHECK:STDOUT: .G = %G.decl.loc25
|
||||
// CHECK:STDOUT: .H = %H.decl.loc35
|
||||
// CHECK:STDOUT: .I = %I.decl.loc42
|
||||
// CHECK:STDOUT: .J = %J.decl.loc52
|
||||
// CHECK:STDOUT: .K = %K.decl.loc62
|
||||
// CHECK:STDOUT: .G = %G.decl.loc21
|
||||
// CHECK:STDOUT: .H = %H.decl.loc27
|
||||
// CHECK:STDOUT: .I = %I.decl.loc32
|
||||
// CHECK:STDOUT: .J = %J.decl.loc38
|
||||
// CHECK:STDOUT: .K = %K.decl.loc44
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc15: %F.type.eb3ec9.1 = fn_decl @F.loc15 [concrete = constants.%F.7088cc.1] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc23: %F.type.eb3ec9.2 = fn_decl @F.loc23 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %F.decl.loc19: %F.type.eb3ec9.2 = fn_decl @F.loc19 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cb1 = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt.2180a6.1]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc23_17.1: type = splice_block %.loc23_17.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc23_17.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc23_17.3: type = converted %.loc23_17.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc19_17.1: type = splice_block %.loc19_17.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc19_17.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc19_17.3: type = converted %.loc19_17.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl.loc25: %G.type.f42045.1 = fn_decl @G.loc25 [concrete = constants.%G.4228ed.1] {
|
||||
// CHECK:STDOUT: %G.decl.loc21: %G.type.f42045.1 = fn_decl @G.loc21 [concrete = constants.%G.4228ed.1] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cb1 = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt.2180a6.2]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc25_10.1: type = splice_block %.loc25_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc25_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc25_10.3: type = converted %.loc25_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc21_10.1: type = splice_block %.loc21_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc21_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc21_10.3: type = converted %.loc21_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl.loc33: %G.type.f42045.2 = fn_decl @G.loc33 [concrete = constants.%G.4228ed.2] {} {}
|
||||
// CHECK:STDOUT: %H.decl.loc35: %H.type.c0bf33.1 = fn_decl @H.loc35 [concrete = constants.%H.aacb46.1] {
|
||||
// CHECK:STDOUT: %G.decl.loc25: %G.type.f42045.2 = fn_decl @G.loc25 [concrete = constants.%G.4228ed.2] {} {}
|
||||
// CHECK:STDOUT: %H.decl.loc27: %H.type.c0bf33.1 = fn_decl @H.loc27 [concrete = constants.%H.aacb46.1] {
|
||||
// CHECK:STDOUT: %x.param_patt: %pattern_type.cb1 = value_param_pattern [concrete = constants.%x.param_patt]
|
||||
// CHECK:STDOUT: %x.patt: %pattern_type.cb1 = wrapper_binding_pattern x, %x.param_patt [concrete = constants.%x.patt.2180a6.2]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: %empty_tuple.type = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc35_10.1: type = splice_block %.loc35_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc35_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc35_10.3: type = converted %.loc35_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc27_10.1: type = splice_block %.loc27_10.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc27_10.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc27_10.3: type = converted %.loc27_10.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: %empty_tuple.type = wrapper_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %H.decl.loc40: %H.type.c0bf33.2 = fn_decl @H.loc40 [concrete = constants.%H.aacb46.2] {
|
||||
// CHECK:STDOUT: %H.decl.loc30: %H.type.c0bf33.2 = fn_decl @H.loc30 [concrete = constants.%H.aacb46.2] {
|
||||
// CHECK:STDOUT: %x.param_patt: <error> = value_param_pattern [concrete = <error>]
|
||||
// CHECK:STDOUT: %x.patt: <error> = wrapper_binding_pattern x, %x.param_patt [concrete = <error>]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %x.param: <error> = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc40: type = type_literal <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc30: type = type_literal <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %x: <error> = wrapper_binding x, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %I.decl.loc42: %I.type.4c8936.1 = fn_decl @I.loc42 [concrete = constants.%I.8a67f5.1] {} {}
|
||||
// CHECK:STDOUT: %I.decl.loc50: %I.type.4c8936.2 = fn_decl @I.loc50 [concrete = constants.%I.8a67f5.2] {
|
||||
// CHECK:STDOUT: %I.decl.loc32: %I.type.4c8936.1 = fn_decl @I.loc32 [concrete = constants.%I.8a67f5.1] {} {}
|
||||
// CHECK:STDOUT: %I.decl.loc36: %I.type.4c8936.2 = fn_decl @I.loc36 [concrete = constants.%I.8a67f5.2] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete = constants.%return.param_patt.900]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc50_12.2 [concrete = constants.%return.patt.427]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc36_12.2 [concrete = constants.%return.patt.427]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc50_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc50_12.2: type = converted %.loc50_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc50_12.3: Core.Form = init_form %.loc50_12.2 [concrete = constants.%.262]
|
||||
// CHECK:STDOUT: %.loc36_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc36_12.2: type = converted %.loc36_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc36_12.3: Core.Form = init_form %.loc36_12.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: %J.decl.loc52: %J.type.6304f1.1 = fn_decl @J.loc52 [concrete = constants.%J.64b370.1] {
|
||||
// CHECK:STDOUT: %J.decl.loc38: %J.type.6304f1.1 = fn_decl @J.loc38 [concrete = constants.%J.64b370.1] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete = constants.%return.param_patt.900]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc52_12.2 [concrete = constants.%return.patt.427]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc38_12.2 [concrete = constants.%return.patt.427]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc52_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc52_12.2: type = converted %.loc52_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc52_12.3: Core.Form = init_form %.loc52_12.2 [concrete = constants.%.262]
|
||||
// CHECK:STDOUT: %.loc38_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc38_12.2: type = converted %.loc38_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc38_12.3: Core.Form = init_form %.loc38_12.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: %J.decl.loc60: %J.type.6304f1.2 = fn_decl @J.loc60 [concrete = constants.%J.64b370.2] {} {}
|
||||
// CHECK:STDOUT: %K.decl.loc62: %K.type.b73f4f.1 = fn_decl @K.loc62 [concrete = constants.%K.4fd1e7.1] {
|
||||
// CHECK:STDOUT: %J.decl.loc42: %J.type.6304f1.2 = fn_decl @J.loc42 [concrete = constants.%J.64b370.2] {} {}
|
||||
// CHECK:STDOUT: %K.decl.loc44: %K.type.b73f4f.1 = fn_decl @K.loc44 [concrete = constants.%K.4fd1e7.1] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern [concrete = constants.%return.param_patt.900]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc62_12.2 [concrete = constants.%return.patt.427]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern %return.param_patt, %.loc44_12.2 [concrete = constants.%return.patt.427]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc62_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc62_12.2: type = converted %.loc62_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc62_12.3: Core.Form = init_form %.loc62_12.2 [concrete = constants.%.262]
|
||||
// CHECK:STDOUT: %.loc44_12.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc44_12.2: type = converted %.loc44_12.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc44_12.3: Core.Form = init_form %.loc44_12.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: %K.decl.loc70: %K.type.b73f4f.2 = fn_decl @K.loc70 [concrete = constants.%K.4fd1e7.2] {
|
||||
// CHECK:STDOUT: %K.decl.loc48: %K.type.b73f4f.2 = fn_decl @K.loc48 [concrete = constants.%K.4fd1e7.2] {
|
||||
// CHECK:STDOUT: %return.param_patt: %pattern_type.a96 = out_param_pattern [concrete = constants.%return.param_patt.296]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern %return.param_patt, %.loc70_12.2 [concrete = constants.%return.patt.c45]
|
||||
// CHECK:STDOUT: %return.patt: %pattern_type.a96 = return_slot_pattern %return.param_patt, %.loc48_12.2 [concrete = constants.%return.patt.c45]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc70_12.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc70_12.2: type = converted %.loc70_12.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc70_12.3: Core.Form = init_form %.loc70_12.2 [concrete = constants.%.469]
|
||||
// CHECK:STDOUT: %.loc48_12.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc48_12.2: type = converted %.loc48_12.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %.loc48_12.3: Core.Form = init_form %.loc48_12.2 [concrete = constants.%.469]
|
||||
// CHECK:STDOUT: %return.param: ref %empty_struct_type = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref %empty_struct_type = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
@@ -212,49 +190,49 @@ fn K() -> {} { return {}; }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.loc15();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.loc23(%x.param: %empty_tuple.type) {
|
||||
// CHECK:STDOUT: fn @F.loc19(%x.param: %empty_tuple.type) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G.loc25(%x.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT: fn @G.loc21(%x.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G.loc33() {
|
||||
// CHECK:STDOUT: fn @G.loc25() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H.loc35(%x.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT: fn @H.loc27(%x.param: %empty_tuple.type);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @H.loc40(%x.param: <error>) {
|
||||
// CHECK:STDOUT: fn @H.loc30(%x.param: <error>) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @I.loc42();
|
||||
// CHECK:STDOUT: fn @I.loc32();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @I.loc50() -> out %return.param: %empty_tuple.type {
|
||||
// CHECK:STDOUT: fn @I.loc36() -> out %return.param: %empty_tuple.type {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc50_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc50_24.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc50_25: init %empty_tuple.type = converted %.loc50_24.1, %.loc50_24.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: return %.loc50_25
|
||||
// CHECK:STDOUT: %.loc36_24.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc36_24.2: init %empty_tuple.type = tuple_init () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc36_25: init %empty_tuple.type = converted %.loc36_24.1, %.loc36_24.2 [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: return %.loc36_25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @J.loc52() -> out %return.param: %empty_tuple.type;
|
||||
// CHECK:STDOUT: fn @J.loc38() -> out %return.param: %empty_tuple.type;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @J.loc60() {
|
||||
// CHECK:STDOUT: fn @J.loc42() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @K.loc62() -> out %return.param: %empty_tuple.type;
|
||||
// CHECK:STDOUT: fn @K.loc44() -> out %return.param: %empty_tuple.type;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @K.loc70() -> out %return.param: %empty_struct_type {
|
||||
// CHECK:STDOUT: fn @K.loc48() -> out %return.param: %empty_struct_type {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc70_24.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc70_24.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc70_25: init %empty_struct_type = converted %.loc70_24.1, %.loc70_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: return %.loc70_25
|
||||
// CHECK:STDOUT: %.loc48_24.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc48_24.2: init %empty_struct_type = struct_init () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc48_25: init %empty_struct_type = converted %.loc48_24.1, %.loc48_24.2 [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: return %.loc48_25
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -15,19 +15,13 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+4]]:3: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
|
||||
// CHECK:STDERR: default fn F();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+2]]:3-9: error: `default` not allowed; requires interface scope [ModifierRequiresInterface]
|
||||
// CHECK:STDERR:
|
||||
default fn F();
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+4]]:3: error: `override` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR: override fn G();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+2]]:3-10: error: `override` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR:
|
||||
override fn G();
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+4]]:3: error: `virtual` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR: virtual fn H();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_virtual.carbon:[[@LINE+2]]:3-9: error: `virtual` not allowed; requires class scope [ModifierRequiresClass]
|
||||
// CHECK:STDERR:
|
||||
virtual fn H();
|
||||
}
|
||||
@@ -37,14 +31,10 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:3: error: `private` not allowed; requires class or file scope [ModifierPrivateNotAllowed]
|
||||
// CHECK:STDERR: private var unused v: {} = {};
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+2]]:3-9: error: `private` not allowed; requires class or file scope [ModifierPrivateNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
private var unused v: {} = {};
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:3: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed]
|
||||
// CHECK:STDERR: protected var unused w: {} = {};
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+2]]:3-11: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed]
|
||||
// CHECK:STDERR:
|
||||
protected var unused w: {} = {};
|
||||
}
|
||||
@@ -13,12 +13,8 @@
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/fail_redef.carbon
|
||||
|
||||
fn F() {}
|
||||
// CHECK:STDERR: fail_redef.carbon:[[@LINE+7]]:1: error: redefinition of `fn F` [RedeclRedef]
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redef.carbon:[[@LINE-4]]:1: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR: fn F() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redef.carbon:[[@LINE+3]]:1-8: error: redefinition of `fn F` [RedeclRedef]
|
||||
// CHECK:STDERR: fail_redef.carbon:[[@LINE-2]]:1-8: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn F() {}
|
||||
|
||||
@@ -28,7 +24,7 @@ fn F() {}
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.1: type = fn_type @F.loc15 [concrete]
|
||||
// CHECK:STDOUT: %F.7088cc.1: %F.type.eb3ec9.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc23 [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc19 [concrete]
|
||||
// CHECK:STDOUT: %F.7088cc.2: %F.type.eb3ec9.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -37,7 +33,7 @@ fn F() {}
|
||||
// CHECK:STDOUT: .F = %F.decl.loc15
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc15: %F.type.eb3ec9.1 = fn_decl @F.loc15 [concrete = constants.%F.7088cc.1] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc23: %F.type.eb3ec9.2 = fn_decl @F.loc23 [concrete = constants.%F.7088cc.2] {} {}
|
||||
// CHECK:STDOUT: %F.decl.loc19: %F.type.eb3ec9.2 = fn_decl @F.loc19 [concrete = constants.%F.7088cc.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.loc15() {
|
||||
@@ -45,7 +41,7 @@ fn F() {}
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.loc23() {
|
||||
// CHECK:STDOUT: fn @F.loc19() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -34,13 +34,9 @@ extern fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1-8: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_api.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A() {}
|
||||
|
||||
@@ -54,13 +50,9 @@ fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+4]]:1-15: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn A() {}
|
||||
|
||||
@@ -74,13 +66,9 @@ fn A() {}
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+8]]:1: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: redecl_after_def.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+4]]:1-7: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_redecl_after_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: redecl_after_def.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
@@ -94,13 +82,9 @@ fn A() {}
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+8]]:1: error: redefinition of `fn A` [RedeclRedef]
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: redef_after_def.carbon:4:1: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+4]]:1-8: error: redefinition of `fn A` [RedeclRedef]
|
||||
// CHECK:STDERR: imported from: fail_redef_after_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: redef_after_def.carbon:4:1-8: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn A() {}
|
||||
|
||||
@@ -115,13 +99,9 @@ alias B = A;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+8]]:4: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn B() {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+4]]:4: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_def_alias.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR: alias B = A;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
fn B() {}
|
||||
|
||||
@@ -307,7 +287,7 @@ fn B() {}
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.1: type = fn_type @A.1 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.1: %A.type.9f4a6d.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc12 [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc8 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.2: %A.type.9f4a6d.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -321,12 +301,12 @@ fn B() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import.loc2_31.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc2_31.2 = import <none>
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc12 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc8 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.1 [from "redef_after_def.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.loc12() {
|
||||
// CHECK:STDOUT: fn @A.loc8() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+27
-47
@@ -51,22 +51,14 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "fns";
|
||||
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn A() {};
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fns.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+4]]:1-8: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_def_ownership.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fns.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A() {};
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+8]]:1: error: redeclaration of `fn B` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fn B(b: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE-14]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fns.carbon:5:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn B(b: i32) -> i32 { return b; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+4]]:1-20: error: redeclaration of `fn B` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_def_ownership.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fns.carbon:5:1-21: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn B(b: i32) -> i32;
|
||||
|
||||
@@ -76,23 +68,15 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern";
|
||||
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn A();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+4]]:1-7: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_then_def.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+8]]:1: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fn A() {}
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE-15]]:1: in import [InImport]
|
||||
// CHECK:STDERR: extern.carbon:4:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: extern fn A();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+4]]:1-8: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_then_def.carbon:[[@LINE-9]]:1 [InImport]
|
||||
// CHECK:STDERR: extern.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A() {}
|
||||
|
||||
@@ -102,13 +86,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "fns";
|
||||
|
||||
// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+8]]:1: error: redeclarations of `fn D` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern fn D();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE-5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: fns.carbon:7:1: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR: fn D();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+4]]:1-14: error: redeclarations of `fn D` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_mix_extern_decl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fns.carbon:7:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn D();
|
||||
|
||||
@@ -433,7 +413,7 @@ fn D() {}
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.1: type = fn_type @A.1 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.1: %A.type.9f4a6d.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc14 [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc10 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.2: %A.type.9f4a6d.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = parameterized_class_name_type @Int [concrete]
|
||||
@@ -466,12 +446,12 @@ fn D() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc14 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc10 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [concrete = constants.%B] {} {
|
||||
// CHECK:STDOUT: %i32.loc23_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc23: Core.Form = init_form %i32.loc23_17 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc15_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15: Core.Form = init_form %i32.loc15_17 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %b.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc23_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc15_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %b: %i32 = wrapper_binding b, %b.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
@@ -480,7 +460,7 @@ fn D() {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.1 [from "fns.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.loc14() {
|
||||
// CHECK:STDOUT: fn @A.loc10() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -504,13 +484,13 @@ fn D() {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .A = %A.decl.loc14
|
||||
// CHECK:STDOUT: .A = %A.decl.loc10
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %A.decl.loc14: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc24: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc10: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc16: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @A() [from "extern.carbon"] {
|
||||
@@ -541,13 +521,13 @@ fn D() {}
|
||||
// CHECK:STDOUT: .A = imports.%Main.A
|
||||
// CHECK:STDOUT: .B = imports.%Main.B
|
||||
// CHECK:STDOUT: .C = imports.%Main.C
|
||||
// CHECK:STDOUT: .D = %D.decl.loc14
|
||||
// CHECK:STDOUT: .D = %D.decl.loc10
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %D.decl.loc14: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc16: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc10: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc12: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @D() [from "fns.carbon"] {
|
||||
|
||||
@@ -52,9 +52,7 @@ package Test library "[[@TEST_NAME]]";
|
||||
|
||||
import library "def";
|
||||
|
||||
// CHECK:STDERR: fail_local_def.carbon:[[@LINE+4]]:13: error: name `Def` not found [NameNotFound]
|
||||
// CHECK:STDERR: var f: () = Def();
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_local_def.carbon:[[@LINE+2]]:13-15: error: name `Def` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
var f: () = Def();
|
||||
|
||||
@@ -64,9 +62,7 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Test library "def";
|
||||
|
||||
// CHECK:STDERR: fail_other_def.carbon:[[@LINE+4]]:13: error: member name `Def` not found in `Test` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: var f: () = Test.Def();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_other_def.carbon:[[@LINE+2]]:13-20: error: member name `Def` not found in `Test` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
var f: () = Test.Def();
|
||||
|
||||
@@ -82,9 +78,7 @@ package Test library "[[@TEST_NAME]]";
|
||||
|
||||
import library "forward_with_def";
|
||||
|
||||
// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+4]]:13: error: name `ForwardWithDef` not found [NameNotFound]
|
||||
// CHECK:STDERR: var f: () = ForwardWithDef();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_local_forward_with_def.carbon:[[@LINE+2]]:13-26: error: name `ForwardWithDef` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
var f: () = ForwardWithDef();
|
||||
|
||||
@@ -94,9 +88,7 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Test library "forward_with_def";
|
||||
|
||||
// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+4]]:13: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: var f: () = Test.ForwardWithDef();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_other_forward_with_def.carbon:[[@LINE+2]]:13-31: error: member name `ForwardWithDef` not found in `Test` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
var f: () = Test.ForwardWithDef();
|
||||
|
||||
@@ -114,9 +106,7 @@ package Test library "[[@TEST_NAME]]";
|
||||
|
||||
import library "forward";
|
||||
|
||||
// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+4]]:13: error: name `Forward` not found [NameNotFound]
|
||||
// CHECK:STDERR: var f: () = Forward();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_local_forward.carbon:[[@LINE+2]]:13-19: error: name `Forward` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
var f: () = Forward();
|
||||
|
||||
@@ -126,9 +116,7 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Test library "forward";
|
||||
|
||||
// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+4]]:13: error: member name `Forward` not found in `Test` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: var f: () = Test.Forward();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_other_forward.carbon:[[@LINE+2]]:13-24: error: member name `Forward` not found in `Test` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
var f: () = Test.Forward();
|
||||
|
||||
@@ -262,9 +250,9 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var_storage %f.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = wrapper_binding f, %f.var [concrete = %f.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -305,9 +293,9 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var_storage %f.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = wrapper_binding f, %f.var [concrete = %f.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -388,9 +376,9 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var_storage %f.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = wrapper_binding f, %f.var [concrete = %f.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -431,9 +419,9 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var_storage %f.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = wrapper_binding f, %f.var [concrete = %f.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -518,9 +506,9 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var_storage %f.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = wrapper_binding f, %f.var [concrete = %f.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -561,9 +549,9 @@ private fn Redecl() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Test.import = import Test
|
||||
// CHECK:STDOUT: %f.var: ref %empty_tuple.type = var_storage %f.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc10_9.1: type = splice_block %.loc10_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc10_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc10_9.3: type = converted %.loc10_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %f: ref %empty_tuple.type = wrapper_binding f, %f.var [concrete = %f.var]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
|
||||
@@ -41,12 +41,8 @@ library "[[@TEST_NAME]]";
|
||||
class C {}
|
||||
|
||||
fn Foo(a: C);
|
||||
// CHECK:STDERR: fail_parens.carbon:[[@LINE+7]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fn Foo(unused a: (C)) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_parens.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR: fn Foo(a: C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_parens.carbon:[[@LINE+3]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fail_parens.carbon:[[@LINE-2]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn Foo(unused a: (C)) {}
|
||||
|
||||
@@ -56,22 +52,14 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
class C {}
|
||||
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+8]]:8: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fn Foo[runtime a: C];
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+4]]:8-19: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn Foo[runtime a: C];
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+2]]:1-21: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn Foo[runtime a: C];
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+8]]:8: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR: fn Foo[runtime a: (C)] {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+4]]:8-21: error: implicit parameters of functions must be constant [ImplictParamMustBeConstant]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+4]]:1: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn Foo[runtime a: (C)] {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_only_implicit_params.carbon:[[@LINE+2]]:1-24: error: semantics TODO: `function with positional parameters` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn Foo[runtime a: (C)] {}
|
||||
|
||||
@@ -82,12 +70,8 @@ library "[[@TEST_NAME]]";
|
||||
class C {}
|
||||
|
||||
fn Foo(_: C);
|
||||
// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE+7]]:11: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fn Foo(_: r#C) {}
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR: fn Foo(_: C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE+3]]:11-13: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fail_raw_identifier.carbon:[[@LINE-2]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn Foo(_: r#C) {}
|
||||
|
||||
@@ -116,12 +100,8 @@ class C {}
|
||||
alias D = C;
|
||||
|
||||
fn Foo(a: C);
|
||||
// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+7]]:15: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn Foo(unused b: D) {}
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-4]]:8: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn Foo(a: C);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE+3]]:15-18: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fail_name_mismatch.carbon:[[@LINE-2]]:8-11: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn Foo(unused b: D) {}
|
||||
|
||||
@@ -133,12 +113,8 @@ class C {}
|
||||
alias D = C;
|
||||
|
||||
fn Foo(a: C);
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+7]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fn Foo(unused a: D) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR: fn Foo(a: C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE+3]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fail_alias.carbon:[[@LINE-2]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn Foo(unused a: D) {}
|
||||
|
||||
@@ -150,12 +126,8 @@ class C {}
|
||||
alias D = C;
|
||||
|
||||
fn Foo[a: C]();
|
||||
// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+7]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fn Foo[unused a: D]() {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-4]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR: fn Foo[a: C]();
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE+3]]:18: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fail_deduced_alias.carbon:[[@LINE-2]]:11: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn Foo[unused a: D]() {}
|
||||
|
||||
@@ -192,16 +164,10 @@ library "[[@TEST_NAME]]";
|
||||
class C {}
|
||||
|
||||
fn Foo(a: const C);
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+11]]:18: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst]
|
||||
// CHECK:STDERR: fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+5]]:18-32: warning: `const` applied repeatedly to the same type has no additional effect [RepeatedConst]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+7]]:24: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-8]]:17: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR: fn Foo(a: const C);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE+3]]:24: error: redeclaration syntax differs here [RedeclParamSyntaxDiffers]
|
||||
// CHECK:STDERR: fail_repeat_const.carbon:[[@LINE-4]]:17: note: comparing with previous declaration here [RedeclParamSyntaxPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn Foo(unused a: const (const C)) {}
|
||||
|
||||
@@ -346,7 +312,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = wrapper_binding_pattern a, %a.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc6 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc14 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc10 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -364,7 +330,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Foo.decl.loc14: %Foo.type.11c674.2 = fn_decl @Foo.loc14 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %Foo.decl.loc10: %Foo.type.11c674.2 = fn_decl @Foo.loc10 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %a.param_patt: %pattern_type = value_param_pattern [concrete = constants.%a.param_patt]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = wrapper_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -384,7 +350,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc6(%a.param: %C);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc14(%a.param: %C) {
|
||||
// CHECK:STDOUT: fn @Foo.loc10(%a.param: %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -396,20 +362,20 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc14 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc10 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc23 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc15 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl.loc14
|
||||
// CHECK:STDOUT: .Foo = %Foo.decl.loc10
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %Foo.decl.loc14: %Foo.type.11c674.1 = fn_decl @Foo.loc14 [concrete = constants.%Foo.12ccef.1] {} {}
|
||||
// CHECK:STDOUT: %Foo.decl.loc23: %Foo.type.11c674.2 = fn_decl @Foo.loc23 [concrete = constants.%Foo.12ccef.2] {} {}
|
||||
// CHECK:STDOUT: %Foo.decl.loc10: %Foo.type.11c674.1 = fn_decl @Foo.loc10 [concrete = constants.%Foo.12ccef.1] {} {}
|
||||
// CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.11c674.2 = fn_decl @Foo.loc15 [concrete = constants.%Foo.12ccef.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C {
|
||||
@@ -420,9 +386,9 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: .Self = constants.%C
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc14();
|
||||
// CHECK:STDOUT: fn @Foo.loc10();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc23() {
|
||||
// CHECK:STDOUT: fn @Foo.loc15() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -439,7 +405,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type = wrapper_binding_pattern _, %_.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc6 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc14 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc10 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -457,7 +423,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %_: %C = wrapper_binding _, %_.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Foo.decl.loc14: %Foo.type.11c674.2 = fn_decl @Foo.loc14 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %Foo.decl.loc10: %Foo.type.11c674.2 = fn_decl @Foo.loc10 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %_.param_patt: %pattern_type = value_param_pattern [concrete = constants.%_.param_patt]
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type = wrapper_binding_pattern _, %_.param_patt [concrete = constants.%_.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -477,7 +443,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc6(%_.param: %C);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc14(%_.param: %C) {
|
||||
// CHECK:STDOUT: fn @Foo.loc10(%_.param: %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -620,7 +586,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type = value_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type = wrapper_binding_pattern b, %b.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc15 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc11 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -641,7 +607,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.11c674.2 = fn_decl @Foo.loc15 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %Foo.decl.loc11: %Foo.type.11c674.2 = fn_decl @Foo.loc11 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %b.param_patt: %pattern_type = value_param_pattern [concrete = constants.%b.param_patt]
|
||||
// CHECK:STDOUT: %b.patt: %pattern_type = wrapper_binding_pattern b, %b.param_patt [concrete = constants.%b.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -661,7 +627,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc7(%a.param: %C);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc15(%b.param: %C) {
|
||||
// CHECK:STDOUT: fn @Foo.loc11(%b.param: %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -678,7 +644,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = wrapper_binding_pattern a, %a.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc7 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc15 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc11 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -699,7 +665,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %a: %C = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.11c674.2 = fn_decl @Foo.loc15 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %Foo.decl.loc11: %Foo.type.11c674.2 = fn_decl @Foo.loc11 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %a.param_patt: %pattern_type = value_param_pattern [concrete = constants.%a.param_patt]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = wrapper_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -719,7 +685,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc7(%a.param: %C);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc15(%a.param: %C) {
|
||||
// CHECK:STDOUT: fn @Foo.loc11(%a.param: %C) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -738,7 +704,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc7 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %a.1bf9e8.2: %C = symbolic_binding a, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc15 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc11 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -760,14 +726,14 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.loc7_9.2: %C = symbolic_binding a, 0 [symbolic = %a.loc7_9.1 (constants.%a.1bf9e8.1)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Foo.decl.loc15: %Foo.type.11c674.2 = fn_decl @Foo.loc15 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc15_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %Foo.decl.loc11: %Foo.type.11c674.2 = fn_decl @Foo.loc11 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc11_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc11_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc15: type = splice_block %D.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %D.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.loc15_16.3: %C = symbolic_binding a, 0 [symbolic = %a.loc15_16.2 (constants.%a.1bf9e8.2)]
|
||||
// CHECK:STDOUT: %a.loc11_16.3: %C = symbolic_binding a, 0 [symbolic = %a.loc11_16.2 (constants.%a.1bf9e8.2)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -786,10 +752,10 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: fn();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @Foo.loc15(%a.loc15_16.3: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc15_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc15_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc15_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc15_16.1 (constants.%a.1bf9e8.1)]
|
||||
// CHECK:STDOUT: %a.loc15_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc15_16.2 (constants.%a.1bf9e8.2)]
|
||||
// CHECK:STDOUT: generic fn @Foo.loc11(%a.loc11_16.3: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc11_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc11_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc11_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc11_16.1 (constants.%a.1bf9e8.1)]
|
||||
// CHECK:STDOUT: %a.loc11_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc11_16.2 (constants.%a.1bf9e8.2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
@@ -804,10 +770,10 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a.loc7_9.1 => constants.%a.1bf9e8.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Foo.loc15(constants.%a.1bf9e8.2) {
|
||||
// CHECK:STDOUT: %a.patt.loc15_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc15_16.1 => constants.%a.1bf9e8.2
|
||||
// CHECK:STDOUT: %a.loc15_16.2 => constants.%a.1bf9e8.2
|
||||
// CHECK:STDOUT: specific @Foo.loc11(constants.%a.1bf9e8.2) {
|
||||
// CHECK:STDOUT: %a.patt.loc11_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc11_16.1 => constants.%a.1bf9e8.2
|
||||
// CHECK:STDOUT: %a.loc11_16.2 => constants.%a.1bf9e8.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- todo_fail_alias_in_return.carbon
|
||||
@@ -977,7 +943,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = wrapper_binding_pattern a, %a.param_patt [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.1: type = fn_type @Foo.loc6 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.1: %Foo.type.11c674.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.11c674.2: type = fn_type @Foo.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Foo.12ccef.2: %Foo.type.11c674.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -998,15 +964,15 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: %const = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Foo.decl.loc18: %Foo.type.11c674.2 = fn_decl @Foo.loc18 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %Foo.decl.loc12: %Foo.type.11c674.2 = fn_decl @Foo.loc12 [concrete = constants.%Foo.12ccef.2] {
|
||||
// CHECK:STDOUT: %a.param_patt: %pattern_type = value_param_pattern [concrete = constants.%a.param_patt]
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type = wrapper_binding_pattern a, %a.param_patt [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %a.param: %const = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc18: type = splice_block %const.loc18_18 [concrete = constants.%const] {
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %const.loc12_18 [concrete = constants.%const] {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %const.loc18_25: type = const_type %C.ref [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %const.loc18_18: type = const_type %const.loc18_25 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %const.loc12_25: type = const_type %C.ref [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %const.loc12_18: type = const_type %const.loc12_25 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: %const = wrapper_binding a, %a.param
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1022,7 +988,7 @@ fn Foo(unused a: const (const C)) {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc6(%a.param: %const);
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Foo.loc18(%a.param: %const) {
|
||||
// CHECK:STDOUT: fn @Foo.loc12(%a.param: %const) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+19
-47
@@ -37,12 +37,8 @@ fn CallExplicitGenericParamConst(generic T: type) {
|
||||
}
|
||||
|
||||
fn CallExplicitGenericParamNonConst(T: type) {
|
||||
// CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+7]]:3: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
|
||||
// CHECK:STDERR: ExplicitGenericParam(T);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-10]]:33: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR: fn ExplicitGenericParam(generic T: type) -> T* { return ExplicitGenericParam(T); }
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE+3]]:3-25: error: argument for generic parameter is not a compile-time constant [CompTimeArgumentNotConstant]
|
||||
// CHECK:STDERR: fail_deduce_explicit_non_constant.carbon:[[@LINE-8]]:33-39: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
ExplicitGenericParam(T);
|
||||
}
|
||||
@@ -98,12 +94,8 @@ library "[[@TEST_NAME]]";
|
||||
fn BigStructParam[T: type](unused x: {.c: T, .d: i32, .e: i32}) {}
|
||||
|
||||
fn CallBigStructParam() {
|
||||
// CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: BigStructParam({.c = 3, .d = 4});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn BigStructParam[T: type](unused x: {.c: T, .d: i32, .e: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+3]]:3-34: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-4]]:1-65: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
BigStructParam({.c = 3, .d = 4});
|
||||
}
|
||||
@@ -115,12 +107,8 @@ library "[[@TEST_NAME]]";
|
||||
fn SmallStructParam[T: type](unused x: {.f: T, .g: i32}) {}
|
||||
|
||||
fn CallSmallStructParam() {
|
||||
// CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn SmallStructParam[T: type](unused x: {.f: T, .g: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+3]]:3-44: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-4]]:1-58: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
SmallStructParam({.f = 5, .g = 6, .h = 7});
|
||||
}
|
||||
@@ -132,12 +120,8 @@ library "[[@TEST_NAME]]";
|
||||
fn WrongNameStructParam[T: type](unused x: {.i: T, .different: i32}) {}
|
||||
|
||||
fn CallWrongNameStructParam() {
|
||||
// CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn WrongNameStructParam[T: type](unused x: {.i: T, .different: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+3]]:3-40: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-4]]:1-70: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
WrongNameStructParam({.i = 8, .j = 9});
|
||||
}
|
||||
@@ -149,12 +133,8 @@ library "[[@TEST_NAME]]";
|
||||
fn WrongOrderStructParam[T: type](unused x: {.first: T, .second: i32}) {}
|
||||
|
||||
fn CallWrongOrderStructParam() {
|
||||
// CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn WrongOrderStructParam[T: type](unused x: {.first: T, .second: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+3]]:3-52: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-4]]:1-72: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
WrongOrderStructParam({.second = 11, .first = 10});
|
||||
}
|
||||
@@ -168,12 +148,8 @@ library "[[@TEST_NAME]]";
|
||||
fn ImplicitNotDeducible[T: type, U: type](x: T) -> U;
|
||||
|
||||
fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `U` [DeductionIncomplete]
|
||||
// CHECK:STDERR: ImplicitNotDeducible(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn ImplicitNotDeducible[T: type, U: type](x: T) -> U;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE+3]]:3-26: error: cannot deduce value for generic parameter `U` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_deduce_incomplete.carbon:[[@LINE-4]]:1-53: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
ImplicitNotDeducible(42);
|
||||
}
|
||||
@@ -185,12 +161,8 @@ library "[[@TEST_NAME]]";
|
||||
fn ImplicitNotDeducible[T: type](x: T, y: T) -> T;
|
||||
|
||||
fn CallImplicitNotDeducible() {
|
||||
// CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+7]]:3: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent]
|
||||
// CHECK:STDERR: ImplicitNotDeducible(42, {.x = 12});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn ImplicitNotDeducible[T: type](x: T, y: T) -> T;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE+3]]:3-37: error: inconsistent deductions for value of generic parameter `T` [DeductionInconsistent]
|
||||
// CHECK:STDERR: fail_deduce_inconsistent.carbon:[[@LINE-4]]:1-50: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
ImplicitNotDeducible(42, {.x = 12});
|
||||
}
|
||||
@@ -1383,7 +1355,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %BigStructParam.ref: %BigStructParam.type = name_ref BigStructParam, file.%BigStructParam.decl [concrete = constants.%BigStructParam]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4]
|
||||
// CHECK:STDOUT: %.loc14: %struct_type.c.d = struct_literal (%int_3, %int_4) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc10: %struct_type.c.d = struct_literal (%int_3, %int_4) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1484,7 +1456,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6]
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
|
||||
// CHECK:STDOUT: %.loc14: %struct_type.f.g.h = struct_literal (%int_5, %int_6, %int_7) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc10: %struct_type.f.g.h = struct_literal (%int_5, %int_6, %int_7) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1583,7 +1555,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %WrongNameStructParam.ref: %WrongNameStructParam.type = name_ref WrongNameStructParam, file.%WrongNameStructParam.decl [concrete = constants.%WrongNameStructParam]
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
|
||||
// CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9]
|
||||
// CHECK:STDOUT: %.loc14: %struct_type.i.j = struct_literal (%int_8, %int_9) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc10: %struct_type.i.j = struct_literal (%int_8, %int_9) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1682,7 +1654,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %WrongOrderStructParam.ref: %WrongOrderStructParam.type = name_ref WrongOrderStructParam, file.%WrongOrderStructParam.decl [concrete = constants.%WrongOrderStructParam]
|
||||
// CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete = constants.%int_11]
|
||||
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10]
|
||||
// CHECK:STDOUT: %.loc14: %struct_type.second.first = struct_literal (%int_11, %int_10) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc10: %struct_type.second.first = struct_literal (%int_11, %int_10) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1887,7 +1859,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %ImplicitNotDeducible.ref: %ImplicitNotDeducible.type = name_ref ImplicitNotDeducible, file.%ImplicitNotDeducible.decl [concrete = constants.%ImplicitNotDeducible]
|
||||
// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12]
|
||||
// CHECK:STDOUT: %.loc14: %struct_type.x = struct_literal (%int_12) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc10: %struct_type.x = struct_literal (%int_12) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+11
-19
@@ -25,22 +25,14 @@ import Lib;
|
||||
fn A[T: Lib.Z](unused x: {.a: T}) {}
|
||||
|
||||
fn B() {
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: A({.b = {}});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn A[T: Lib.Z](unused x: {.a: T}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+3]]:3-14: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-4]]:1-35: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
A({.b = {}});
|
||||
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+8]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: Lib.A({.b = {}});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-17]]:1: in import [InImport]
|
||||
// CHECK:STDERR: lib.carbon:4:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn A[T: Z](unused x: {.a: T}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+4]]:3-18: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: imported from: fail_deduce_imported_function.carbon:[[@LINE-11]]:1 [InImport]
|
||||
// CHECK:STDERR: lib.carbon:4:1-31: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
Lib.A({.b = {}});
|
||||
}
|
||||
@@ -232,13 +224,13 @@ fn B() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @B() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %A.ref.loc14: %A.type.9f4 = name_ref A, file.%A.decl [concrete = constants.%A.921]
|
||||
// CHECK:STDOUT: %.loc14_12: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc14_13: %struct_type.b = struct_literal (%.loc14_12) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %A.ref.loc10: %A.type.9f4 = name_ref A, file.%A.decl [concrete = constants.%A.921]
|
||||
// CHECK:STDOUT: %.loc10_12: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc10_13: %struct_type.b = struct_literal (%.loc10_12) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %Lib.ref: <namespace> = name_ref Lib, imports.%Lib [concrete = imports.%Lib]
|
||||
// CHECK:STDOUT: %A.ref.loc24: %A.type.42a = name_ref A, imports.%Lib.A [concrete = constants.%A.b9a]
|
||||
// CHECK:STDOUT: %.loc24_16: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc24_17: %struct_type.b = struct_literal (%.loc24_16) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %A.ref.loc16: %A.type.42a = name_ref A, imports.%Lib.A [concrete = constants.%A.b9a]
|
||||
// CHECK:STDOUT: %.loc16_16: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc16_17: %struct_type.b = struct_literal (%.loc16_16) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -12,12 +12,8 @@
|
||||
|
||||
fn F(generic T: type, generic U: type) {
|
||||
var p: T*;
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused n: U = *p;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:21: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused n: U = *p;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+3]]:21-22: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+2]]:21-22: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused n: U = *p;
|
||||
}
|
||||
+135
-159
@@ -28,20 +28,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(generic T: type, generic U: type) -> T*;
|
||||
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:1: error: function redeclaration differs because return type is `U*` [FunctionRedeclReturnTypeDiffers]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> U* {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-5]]:1: note: previously declared with return type `T*` [FunctionRedeclReturnTypePrevious]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> T*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+3]]:1-46: error: function redeclaration differs because return type is `U*` [FunctionRedeclReturnTypeDiffers]
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-3]]:1-45: note: previously declared with return type `T*` [FunctionRedeclReturnTypePrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(generic T: type, generic U: type) -> U* {
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: return F(T);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-13]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> T*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE+3]]:10-13: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_different_return_type.carbon:[[@LINE-7]]:1-45: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
return F(T);
|
||||
}
|
||||
@@ -52,20 +44,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(generic T: type, generic U: type) -> T*;
|
||||
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:21: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(unused generic U: type, generic T: type) -> T* {
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:14: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> T*;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+3]]:21-27: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE-3]]:14-20: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused generic U: type, generic T: type) -> T* {
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: return F(T);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE-13]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> T*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+3]]:10-13: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE-7]]:1-45: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
return F(T);
|
||||
}
|
||||
@@ -76,20 +60,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(generic T: type, generic U: type) -> T*;
|
||||
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:14: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE-5]]:14: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> T*;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE+3]]:14-20: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE-3]]:14-20: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: return F(T);
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE-13]]:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn F(generic T: type, generic U: type) -> T*;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE+3]]:10-13: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_rename.carbon:[[@LINE-7]]:1-45: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
return F(T);
|
||||
}
|
||||
@@ -219,7 +195,7 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %pattern_type.423: type = pattern_type %ptr.18e [symbolic]
|
||||
// CHECK:STDOUT: %return.param_patt.534: %pattern_type.423 = out_param_pattern [symbolic]
|
||||
// CHECK:STDOUT: %return.patt.669: %pattern_type.423 = return_slot_pattern %return.param_patt.534, %ptr.18e [symbolic]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc13 [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc9 [concrete]
|
||||
// CHECK:STDOUT: %F.7088cc.2: %F.type.eb3ec9.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.18e [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -259,27 +235,27 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc4.%ptr.loc4_44.1 (%ptr.e8f) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc4.%ptr.loc4_44.1 (%ptr.e8f) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc13: %F.type.eb3ec9.2 = fn_decl @F.loc13 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %T.patt.loc13_15.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %U.patt.loc13_32.1: %pattern_type.9a5 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_32.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_44.1: @F.loc13.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc13_44.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc13_40.1: @F.loc13.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc13_44.1, %ptr.loc13_44.2 [symbolic = %return.patt.loc13_40.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT: %F.decl.loc9: %F.type.eb3ec9.2 = fn_decl @F.loc9 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %T.patt.loc9_15.1: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_15.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %U.patt.loc9_32.1: %pattern_type.9a5 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_32.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_44.1: @F.loc9.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc9_44.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc9_40.1: @F.loc9.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc9_44.1, %ptr.loc9_44.2 [symbolic = %return.patt.loc9_40.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc13_32.2 [symbolic = %U.loc13_32.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %ptr.loc13_44.2: type = ptr_type %U.ref [symbolic = %ptr.loc13_44.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_44.2: Core.Form = init_form %ptr.loc13_44.2 [symbolic = %.loc13_44.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %.loc13_17.1: type = splice_block %.loc13_17.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc13_15: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc13_17.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc9_32.2 [symbolic = %U.loc9_32.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %ptr.loc9_44.2: type = ptr_type %U.ref [symbolic = %ptr.loc9_44.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc9_44.2: Core.Form = init_form %ptr.loc9_44.2 [symbolic = %.loc9_44.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %.loc9_17.1: type = splice_block %.loc9_17.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc9_15: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc9_17.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc13_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc13_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc13_34.1: type = splice_block %.loc13_34.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc13_32: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc13_34.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %T.loc9_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc9_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc9_34.1: type = splice_block %.loc9_34.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc9_32: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc9_34.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc13_32.2: type = symbolic_binding U, 1 [symbolic = %U.loc13_32.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_44.1 (%ptr.18e) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_44.1 (%ptr.18e) = return_slot %return.param
|
||||
// CHECK:STDOUT: %U.loc9_32.2: type = symbolic_binding U, 1 [symbolic = %U.loc9_32.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc9.%ptr.loc9_44.1 (%ptr.18e) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc9.%ptr.loc9_44.1 (%ptr.18e) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -297,24 +273,24 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc4.%ptr.loc4_44.1 (%ptr.e8f);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.loc13(%T.loc13_15.2: type, %U.loc13_32.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc13_15.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_15.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc13_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc13_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %U.patt.loc13_32.2: %pattern_type.9a5 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc13_32.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.loc13_32.1: type = symbolic_binding U, 1 [symbolic = %U.loc13_32.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %ptr.loc13_44.1: type = ptr_type %U.loc13_32.1 [symbolic = %ptr.loc13_44.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_44.1: Core.Form = init_form %ptr.loc13_44.1 [symbolic = %.loc13_44.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_44.1 [symbolic = %pattern_type (constants.%pattern_type.423)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_44.2: @F.loc13.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc13_44.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc13_40.2: @F.loc13.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc13_44.2, %ptr.loc13_44.1 [symbolic = %return.patt.loc13_40.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT: generic fn @F.loc9(%T.loc9_15.2: type, %U.loc9_32.2: type) {
|
||||
// CHECK:STDOUT: %T.patt.loc9_15.2: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc9_15.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.loc9_15.1: type = symbolic_binding T, 0 [symbolic = %T.loc9_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %U.patt.loc9_32.2: %pattern_type.9a5 = symbolic_binding_pattern U, 1 [symbolic = %U.patt.loc9_32.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.loc9_32.1: type = symbolic_binding U, 1 [symbolic = %U.loc9_32.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %ptr.loc9_44.1: type = ptr_type %U.loc9_32.1 [symbolic = %ptr.loc9_44.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc9_44.1: Core.Form = init_form %ptr.loc9_44.1 [symbolic = %.loc9_44.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_44.1 [symbolic = %pattern_type (constants.%pattern_type.423)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_44.2: @F.loc9.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc9_44.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc9_40.2: @F.loc9.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc9_44.2, %ptr.loc9_44.1 [symbolic = %return.patt.loc9_40.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc13_44.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc9_44.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_44.1 (%ptr.18e) {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc9.%ptr.loc9_44.1 (%ptr.18e) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type.eb3ec9.1 = name_ref F, file.%F.decl.loc4 [concrete = constants.%F.7088cc.1]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc13_15.2 [symbolic = %T.loc13_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc9_15.2 [symbolic = %T.loc9_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -331,16 +307,16 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %return.patt.loc4_40.2 => constants.%return.patt.d67
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.loc13(constants.%T, constants.%U) {
|
||||
// CHECK:STDOUT: %T.patt.loc13_15.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc13_15.1 => constants.%T
|
||||
// CHECK:STDOUT: %U.patt.loc13_32.2 => constants.%U.patt
|
||||
// CHECK:STDOUT: %U.loc13_32.1 => constants.%U
|
||||
// CHECK:STDOUT: %ptr.loc13_44.1 => constants.%ptr.18e
|
||||
// CHECK:STDOUT: %.loc13_44.1 => constants.%.6d8
|
||||
// CHECK:STDOUT: specific @F.loc9(constants.%T, constants.%U) {
|
||||
// CHECK:STDOUT: %T.patt.loc9_15.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc9_15.1 => constants.%T
|
||||
// CHECK:STDOUT: %U.patt.loc9_32.2 => constants.%U.patt
|
||||
// CHECK:STDOUT: %U.loc9_32.1 => constants.%U
|
||||
// CHECK:STDOUT: %ptr.loc9_44.1 => constants.%ptr.18e
|
||||
// CHECK:STDOUT: %.loc9_44.1 => constants.%.6d8
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.423
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_44.2 => constants.%return.param_patt.534
|
||||
// CHECK:STDOUT: %return.patt.loc13_40.2 => constants.%return.patt.669
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_44.2 => constants.%return.param_patt.534
|
||||
// CHECK:STDOUT: %return.patt.loc9_40.2 => constants.%return.patt.669
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_reorder.carbon
|
||||
@@ -369,7 +345,7 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %pattern_type.423: type = pattern_type %ptr.18e [symbolic]
|
||||
// CHECK:STDOUT: %return.param_patt.534: %pattern_type.423 = out_param_pattern [symbolic]
|
||||
// CHECK:STDOUT: %return.patt.669: %pattern_type.423 = return_slot_pattern %return.param_patt.534, %ptr.18e [symbolic]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc13 [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc9 [concrete]
|
||||
// CHECK:STDOUT: %F.7088cc.2: %F.type.eb3ec9.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.18e [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -409,27 +385,27 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc4.%ptr.loc4_44.1 (%ptr.e8f) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc4.%ptr.loc4_44.1 (%ptr.e8f) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc13: %F.type.eb3ec9.2 = fn_decl @F.loc13 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %U.patt.loc13_22.1: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_22.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %T.patt.loc13_39.1: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_39.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_51.1: @F.loc13.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc13_51.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc13_47.1: @F.loc13.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc13_51.1, %ptr.loc13_51.2 [symbolic = %return.patt.loc13_47.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT: %F.decl.loc9: %F.type.eb3ec9.2 = fn_decl @F.loc9 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %U.patt.loc9_22.1: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_22.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %T.patt.loc9_39.1: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc9_39.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_51.1: @F.loc9.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc9_51.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc9_47.1: @F.loc9.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc9_51.1, %ptr.loc9_51.2 [symbolic = %return.patt.loc9_47.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13_39.2 [symbolic = %T.loc13_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_51.2: type = ptr_type %T.ref.loc13 [symbolic = %ptr.loc13_51.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_51.2: Core.Form = init_form %ptr.loc13_51.2 [symbolic = %.loc13_51.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %.loc13_24.1: type = splice_block %.loc13_24.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc13_22: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc13_24.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %T.ref.loc9: type = name_ref T, %T.loc9_39.2 [symbolic = %T.loc9_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc9_51.2: type = ptr_type %T.ref.loc9 [symbolic = %ptr.loc9_51.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc9_51.2: Core.Form = init_form %ptr.loc9_51.2 [symbolic = %.loc9_51.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %.loc9_24.1: type = splice_block %.loc9_24.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc9_22: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc9_24.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc13_22.2: type = symbolic_binding U, 0 [symbolic = %U.loc13_22.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %.loc13_41.1: type = splice_block %.loc13_41.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc13_39: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc13_41.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %U.loc9_22.2: type = symbolic_binding U, 0 [symbolic = %U.loc9_22.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %.loc9_41.1: type = splice_block %.loc9_41.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc9_39: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc9_41.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc13_39.2: type = symbolic_binding T, 1 [symbolic = %T.loc13_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_51.1 (%ptr.18e) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_51.1 (%ptr.18e) = return_slot %return.param
|
||||
// CHECK:STDOUT: %T.loc9_39.2: type = symbolic_binding T, 1 [symbolic = %T.loc9_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc9.%ptr.loc9_51.1 (%ptr.18e) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc9.%ptr.loc9_51.1 (%ptr.18e) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -447,24 +423,24 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc4.%ptr.loc4_44.1 (%ptr.e8f);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.loc13(%U.loc13_22.2: type, %T.loc13_39.2: type) {
|
||||
// CHECK:STDOUT: %U.patt.loc13_22.2: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_22.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %U.loc13_22.1: type = symbolic_binding U, 0 [symbolic = %U.loc13_22.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %T.patt.loc13_39.2: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_39.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %T.loc13_39.1: type = symbolic_binding T, 1 [symbolic = %T.loc13_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_51.1: type = ptr_type %T.loc13_39.1 [symbolic = %ptr.loc13_51.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_51.1: Core.Form = init_form %ptr.loc13_51.1 [symbolic = %.loc13_51.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_51.1 [symbolic = %pattern_type (constants.%pattern_type.423)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_51.2: @F.loc13.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc13_51.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc13_47.2: @F.loc13.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc13_51.2, %ptr.loc13_51.1 [symbolic = %return.patt.loc13_47.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT: generic fn @F.loc9(%U.loc9_22.2: type, %T.loc9_39.2: type) {
|
||||
// CHECK:STDOUT: %U.patt.loc9_22.2: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_22.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %U.loc9_22.1: type = symbolic_binding U, 0 [symbolic = %U.loc9_22.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %T.patt.loc9_39.2: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc9_39.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %T.loc9_39.1: type = symbolic_binding T, 1 [symbolic = %T.loc9_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc9_51.1: type = ptr_type %T.loc9_39.1 [symbolic = %ptr.loc9_51.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc9_51.1: Core.Form = init_form %ptr.loc9_51.1 [symbolic = %.loc9_51.1 (constants.%.6d8)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_51.1 [symbolic = %pattern_type (constants.%pattern_type.423)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_51.2: @F.loc9.%pattern_type (%pattern_type.423) = out_param_pattern [symbolic = %return.param_patt.loc9_51.2 (constants.%return.param_patt.534)]
|
||||
// CHECK:STDOUT: %return.patt.loc9_47.2: @F.loc9.%pattern_type (%pattern_type.423) = return_slot_pattern %return.param_patt.loc9_51.2, %ptr.loc9_51.1 [symbolic = %return.patt.loc9_47.2 (constants.%return.patt.669)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc13_51.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc9_51.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_51.1 (%ptr.18e) {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc9.%ptr.loc9_51.1 (%ptr.18e) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type.eb3ec9.1 = name_ref F, file.%F.decl.loc4 [concrete = constants.%F.7088cc.1]
|
||||
// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13_39.2 [symbolic = %T.loc13_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc9_39.2 [symbolic = %T.loc9_39.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -481,16 +457,16 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %return.patt.loc4_40.2 => constants.%return.patt.d67
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.loc13(constants.%U.67d, constants.%T.091) {
|
||||
// CHECK:STDOUT: %U.patt.loc13_22.2 => constants.%U.patt.3a0
|
||||
// CHECK:STDOUT: %U.loc13_22.1 => constants.%U.67d
|
||||
// CHECK:STDOUT: %T.patt.loc13_39.2 => constants.%T.patt.cb8
|
||||
// CHECK:STDOUT: %T.loc13_39.1 => constants.%T.091
|
||||
// CHECK:STDOUT: %ptr.loc13_51.1 => constants.%ptr.18e
|
||||
// CHECK:STDOUT: %.loc13_51.1 => constants.%.6d8
|
||||
// CHECK:STDOUT: specific @F.loc9(constants.%U.67d, constants.%T.091) {
|
||||
// CHECK:STDOUT: %U.patt.loc9_22.2 => constants.%U.patt.3a0
|
||||
// CHECK:STDOUT: %U.loc9_22.1 => constants.%U.67d
|
||||
// CHECK:STDOUT: %T.patt.loc9_39.2 => constants.%T.patt.cb8
|
||||
// CHECK:STDOUT: %T.loc9_39.1 => constants.%T.091
|
||||
// CHECK:STDOUT: %ptr.loc9_51.1 => constants.%ptr.18e
|
||||
// CHECK:STDOUT: %.loc9_51.1 => constants.%.6d8
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.423
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_51.2 => constants.%return.param_patt.534
|
||||
// CHECK:STDOUT: %return.patt.loc13_47.2 => constants.%return.patt.669
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_51.2 => constants.%return.param_patt.534
|
||||
// CHECK:STDOUT: %return.patt.loc9_47.2 => constants.%return.patt.669
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_rename.carbon
|
||||
@@ -519,7 +495,7 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %pattern_type.4f4b84.2: type = pattern_type %ptr.e8f8f9.2 [symbolic]
|
||||
// CHECK:STDOUT: %return.param_patt.27f587.2: %pattern_type.4f4b84.2 = out_param_pattern [symbolic]
|
||||
// CHECK:STDOUT: %return.patt.d67681.2: %pattern_type.4f4b84.2 = return_slot_pattern %return.param_patt.27f587.2, %ptr.e8f8f9.2 [symbolic]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc13 [concrete]
|
||||
// CHECK:STDOUT: %F.type.eb3ec9.2: type = fn_type @F.loc9 [concrete]
|
||||
// CHECK:STDOUT: %F.7088cc.2: %F.type.eb3ec9.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.e8f8f9.2 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -559,27 +535,27 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc4.%ptr.loc4_44.1 (%ptr.e8f8f9.1) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc4.%ptr.loc4_44.1 (%ptr.e8f8f9.1) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %F.decl.loc13: %F.type.eb3ec9.2 = fn_decl @F.loc13 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %U.patt.loc13_15.1: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_15.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %T.patt.loc13_32.1: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_32.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_44.1: @F.loc13.%pattern_type (%pattern_type.4f4b84.2) = out_param_pattern [symbolic = %return.param_patt.loc13_44.2 (constants.%return.param_patt.27f587.2)]
|
||||
// CHECK:STDOUT: %return.patt.loc13_40.1: @F.loc13.%pattern_type (%pattern_type.4f4b84.2) = return_slot_pattern %return.param_patt.loc13_44.1, %ptr.loc13_44.2 [symbolic = %return.patt.loc13_40.2 (constants.%return.patt.d67681.2)]
|
||||
// CHECK:STDOUT: %F.decl.loc9: %F.type.eb3ec9.2 = fn_decl @F.loc9 [concrete = constants.%F.7088cc.2] {
|
||||
// CHECK:STDOUT: %U.patt.loc9_15.1: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_15.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %T.patt.loc9_32.1: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc9_32.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_44.1: @F.loc9.%pattern_type (%pattern_type.4f4b84.2) = out_param_pattern [symbolic = %return.param_patt.loc9_44.2 (constants.%return.param_patt.27f587.2)]
|
||||
// CHECK:STDOUT: %return.patt.loc9_40.1: @F.loc9.%pattern_type (%pattern_type.4f4b84.2) = return_slot_pattern %return.param_patt.loc9_44.1, %ptr.loc9_44.2 [symbolic = %return.patt.loc9_40.2 (constants.%return.patt.d67681.2)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc13_15.2 [symbolic = %U.loc13_15.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %ptr.loc13_44.2: type = ptr_type %U.ref [symbolic = %ptr.loc13_44.1 (constants.%ptr.e8f8f9.2)]
|
||||
// CHECK:STDOUT: %.loc13_44.2: Core.Form = init_form %ptr.loc13_44.2 [symbolic = %.loc13_44.1 (constants.%.cb6cb9.2)]
|
||||
// CHECK:STDOUT: %.loc13_17.1: type = splice_block %.loc13_17.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc13_15: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc13_17.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %U.ref: type = name_ref U, %U.loc9_15.2 [symbolic = %U.loc9_15.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %ptr.loc9_44.2: type = ptr_type %U.ref [symbolic = %ptr.loc9_44.1 (constants.%ptr.e8f8f9.2)]
|
||||
// CHECK:STDOUT: %.loc9_44.2: Core.Form = init_form %ptr.loc9_44.2 [symbolic = %.loc9_44.1 (constants.%.cb6cb9.2)]
|
||||
// CHECK:STDOUT: %.loc9_17.1: type = splice_block %.loc9_17.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc9_15: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc9_17.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc13_15.2: type = symbolic_binding U, 0 [symbolic = %U.loc13_15.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %.loc13_34.1: type = splice_block %.loc13_34.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc13_32: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc13_34.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %U.loc9_15.2: type = symbolic_binding U, 0 [symbolic = %U.loc9_15.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %.loc9_34.1: type = splice_block %.loc9_34.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen.loc9_32: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc9_34.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc13_32.2: type = symbolic_binding T, 1 [symbolic = %T.loc13_32.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_44.1 (%ptr.e8f8f9.2) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_44.1 (%ptr.e8f8f9.2) = return_slot %return.param
|
||||
// CHECK:STDOUT: %T.loc9_32.2: type = symbolic_binding T, 1 [symbolic = %T.loc9_32.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc9.%ptr.loc9_44.1 (%ptr.e8f8f9.2) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc9.%ptr.loc9_44.1 (%ptr.e8f8f9.2) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -597,24 +573,24 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc4.%ptr.loc4_44.1 (%ptr.e8f8f9.1);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.loc13(%U.loc13_15.2: type, %T.loc13_32.2: type) {
|
||||
// CHECK:STDOUT: %U.patt.loc13_15.2: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc13_15.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %U.loc13_15.1: type = symbolic_binding U, 0 [symbolic = %U.loc13_15.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %T.patt.loc13_32.2: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc13_32.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %T.loc13_32.1: type = symbolic_binding T, 1 [symbolic = %T.loc13_32.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_44.1: type = ptr_type %U.loc13_15.1 [symbolic = %ptr.loc13_44.1 (constants.%ptr.e8f8f9.2)]
|
||||
// CHECK:STDOUT: %.loc13_44.1: Core.Form = init_form %ptr.loc13_44.1 [symbolic = %.loc13_44.1 (constants.%.cb6cb9.2)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_44.1 [symbolic = %pattern_type (constants.%pattern_type.4f4b84.2)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_44.2: @F.loc13.%pattern_type (%pattern_type.4f4b84.2) = out_param_pattern [symbolic = %return.param_patt.loc13_44.2 (constants.%return.param_patt.27f587.2)]
|
||||
// CHECK:STDOUT: %return.patt.loc13_40.2: @F.loc13.%pattern_type (%pattern_type.4f4b84.2) = return_slot_pattern %return.param_patt.loc13_44.2, %ptr.loc13_44.1 [symbolic = %return.patt.loc13_40.2 (constants.%return.patt.d67681.2)]
|
||||
// CHECK:STDOUT: generic fn @F.loc9(%U.loc9_15.2: type, %T.loc9_32.2: type) {
|
||||
// CHECK:STDOUT: %U.patt.loc9_15.2: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc9_15.2 (constants.%U.patt.3a0)]
|
||||
// CHECK:STDOUT: %U.loc9_15.1: type = symbolic_binding U, 0 [symbolic = %U.loc9_15.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %T.patt.loc9_32.2: %pattern_type.9a5 = symbolic_binding_pattern T, 1 [symbolic = %T.patt.loc9_32.2 (constants.%T.patt.cb8)]
|
||||
// CHECK:STDOUT: %T.loc9_32.1: type = symbolic_binding T, 1 [symbolic = %T.loc9_32.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc9_44.1: type = ptr_type %U.loc9_15.1 [symbolic = %ptr.loc9_44.1 (constants.%ptr.e8f8f9.2)]
|
||||
// CHECK:STDOUT: %.loc9_44.1: Core.Form = init_form %ptr.loc9_44.1 [symbolic = %.loc9_44.1 (constants.%.cb6cb9.2)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc9_44.1 [symbolic = %pattern_type (constants.%pattern_type.4f4b84.2)]
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_44.2: @F.loc9.%pattern_type (%pattern_type.4f4b84.2) = out_param_pattern [symbolic = %return.param_patt.loc9_44.2 (constants.%return.param_patt.27f587.2)]
|
||||
// CHECK:STDOUT: %return.patt.loc9_40.2: @F.loc9.%pattern_type (%pattern_type.4f4b84.2) = return_slot_pattern %return.param_patt.loc9_44.2, %ptr.loc9_44.1 [symbolic = %return.patt.loc9_40.2 (constants.%return.patt.d67681.2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc13_44.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc9_44.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_44.1 (%ptr.e8f8f9.2) {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc9.%ptr.loc9_44.1 (%ptr.e8f8f9.2) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type.eb3ec9.1 = name_ref F, file.%F.decl.loc4 [concrete = constants.%F.7088cc.1]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc13_32.2 [symbolic = %T.loc13_32.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc9_32.2 [symbolic = %T.loc9_32.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -631,15 +607,15 @@ fn F(generic U: type, generic T: type) -> U* {
|
||||
// CHECK:STDOUT: %return.patt.loc4_40.2 => constants.%return.patt.d67681.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.loc13(constants.%U.67d, constants.%T.091) {
|
||||
// CHECK:STDOUT: %U.patt.loc13_15.2 => constants.%U.patt.3a0
|
||||
// CHECK:STDOUT: %U.loc13_15.1 => constants.%U.67d
|
||||
// CHECK:STDOUT: %T.patt.loc13_32.2 => constants.%T.patt.cb8
|
||||
// CHECK:STDOUT: %T.loc13_32.1 => constants.%T.091
|
||||
// CHECK:STDOUT: %ptr.loc13_44.1 => constants.%ptr.e8f8f9.2
|
||||
// CHECK:STDOUT: %.loc13_44.1 => constants.%.cb6cb9.2
|
||||
// CHECK:STDOUT: specific @F.loc9(constants.%U.67d, constants.%T.091) {
|
||||
// CHECK:STDOUT: %U.patt.loc9_15.2 => constants.%U.patt.3a0
|
||||
// CHECK:STDOUT: %U.loc9_15.1 => constants.%U.67d
|
||||
// CHECK:STDOUT: %T.patt.loc9_32.2 => constants.%T.patt.cb8
|
||||
// CHECK:STDOUT: %T.loc9_32.1 => constants.%T.091
|
||||
// CHECK:STDOUT: %ptr.loc9_44.1 => constants.%ptr.e8f8f9.2
|
||||
// CHECK:STDOUT: %.loc9_44.1 => constants.%.cb6cb9.2
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.4f4b84.2
|
||||
// CHECK:STDOUT: %return.param_patt.loc13_44.2 => constants.%return.param_patt.27f587.2
|
||||
// CHECK:STDOUT: %return.patt.loc13_40.2 => constants.%return.patt.d67681.2
|
||||
// CHECK:STDOUT: %return.param_patt.loc9_44.2 => constants.%return.param_patt.27f587.2
|
||||
// CHECK:STDOUT: %return.patt.loc9_40.2 => constants.%return.patt.d67681.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -25,15 +25,9 @@ fn ErrorIfNIsZero(generic N: Core.IntLiteral) {
|
||||
}
|
||||
|
||||
fn CallNegative() {
|
||||
// CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+10]]:3: error: unable to monomorphize specific `ErrorIfNIsZero(0)` [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: ErrorIfNIsZero(0);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE-7]]:17: note: `Core.Int(N)` evaluates to incomplete type `i0` [IncompleteTypeInMonomorphization]
|
||||
// CHECK:STDERR: var unused v: Core.Int(N);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:11:9: note: integer type width of 0 is not positive [IntWidthNotPositive]
|
||||
// CHECK:STDERR: adapt MakeInt(N);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+4]]:3-16: error: unable to monomorphize specific `ErrorIfNIsZero(0)` [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE-5]]:17-27: note: `Core.Int(N)` evaluates to incomplete type `i0` [IncompleteTypeInMonomorphization]
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:11:9-18: note: integer type width of 0 is not positive [IntWidthNotPositive]
|
||||
// CHECK:STDERR:
|
||||
ErrorIfNIsZero(0);
|
||||
}
|
||||
|
||||
@@ -39,12 +39,8 @@ library "[[@TEST_NAME]]";
|
||||
fn Undefined[T: type](x: T);
|
||||
|
||||
fn CallUndefined() {
|
||||
// CHECK:STDERR: fail_call_undefined.carbon:[[@LINE+7]]:3: error: use of undefined generic function [MissingGenericFunctionDefinition]
|
||||
// CHECK:STDERR: Undefined(0 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_undefined.carbon:[[@LINE-6]]:1: note: generic function declared here [MissingGenericFunctionDefinitionHere]
|
||||
// CHECK:STDERR: fn Undefined[T: type](x: T);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_undefined.carbon:[[@LINE+3]]:3-11: error: use of undefined generic function [MissingGenericFunctionDefinition]
|
||||
// CHECK:STDERR: fail_call_undefined.carbon:[[@LINE-4]]:1-28: note: generic function declared here [MissingGenericFunctionDefinitionHere]
|
||||
// CHECK:STDERR:
|
||||
Undefined(0 as i32);
|
||||
}
|
||||
Reference in new issue
Block a user