mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 17:48:11 +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
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user