mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-10 12:28:25 +00:00
Rework the initial terminal rendering into the form the design landed on (#7994)
There were a number of iterations on the design that weren't reflected in the initial port to the terminal rendering library. This PR tries to complete the rendering side of things to match the design we landed on: code-focused, with messages attached by lines to the code, and condensed as much as possible to avoid the vertical space. It also improves the styling to make things more visually distinguishable such as adding a `->` to the main error line, and making the underlines and connectors for it have a heavy weight (when the font supports that). Another major change is having multiple messages on a single line be drawn in source lexical order. This requires the connectors to cross without joining, but makes it easier to read the messages. This PR also has some refactorings to enable these improvements, and a _number_ of improvements to comment prose and terminology to try and avoid jargon and make things read more naturally. Sorry for the fact that Claude left a bunch of this mannerly language in comments despite my efforts, but I'm continuing to try and drive the prose towards something direct and simple to read. Some of the terminology improvements also needed to be made in the design doc and those have been made here. Note that I don't think this rendering is perfect or should be viewed as final. I'm happy to iterate on it further, and have a few adjustments in mind already, but would like to focus this on getting the _implementation_ of the current rendering design in place, and then we can make targeted changes or tweaks as needed. For example, I'm not yet fully happy with the rendering when messages are too long and we move them all the way to the left, but am leaving that for a follow-up. Assisted-by: Claude Code
This commit is contained in:
1 parent
5a614167c2
commit
c608c35e12
79 files changed
+3110
-2567
No files matched your search
@@ -44,8 +44,7 @@ library "[[@TEST_NAME]]";
|
||||
import library "builtin";
|
||||
|
||||
let c: CharLiteral = 'a';
|
||||
// CHECK:STDERR: fail_runtime_call.carbon:[[@LINE+4]]:18-26: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: imported from: fail_runtime_call.carbon:[[@LINE-4]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_runtime_call.carbon:[[@LINE+3]]:18-26: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: builtin.carbon:10:1-38: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
let d: UInt(8) = ToChar(c);
|
||||
|
||||
@@ -138,8 +138,7 @@ import library "f64";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
let not_constant_64: f64 = 0.0;
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+4]]:33-65: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: imported from: fail_not_constant.carbon:[[@LINE-5]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:33-65: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: f64.carbon:5:1-36: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
|
||||
@@ -790,10 +789,10 @@ let convert_not_constant: f64 = Float64ToFloat64(not_constant_64);
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %not_constant_64.patt: %pattern_type.667 = value_binding_pattern not_constant_64 [concrete = constants.%not_constant_64.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc11_65.1: %f64.761 = value_of_initializer @__global_init.%Float64ToFloat64.call
|
||||
// CHECK:STDOUT: %.loc11_65.2: %f64.761 = converted @__global_init.%Float64ToFloat64.call, %.loc11_65.1
|
||||
// CHECK:STDOUT: %f64.loc11: type = type_literal constants.%f64.761 [concrete = constants.%f64.761]
|
||||
// CHECK:STDOUT: %convert_not_constant: %f64.761 = wrapper_binding convert_not_constant, %.loc11_65.2
|
||||
// CHECK:STDOUT: %.loc10_65.1: %f64.761 = value_of_initializer @__global_init.%Float64ToFloat64.call
|
||||
// CHECK:STDOUT: %.loc10_65.2: %f64.761 = converted @__global_init.%Float64ToFloat64.call, %.loc10_65.1
|
||||
// CHECK:STDOUT: %f64.loc10: type = type_literal constants.%f64.761 [concrete = constants.%f64.761]
|
||||
// CHECK:STDOUT: %convert_not_constant: %f64.761 = wrapper_binding convert_not_constant, %.loc10_65.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %convert_not_constant.patt: %pattern_type.667 = value_binding_pattern convert_not_constant [concrete = constants.%convert_not_constant.patt]
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+1
-2
@@ -241,8 +241,7 @@ import library "int_ops";
|
||||
|
||||
let not_constant: Core.IntLiteral = 0;
|
||||
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+4]]:33-63: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: imported from: fail_not_constant.carbon:[[@LINE-5]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:33-63: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: int_ops.carbon:16:1-49: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
let convert_not_constant: i16 = IntLiteralToInt16(not_constant);
|
||||
|
||||
@@ -215,20 +215,17 @@ import library "int_ops";
|
||||
|
||||
let not_constant: i32 = 0;
|
||||
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+4]]:40-65: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: imported from: fail_not_constant.carbon:[[@LINE-5]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:40-65: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: int_ops.carbon:19:1-32: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
let convert_not_constant_narrow: i16 = Int32ToInt16(not_constant);
|
||||
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+4]]:38-63: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: imported from: fail_not_constant.carbon:[[@LINE-11]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:38-63: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: int_ops.carbon:11:1-32: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
let convert_not_constant_same: i32 = Int32ToInt32(not_constant);
|
||||
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+4]]:39-64: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: imported from: fail_not_constant.carbon:[[@LINE-17]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_not_constant.carbon:[[@LINE+3]]:39-64: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: int_ops.carbon:27:1-32: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
let convert_not_constant_widen: i64 = Int32ToInt64(not_constant);
|
||||
|
||||
+12
-14
@@ -62,9 +62,8 @@ var c: Other.C = {};
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_todo_merge_define_extern.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_todo_merge_define_extern.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: other_extern.carbon:4:1-15: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_todo_merge_define_extern.carbon:[[@LINE+2]]:1 [InImport]
|
||||
// CHECK:STDERR: other_define.carbon:4:1-9: note: name is previously declared here [NameDeclPrevious]
|
||||
import Other library "other_define";
|
||||
import Other library "other_extern";
|
||||
@@ -77,9 +76,8 @@ var c: Other.C = {};
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: other_conflict.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+2]]:1 [InImport]
|
||||
// CHECK:STDERR: other_define.carbon:4:1-9: note: name is previously declared here [NameDeclPrevious]
|
||||
import Other library "other_define";
|
||||
import Other library "other_conflict";
|
||||
@@ -327,7 +325,7 @@ var c: Other.C = {};
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Other.import = import Other
|
||||
// CHECK:STDOUT: %c.var: ref %C = var_storage %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc13: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -347,10 +345,10 @@ var c: Other.C = {};
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc13_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc13_19.2: init %C to file.%c.var = class_init () [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc13_1: init %C = converted %.loc13_19.1, %.loc13_19.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13_1
|
||||
// CHECK:STDOUT: %.loc12_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc12_19.2: init %C to file.%c.var = class_init () [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc12_1: init %C = converted %.loc12_19.1, %.loc12_19.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -392,7 +390,7 @@ var c: Other.C = {};
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Other.import = import Other
|
||||
// CHECK:STDOUT: %c.var: ref %C = var_storage %c.var_patt [concrete]
|
||||
// CHECK:STDOUT: %.loc13: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -412,10 +410,10 @@ var c: Other.C = {};
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc13_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc13_19.2: init %C to file.%c.var = class_init () [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc13_1: init %C = converted %.loc13_19.1, %.loc13_19.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc13_1
|
||||
// CHECK:STDOUT: %.loc12_19.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc12_19.2: init %C to file.%c.var = class_init () [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc12_1: init %C = converted %.loc12_19.1, %.loc12_19.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: assign file.%c.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+10
-20
@@ -114,9 +114,8 @@ extern class C;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_import_extern_decl_then_decl.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_import_extern_decl_then_decl.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: decl.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_extern_decl_then_decl.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "extern_decl";
|
||||
@@ -126,9 +125,8 @@ import library "decl";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_import_decl_then_extern_decl.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_import_decl_then_extern_decl.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_decl_then_extern_decl.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: decl.carbon:4:1-8: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "decl";
|
||||
@@ -138,9 +136,8 @@ import library "extern_decl";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_import_extern_decl_then_def.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_import_extern_decl_then_def.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: def.carbon:4:1-9: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_extern_decl_then_def.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "extern_decl";
|
||||
@@ -150,14 +147,12 @@ import library "def";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_import_ownership_conflict.carbon:[[@LINE+10]]:1 [InImport]
|
||||
// CHECK:STDERR: decl.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_ownership_conflict.carbon:[[@LINE+8]]:1 [InImport]
|
||||
// CHECK:STDERR: decl.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: imported from: fail_import_ownership_conflict.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_import_ownership_conflict.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: def.carbon:4:1-9: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_ownership_conflict.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "extern_decl";
|
||||
@@ -168,9 +163,8 @@ import library "def";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_todo_import_extern_decl_copy.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_todo_import_extern_decl_copy.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_decl_copy.carbon:4:1-15: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_todo_import_extern_decl_copy.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "extern_decl";
|
||||
@@ -182,8 +176,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_decl";
|
||||
|
||||
// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+4]]:1-15: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_extern_decl_after_import_extern_decl.carbon:[[@LINE+3]]:1-15: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: extern_decl.carbon:4:1-15: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern class C;
|
||||
@@ -194,8 +187,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "decl";
|
||||
|
||||
// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+4]]:1-15: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_decl_after_import_extern_decl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_decl_after_import_extern_decl.carbon:[[@LINE+3]]:1-15: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: decl.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern class C;
|
||||
@@ -206,8 +198,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "def";
|
||||
|
||||
// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+4]]:1-15: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_def_after_import_extern_decl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_def_after_import_extern_decl.carbon:[[@LINE+3]]:1-15: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: def.carbon:4:1-9: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern class C;
|
||||
@@ -218,8 +209,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "def";
|
||||
|
||||
// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+4]]:1-15: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_decl_after_import_def.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_extern_decl_after_import_def.carbon:[[@LINE+3]]:1-15: error: redeclarations of `class C` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: def.carbon:4:1-9: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern class C;
|
||||
|
||||
@@ -25,15 +25,14 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "a";
|
||||
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1-13: error: redeclaration of `class Empty` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_b.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:1-13: error: redeclaration of `class Empty` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: a.carbon:4:1-13: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
class Empty {
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:8-17: error: binding pattern has incomplete type `Incomplete` in name binding declaration [IncompleteTypeInBindingDecl]
|
||||
// CHECK:STDERR: imported from: fail_b.carbon:[[@LINE-10]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_b.carbon:[[@LINE-9]]:1 [InImport]
|
||||
// CHECK:STDERR: a.carbon:7:1-17: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
var a: Incomplete;
|
||||
+14
-15
@@ -68,8 +68,7 @@ fn Use() {
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+4]]:13-19: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported from: fail_foo.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_foo.impl.carbon:[[@LINE+3]]:13-19: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: foo.carbon:4:13-19: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
class Class(U: type) {
|
||||
@@ -982,9 +981,9 @@ class Class(U: type) {
|
||||
// CHECK:STDOUT: %Class.generic.d9d1e3.1: %Class.type.e90e5c.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type.9a5 = symbolic_binding_pattern T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Class.type.e90e5c.2: type = parameterized_class_name_type @Class.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Class.type.e90e5c.2: type = parameterized_class_name_type @Class.loc7 [concrete]
|
||||
// CHECK:STDOUT: %Class.generic.d9d1e3.2: %Class.type.e90e5c.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Class.d9697b.2: type = class_type @Class.loc8, @Class.loc8(%U) [symbolic]
|
||||
// CHECK:STDOUT: %Class.d9697b.2: type = class_type @Class.loc7, @Class.loc7(%U) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -1009,14 +1008,14 @@ class Class(U: type) {
|
||||
// CHECK:STDOUT: %default.import.loc2_19.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc2_19.2 = import <none>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Class.decl: %Class.type.e90e5c.2 = class_decl @Class.loc8 [concrete = constants.%Class.generic.d9d1e3.2] {
|
||||
// CHECK:STDOUT: %U.patt.loc8_14.1: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_14.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %Class.decl: %Class.type.e90e5c.2 = class_decl @Class.loc7 [concrete = constants.%Class.generic.d9d1e3.2] {
|
||||
// CHECK:STDOUT: %U.patt.loc7_14.1: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc7_14.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8_16.1: type = splice_block %.loc8_16.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.loc7_16.1: type = splice_block %.loc7_16.2 [concrete = type] {
|
||||
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %.loc8_16.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: %.loc7_16.2: type = type_literal type [concrete = type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %U.loc8_14.2: type = symbolic_binding U, 0 [symbolic = %U.loc8_14.1 (constants.%U)]
|
||||
// CHECK:STDOUT: %U.loc7_14.2: type = symbolic_binding U, 0 [symbolic = %U.loc7_14.1 (constants.%U)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1027,9 +1026,9 @@ class Class(U: type) {
|
||||
// CHECK:STDOUT: class;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @Class.loc8(%U.loc8_14.2: type) {
|
||||
// CHECK:STDOUT: %U.patt.loc8_14.2: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc8_14.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.loc8_14.1: type = symbolic_binding U, 0 [symbolic = %U.loc8_14.1 (constants.%U)]
|
||||
// CHECK:STDOUT: generic class @Class.loc7(%U.loc7_14.2: type) {
|
||||
// CHECK:STDOUT: %U.patt.loc7_14.2: %pattern_type.9a5 = symbolic_binding_pattern U, 0 [symbolic = %U.patt.loc7_14.2 (constants.%U.patt)]
|
||||
// CHECK:STDOUT: %U.loc7_14.1: type = symbolic_binding U, 0 [symbolic = %U.loc7_14.1 (constants.%U)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
@@ -1052,8 +1051,8 @@ class Class(U: type) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Class.loc8(constants.%U) {
|
||||
// CHECK:STDOUT: %U.patt.loc8_14.2 => constants.%U.patt
|
||||
// CHECK:STDOUT: %U.loc8_14.1 => constants.%U
|
||||
// CHECK:STDOUT: specific @Class.loc7(constants.%U) {
|
||||
// CHECK:STDOUT: %U.patt.loc7_14.2 => constants.%U.patt
|
||||
// CHECK:STDOUT: %U.loc7_14.1 => constants.%U
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+6
-9
@@ -34,8 +34,7 @@ class C {}
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+4]]:1-8: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_redecl_after_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+3]]:1-8: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: redecl_after_def.carbon:4:1-9: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
class C;
|
||||
@@ -50,8 +49,7 @@ class C {}
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+4]]:1-9: error: redefinition of `class C` [RedeclRedef]
|
||||
// CHECK:STDERR: imported from: fail_redef_after_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+3]]:1-9: error: redefinition of `class C` [RedeclRedef]
|
||||
// CHECK:STDERR: redef_after_def.carbon:4:1-9: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
class C {}
|
||||
@@ -67,8 +65,7 @@ alias B = C;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+4]]:7: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_def_alias.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+3]]:7: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
class B {}
|
||||
@@ -200,7 +197,7 @@ class B {}
|
||||
// CHECK:STDOUT: %C.08d9e3.1: type = class_type @C.1 [concrete]
|
||||
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
||||
// CHECK:STDOUT: %C.08d9e3.2: type = class_type @C.loc8 [concrete]
|
||||
// CHECK:STDOUT: %C.08d9e3.2: type = class_type @C.loc7 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -215,7 +212,7 @@ class B {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import.loc2_31.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc2_31.2 = import <none>
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C.loc8 [concrete = constants.%C.08d9e3.2] {} {}
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C.loc7 [concrete = constants.%C.08d9e3.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C.1 [from "redef_after_def.carbon"] {
|
||||
@@ -225,7 +222,7 @@ class B {}
|
||||
// CHECK:STDOUT: .Self = imports.%Main.import_ref.e47
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: class @C.loc8 {
|
||||
// CHECK:STDOUT: class @C.loc7 {
|
||||
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
||||
// CHECK:STDOUT: complete_type_witness = %complete_type
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -52,8 +52,7 @@ class C;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+6]]:1-8: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+5]]:1-8: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: decl_in_api_decl_in_impl.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+2]]:1-8: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
@@ -70,8 +69,7 @@ class D;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+4]]:1-8: error: redeclaration of `class 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: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+3]]:1-8: error: redeclaration of `class D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: decl_in_api_decl_and_definition_in_impl.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
class D;
|
||||
|
||||
@@ -63,8 +63,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "basic";
|
||||
|
||||
// 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: fail_extern_library_in_importer.carbon:[[@LINE+3]]:1-30: error: cannot declare imported `fn F` as `extern library` [ExternLibraryInImporter]
|
||||
// CHECK:STDERR: basic.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern library "basic" fn F();
|
||||
|
||||
@@ -32,8 +32,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// 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: fail_extern_library_nonowner.carbon:[[@LINE+3]]:1-14: error: declaration in library "extern_library_nonowner" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-45: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
@@ -44,8 +43,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// 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: fail_extern_library_nonextern.carbon:[[@LINE+3]]:1-7: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-45: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F();
|
||||
@@ -56,8 +54,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// 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: fail_extern_library_redecl.carbon:[[@LINE+3]]:1-45: error: declaration in library "extern_library_redecl" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// 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();
|
||||
@@ -72,9 +69,8 @@ extern library "extern_library_owner" fn F();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_extern_library_collision.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_extern_library_collision.carbon:[[@LINE+4]]: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";
|
||||
@@ -118,8 +114,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_of_import";
|
||||
|
||||
// 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: fail_extern_of_import_redecl.carbon:[[@LINE+3]]:1-41: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern_of_import.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern library "extern_of_import" fn F();
|
||||
|
||||
+1
-2
@@ -32,8 +32,7 @@ package Foo library "[[@TEST_NAME]]";
|
||||
|
||||
import library default;
|
||||
|
||||
// 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: fail_wrong_library.carbon:[[@LINE+3]]:1-14: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: default.carbon:4:1-33: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern_library";
|
||||
|
||||
// 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: fail_wrong_library.carbon:[[@LINE+3]]:1-14: error: declaration in library "wrong_library" doesn't match `extern library` declaration [ExternLibraryIncorrect]
|
||||
// CHECK:STDERR: extern_library.carbon:4:1-30: note: previously declared with `extern library` here [ExternLibraryExpected]
|
||||
// CHECK:STDERR:
|
||||
extern fn F();
|
||||
|
||||
@@ -34,8 +34,7 @@ extern fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// 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: fail_extern_api.impl.carbon:[[@LINE+5]]:1-7: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+2]]:1-7: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
@@ -52,8 +51,7 @@ fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// 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: fail_extern_impl.impl.carbon:[[@LINE+3]]:1-14: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn A();
|
||||
|
||||
+123
-138
@@ -62,28 +62,23 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "api";
|
||||
|
||||
// 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: fail_redecl_api.carbon:[[@LINE+3]]:1-14: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: api.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn A();
|
||||
// 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: fail_redecl_api.carbon:[[@LINE+3]]:1-27: error: redeclarations of `fn B` must match use of `extern` [RedeclExternMismatch]
|
||||
// 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+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: fail_redecl_api.carbon:[[@LINE+3]]:1-36: error: redeclarations of `fn C` must match use of `extern` [RedeclExternMismatch]
|
||||
// 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+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: fail_redecl_api.carbon:[[@LINE+3]]:1-14: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: api.carbon:7:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn D();
|
||||
// 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: fail_redecl_api.carbon:[[@LINE+3]]:1-17: error: redeclarations of `fn E` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: api.carbon:10:1-10: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn NS.E();
|
||||
@@ -116,29 +111,24 @@ var e: () = NS.E();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+25]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+20]]: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: imported from: fail_merge.carbon:[[@LINE+20]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+16]]: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: imported from: fail_merge.carbon:[[@LINE+15]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+12]]: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: 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: extern_api.carbon:7:1-42: error: duplicate name `D` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: api.carbon:7:1-14: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge.carbon:[[@LINE+4]]: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";
|
||||
@@ -154,29 +144,24 @@ var e: () = NS.E();
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+25]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+20]]: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: imported from: fail_merge_reverse.carbon:[[@LINE+20]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+16]]: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: imported from: fail_merge_reverse.carbon:[[@LINE+15]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+12]]: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: 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: api.carbon:7:1-14: error: duplicate name `D` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: extern_api.carbon:7:1-42: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_merge_reverse.carbon:[[@LINE+4]]: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";
|
||||
@@ -704,23 +689,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.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: %i32.loc13_24: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc13: Core.Form = init_form %i32.loc13_24 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %b.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc15_16: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc13_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.loc20_32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc17_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: %.loc20_35: Core.Form = init_form %struct_type.c [concrete = constants.%.fc2]
|
||||
// CHECK:STDOUT: %.loc17_35: Core.Form = init_form %struct_type.c [concrete = constants.%.fc2]
|
||||
// CHECK:STDOUT: %c.param: %tuple.type.294 = value_param call_param0
|
||||
// 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: %.loc17_21.1: type = splice_block %.loc17_21.3 [concrete = constants.%tuple.type.294] {
|
||||
// CHECK:STDOUT: %i32.loc17_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc17_21.2: %tuple.type.135 = tuple_literal (%i32.loc17_17) [concrete = constants.%tuple.f7a]
|
||||
// CHECK:STDOUT: %.loc17_21.3: type = converted %.loc17_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
|
||||
@@ -729,9 +714,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: %.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: %.loc27_9.1: type = splice_block %.loc27_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc27_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc27_9.3: type = converted %.loc27_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 {
|
||||
@@ -739,15 +724,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.loc33: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc28: 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: %.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: %.loc29: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc29: 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]
|
||||
@@ -756,9 +741,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: %.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: %.loc30_9.1: type = splice_block %.loc30_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc30_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc30_9.3: type = converted %.loc30_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 {
|
||||
@@ -766,9 +751,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: %.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: %.loc31_9.1: type = splice_block %.loc31_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc31_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc31_9.3: type = converted %.loc31_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 {
|
||||
@@ -793,29 +778,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.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: %int_1.loc28: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc28: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc28_16.1: <bound method> = bound_method %int_1.loc28, %impl.elem0.loc28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc28: <specific function> = specific_function %impl.elem0.loc28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc28_16.2: <bound method> = bound_method %int_1.loc28, %specific_fn.loc28 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28: init %i32 = call %bound_method.loc28_16.2(%int_1.loc28) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc28_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc28_16.2: %i32 = converted %int_1.loc28, %.loc28_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc28_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.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: %int_1.loc29: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc29_25.1: %tuple.type.985 = tuple_literal (%int_1.loc29) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc29: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc29_25.1: <bound method> = bound_method %int_1.loc29, %impl.elem0.loc29 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc29: <specific function> = specific_function %impl.elem0.loc29, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc29_25.2: <bound method> = bound_method %int_1.loc29, %specific_fn.loc29 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29: init %i32 = call %bound_method.loc29_25.2(%int_1.loc29) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc29_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc29_25.3: %i32 = converted %int_1.loc29, %.loc29_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc29_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc29_25.4: %tuple.type.294 = converted %.loc29_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc29_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()
|
||||
@@ -1142,9 +1127,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: %.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: %.loc27_9.1: type = splice_block %.loc27_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc27_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc27_9.3: type = converted %.loc27_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 {
|
||||
@@ -1152,15 +1137,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.loc33: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc28: 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: %.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: %.loc29: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc29: 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]
|
||||
@@ -1169,9 +1154,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: %.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: %.loc30_9.1: type = splice_block %.loc30_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc30_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc30_9.3: type = converted %.loc30_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 {
|
||||
@@ -1179,9 +1164,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: %.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: %.loc31_9.1: type = splice_block %.loc31_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc31_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc31_9.3: type = converted %.loc31_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 {
|
||||
@@ -1206,29 +1191,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.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: %int_1.loc28: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc28: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc28_16.1: <bound method> = bound_method %int_1.loc28, %impl.elem0.loc28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc28: <specific function> = specific_function %impl.elem0.loc28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc28_16.2: <bound method> = bound_method %int_1.loc28, %specific_fn.loc28 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28: init %i32 = call %bound_method.loc28_16.2(%int_1.loc28) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc28_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc28_16.2: %i32 = converted %int_1.loc28, %.loc28_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc28_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.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: %int_1.loc29: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc29_25.1: %tuple.type.985 = tuple_literal (%int_1.loc29) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc29: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc29_25.1: <bound method> = bound_method %int_1.loc29, %impl.elem0.loc29 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc29: <specific function> = specific_function %impl.elem0.loc29, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc29_25.2: <bound method> = bound_method %int_1.loc29, %specific_fn.loc29 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29: init %i32 = call %bound_method.loc29_25.2(%int_1.loc29) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc29_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc29_25.3: %i32 = converted %int_1.loc29, %.loc29_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc29_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc29_25.4: %tuple.type.294 = converted %.loc29_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc29_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()
|
||||
@@ -1336,9 +1321,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: %.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: %.loc27_9.1: type = splice_block %.loc27_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc27_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc27_9.3: type = converted %.loc27_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 {
|
||||
@@ -1346,15 +1331,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.loc33: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc28: 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: %.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: %.loc29: type = splice_block %struct_type.c [concrete = constants.%struct_type.c] {
|
||||
// CHECK:STDOUT: %i32.loc29: 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]
|
||||
@@ -1363,9 +1348,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: %.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: %.loc30_9.1: type = splice_block %.loc30_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc30_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc30_9.3: type = converted %.loc30_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 {
|
||||
@@ -1373,9 +1358,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: %.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: %.loc31_9.1: type = splice_block %.loc31_9.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc31_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc31_9.3: type = converted %.loc31_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 {
|
||||
@@ -1400,29 +1385,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.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: %int_1.loc28: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0.loc28: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc28_16.1: <bound method> = bound_method %int_1.loc28, %impl.elem0.loc28 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc28: <specific function> = specific_function %impl.elem0.loc28, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc28_16.2: <bound method> = bound_method %int_1.loc28, %specific_fn.loc28 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28: init %i32 = call %bound_method.loc28_16.2(%int_1.loc28) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc28_16.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc28 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc28_16.2: %i32 = converted %int_1.loc28, %.loc28_16.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %B.call: init %i32 = call %B.ref(%.loc28_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.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: %int_1.loc29: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %.loc29_25.1: %tuple.type.985 = tuple_literal (%int_1.loc29) [concrete = constants.%tuple.378]
|
||||
// CHECK:STDOUT: %impl.elem0.loc29: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc29_25.1: <bound method> = bound_method %int_1.loc29, %impl.elem0.loc29 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc29: <specific function> = specific_function %impl.elem0.loc29, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc29_25.2: <bound method> = bound_method %int_1.loc29, %specific_fn.loc29 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29: init %i32 = call %bound_method.loc29_25.2(%int_1.loc29) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc29_25.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc29 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc29_25.3: %i32 = converted %int_1.loc29, %.loc29_25.2 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %tuple: %tuple.type.294 = tuple_value (%.loc29_25.3) [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %.loc29_25.4: %tuple.type.294 = converted %.loc29_25.1, %tuple [concrete = constants.%tuple.f6b]
|
||||
// CHECK:STDOUT: %C.call: init %struct_type.c = call %C.ref(%.loc29_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()
|
||||
|
||||
+2
-4
@@ -52,8 +52,7 @@ fn C();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// 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: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+5]]:1-7: error: redeclaration of `fn C` is redundant [RedeclRedundant]
|
||||
// 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+2]]:1-7: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
@@ -70,8 +69,7 @@ fn D();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// 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: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+3]]:1-7: error: redeclaration of `fn D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: decl_in_api_decl_and_definition_in_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn D();
|
||||
|
||||
@@ -93,8 +93,7 @@ fn F() -> auto { return 0 as i32; }
|
||||
// --- fail_api_def.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+6]]:1-14: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: imported from: fail_api_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+5]]:1-14: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: api_def.carbon:3:1-16: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_api_def.impl.carbon:[[@LINE+2]]:1-14: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
@@ -109,8 +108,7 @@ fn F() -> i32;
|
||||
// --- fail_api_decl.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_api_decl.impl.carbon:[[@LINE+4]]:1-16: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: imported from: fail_api_decl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_api_decl.impl.carbon:[[@LINE+3]]:1-16: error: redeclaration of function with deduced return type [DeducedReturnTypeRedecl]
|
||||
// CHECK:STDERR: api_decl.carbon:3:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() -> auto { return 0 as i32; }
|
||||
@@ -27,8 +27,7 @@ fn F(x: i32 = 0, y: i32 = 1, z: i32 = 2);
|
||||
// --- fail_imported_default_presence_mismatch.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE+4]]:13-18: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported from: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_imported_default_presence_mismatch.impl.carbon:[[@LINE+3]]:13-18: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported_default_presence_mismatch.carbon:3:6-15: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused x: i32, unused y: i32 = 1, unused z: i32 = 2) { }
|
||||
@@ -41,8 +40,7 @@ fn F(x: i32 = 0, y: i32 = 10);
|
||||
// --- fail_imported_defaults_different_values.impl.carbon
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_imported_defaults_different_values.impl.carbon:[[@LINE+4]]:25-42: error: redeclaration differs at parameter 2 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported from: fail_imported_defaults_different_values.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_imported_defaults_different_values.impl.carbon:[[@LINE+3]]:25-42: error: redeclaration differs at parameter 2 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: imported_defaults_different_values.carbon:3:18-28: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn F(unused x: i32 = 0, unused y: i32 = 22) { }
|
||||
|
||||
@@ -58,8 +58,7 @@ extern fn F();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+4]]:1-8: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_two_file_impl_mismatch.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_two_file_impl_mismatch.impl.carbon:[[@LINE+3]]:1-8: error: redeclarations of `fn F` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: two_file_impl_mismatch.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn F() {}
|
||||
|
||||
@@ -34,8 +34,7 @@ extern fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+4]]:1-8: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_api.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_extern_api.impl.carbon:[[@LINE+3]]:1-8: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern_api.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A() {}
|
||||
@@ -50,8 +49,7 @@ fn A();
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+4]]:1-15: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_extern_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_extern_impl.impl.carbon:[[@LINE+3]]:1-15: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern_impl.carbon:4:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn A() {}
|
||||
@@ -66,8 +64,7 @@ fn A() {}
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+4]]:1-7: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_redecl_after_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_redecl_after_def.impl.carbon:[[@LINE+3]]:1-7: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: redecl_after_def.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
@@ -82,8 +79,7 @@ fn A() {}
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+4]]:1-8: error: redefinition of `fn A` [RedeclRedef]
|
||||
// CHECK:STDERR: imported from: fail_redef_after_def.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_redef_after_def.impl.carbon:[[@LINE+3]]:1-8: error: redefinition of `fn A` [RedeclRedef]
|
||||
// CHECK:STDERR: redef_after_def.carbon:4:1-8: note: previously defined here [RedeclPrevDef]
|
||||
// CHECK:STDERR:
|
||||
fn A() {}
|
||||
@@ -99,8 +95,7 @@ alias B = A;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+4]]:4: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_def_alias.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_def_alias.impl.carbon:[[@LINE+3]]:4: error: duplicate name `B` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: def_alias.carbon:5:7: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn B() {}
|
||||
@@ -287,7 +282,7 @@ fn B() {}
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.1: type = fn_type @A.1 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.1: %A.type.9f4a6d.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc8 [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc7 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.2: %A.type.9f4a6d.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -301,12 +296,12 @@ fn B() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import.loc2_31.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc2_31.2 = import <none>
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc8 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc7 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.1 [from "redef_after_def.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.loc8() {
|
||||
// CHECK:STDOUT: fn @A.loc7() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+17
-22
@@ -51,13 +51,11 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "fns";
|
||||
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+4]]:1-8: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_def_ownership.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+3]]:1-8: error: redeclaration of `fn A` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fns.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A() {};
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+4]]:1-20: error: redeclaration of `fn B` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_def_ownership.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_def_ownership.carbon:[[@LINE+3]]:1-20: error: redeclaration of `fn B` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: fns.carbon:5:1-21: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn B(b: i32) -> i32;
|
||||
@@ -68,14 +66,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "extern";
|
||||
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+4]]:1-7: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_then_def.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+3]]:1-7: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A();
|
||||
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+4]]:1-8: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_redecl_then_def.carbon:[[@LINE-9]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_redecl_then_def.carbon:[[@LINE+3]]:1-8: error: redeclarations of `fn A` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: extern.carbon:4:1-14: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn A() {}
|
||||
@@ -86,8 +82,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "fns";
|
||||
|
||||
// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+4]]:1-14: error: redeclarations of `fn D` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: imported from: fail_mix_extern_decl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_mix_extern_decl.carbon:[[@LINE+3]]:1-14: error: redeclarations of `fn D` must match use of `extern` [RedeclExternMismatch]
|
||||
// CHECK:STDERR: fns.carbon:7:1-7: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
extern fn D();
|
||||
@@ -413,7 +408,7 @@ fn D() {}
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.1: type = fn_type @A.1 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.1: %A.type.9f4a6d.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc10 [concrete]
|
||||
// CHECK:STDOUT: %A.type.9f4a6d.2: type = fn_type @A.loc9 [concrete]
|
||||
// CHECK:STDOUT: %A.921eb9.2: %A.type.9f4a6d.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %Int.type: type = parameterized_class_name_type @Int [concrete]
|
||||
@@ -446,12 +441,12 @@ fn D() {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc10 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: %A.decl: %A.type.9f4a6d.2 = fn_decl @A.loc9 [concrete = constants.%A.921eb9.2] {} {}
|
||||
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [concrete = constants.%B] {} {
|
||||
// CHECK:STDOUT: %i32.loc15_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc15: Core.Form = init_form %i32.loc15_17 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %i32.loc13_17: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc13: Core.Form = init_form %i32.loc13_17 [concrete = constants.%.0b3]
|
||||
// CHECK:STDOUT: %b.param: %i32 = value_param call_param0
|
||||
// CHECK:STDOUT: %i32.loc15_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %i32.loc13_9: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %b: %i32 = wrapper_binding b, %b.param
|
||||
// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param1
|
||||
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
||||
@@ -460,7 +455,7 @@ fn D() {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.1 [from "fns.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @A.loc10() {
|
||||
// CHECK:STDOUT: fn @A.loc9() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -484,13 +479,13 @@ fn D() {}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .A = %A.decl.loc10
|
||||
// CHECK:STDOUT: .A = %A.decl.loc9
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %A.decl.loc10: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc16: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc9: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: %A.decl.loc14: %A.type = fn_decl @A [concrete = constants.%A] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: extern fn @A() [from "extern.carbon"] {
|
||||
@@ -521,13 +516,13 @@ fn D() {}
|
||||
// CHECK:STDOUT: .A = imports.%Main.A
|
||||
// CHECK:STDOUT: .B = imports.%Main.B
|
||||
// CHECK:STDOUT: .C = imports.%Main.C
|
||||
// CHECK:STDOUT: .D = %D.decl.loc10
|
||||
// CHECK:STDOUT: .D = %D.decl.loc9
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %D.decl.loc10: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc12: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc9: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: %D.decl.loc11: %D.type = fn_decl @D [concrete = constants.%D] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @D() [from "fns.carbon"] {
|
||||
|
||||
+4
-5
@@ -30,8 +30,7 @@ fn B() {
|
||||
// CHECK:STDERR:
|
||||
A({.b = {}});
|
||||
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+4]]:3-18: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: imported from: fail_deduce_imported_function.carbon:[[@LINE-11]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+3]]:3-18: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: lib.carbon:4:1-31: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
Lib.A({.b = {}});
|
||||
@@ -228,9 +227,9 @@ fn B() {
|
||||
// CHECK:STDOUT: %.loc10_12: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc10_13: %struct_type.b = struct_literal (%.loc10_12) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %Lib.ref: <namespace> = name_ref Lib, imports.%Lib [concrete = imports.%Lib]
|
||||
// CHECK:STDOUT: %A.ref.loc16: %A.type.42a = name_ref A, imports.%Lib.A [concrete = constants.%A.b9a]
|
||||
// CHECK:STDOUT: %.loc16_16: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc16_17: %struct_type.b = struct_literal (%.loc16_16) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %A.ref.loc15: %A.type.42a = name_ref A, imports.%Lib.A [concrete = constants.%A.b9a]
|
||||
// CHECK:STDOUT: %.loc15_16: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc15_17: %struct_type.b = struct_literal (%.loc15_16) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+6
-9
@@ -150,18 +150,16 @@ import library "interface";
|
||||
class B { adapt {}; }
|
||||
|
||||
impl B as Runtime {
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+5]]:3-38: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+4]]:3-38: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: imported from: fail_impl_musteval.carbon:[[@LINE-7]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+4]]:3-38: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+3]]:3-38: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: interface.carbon:5:3-21: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR:
|
||||
musteval fn F(unused self) -> type { return B; }
|
||||
}
|
||||
|
||||
impl B as Eval {
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+5]]:3-38: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+4]]:3-38: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: imported from: fail_impl_musteval.carbon:[[@LINE-16]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+4]]:3-38: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_impl_musteval.carbon:[[@LINE+3]]:3-38: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: interface.carbon:9:3-26: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR:
|
||||
musteval fn F(unused self) -> type { return B; }
|
||||
@@ -197,9 +195,8 @@ impl B as Core.ImplicitAs(BView) {
|
||||
}
|
||||
|
||||
impl B as MustEval {
|
||||
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+5]]:3-45: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+4]]:3-45: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: imported from: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE-12]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+4]]:3-45: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_todo_impl_musteval_from_musteval_thunk.carbon:[[@LINE+3]]:3-45: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: interface.carbon:13:3-30: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR:
|
||||
musteval fn F(unused self: BView) -> type { return B; }
|
||||
|
||||
@@ -89,11 +89,10 @@ import library "interface";
|
||||
|
||||
class C6 { }
|
||||
impl C6 as I where .T = {};
|
||||
// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE+6]]:1-14: error: associated constant T not given a value in impl of interface I [ImplAssociatedConstantNeedsValue]
|
||||
// CHECK:STDERR: imported from: fail_missing_on_definition.carbon:[[@LINE-5]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE+5]]:1-14: error: associated constant T not given a value in impl of interface I [ImplAssociatedConstantNeedsValue]
|
||||
// CHECK:STDERR: interface.carbon:3:19-25: note: associated constant declared here [AssociatedConstantHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-5]]:1-27: error: impl declared but not defined [ImplMissingDefinition]
|
||||
// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-4]]:1-27: error: impl declared but not defined [ImplMissingDefinition]
|
||||
// CHECK:STDERR:
|
||||
impl C6 as I { }
|
||||
|
||||
@@ -1002,7 +1001,7 @@ impl CD as IF where .F = 0 {
|
||||
// CHECK:STDOUT: %C6.ref: type = name_ref C6, file.%C6.decl [concrete = constants.%C6]
|
||||
// CHECK:STDOUT: %I.ref: type = name_ref I, imports.%Main.I [concrete = constants.%I.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc12: <witness> = impl_self_witness @C6.as.I.impl.e1b87a.2.%C6.ref, @I [concrete = constants.%.7ff]
|
||||
// CHECK:STDOUT: %.loc11: <witness> = impl_self_witness @C6.as.I.impl.e1b87a.2.%C6.ref, @I [concrete = constants.%.7ff]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I [from "interface.carbon"] {
|
||||
|
||||
@@ -56,8 +56,7 @@ struct A {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_poison_custom_witness.carbon:[[@LINE+4]]:1-9: error: found `impl` for Cpp.A as SubobjectDestroy, which has a custom witness [PoisonedImplLookupCustomResult]
|
||||
// CHECK:STDERR: imported from: fail_poison_custom_witness.carbon:[[@LINE-12]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_poison_custom_witness.carbon:[[@LINE+3]]:1-9: error: found `impl` for Cpp.A as SubobjectDestroy, which has a custom witness [PoisonedImplLookupCustomResult]
|
||||
// CHECK:STDERR: destroy.carbon:8:1-45: note: the use tried to select the `impl` here, but a custom witness was already chosen [PoisonedImplLookupCustomResultNoteBadImpl]
|
||||
// CHECK:STDERR:
|
||||
class B {
|
||||
|
||||
@@ -175,8 +175,7 @@ class C {}
|
||||
// Can't write a final impl in both the interface's file and the root self
|
||||
// type's file (when they are different files).
|
||||
//
|
||||
// CHECK:STDERR: fail_final_impl_with_both_interface_and_self_but_different_files.carbon:[[@LINE+4]]:1-23: error: `final impl` overlaps with `final impl` from another file [FinalImplOverlapsDifferentFile]
|
||||
// CHECK:STDERR: imported from: fail_final_impl_with_both_interface_and_self_but_different_files.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_final_impl_with_both_interface_and_self_but_different_files.carbon:[[@LINE+3]]:1-23: error: `final impl` overlaps with `final impl` from another file [FinalImplOverlapsDifferentFile]
|
||||
// CHECK:STDERR: interface_z_with_impl.carbon:9:1-39: note: imported `final impl` here [FinalImplOverlapsDifferentFileNote]
|
||||
// CHECK:STDERR:
|
||||
final impl C as Z(()) {}
|
||||
@@ -191,8 +190,7 @@ class C {}
|
||||
// This final impl is overlapped by a final impl in the interface file, and you
|
||||
// can't write a final impl in two different files.
|
||||
//
|
||||
// CHECK:STDERR: fail_final_overlaps_final_from_other_file.carbon:[[@LINE+4]]:1-22: error: `final impl` overlaps with `final impl` from another file [FinalImplOverlapsDifferentFile]
|
||||
// CHECK:STDERR: imported from: fail_final_overlaps_final_from_other_file.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_final_overlaps_final_from_other_file.carbon:[[@LINE+3]]:1-22: error: `final impl` overlaps with `final impl` from another file [FinalImplOverlapsDifferentFile]
|
||||
// CHECK:STDERR: interface_z_with_impl.carbon:9:1-39: note: imported `final impl` here [FinalImplOverlapsDifferentFileNote]
|
||||
// CHECK:STDERR:
|
||||
final impl C as Z(C) {}
|
||||
@@ -206,8 +204,7 @@ class C {}
|
||||
|
||||
// This non-final impl is subsumed by a final impl in the interface file.
|
||||
//
|
||||
// CHECK:STDERR: fail_final_overlaps_non_final_from_other_file.carbon:[[@LINE+4]]:1-16: error: `impl` will never be used [ImplFinalOverlapsNonFinal]
|
||||
// CHECK:STDERR: imported from: fail_final_overlaps_non_final_from_other_file.carbon:[[@LINE-7]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_final_overlaps_non_final_from_other_file.carbon:[[@LINE+3]]:1-16: error: `impl` will never be used [ImplFinalOverlapsNonFinal]
|
||||
// CHECK:STDERR: interface_z_with_impl.carbon:9:1-39: note: `final impl` declared here would always be used instead [ImplFinalOverlapsNonFinalNote]
|
||||
// CHECK:STDERR:
|
||||
impl C as Z(C) {}
|
||||
|
||||
+1
-2
@@ -351,8 +351,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "use_extern_class";
|
||||
|
||||
// CHECK:STDERR: fail_todo_extern_class.carbon:[[@LINE+2]]:1-15: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_todo_extern_class.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_extern_class.carbon:[[@LINE+1]]:1-15: error: redeclaration of `class C` is redundant [RedeclRedundant]
|
||||
extern class C;
|
||||
|
||||
// --- fail_use_extern_class.carbon
|
||||
|
||||
+1
-2
@@ -191,8 +191,7 @@ class D {
|
||||
// But that means it overlaps fully with the impl from the api file, which is
|
||||
// a separate error.
|
||||
|
||||
// CHECK:STDERR: fail_decl_of_imported_impl_in_new_scope.impl.carbon:[[@LINE+4]]:3-15: error: found non-final `impl` with the same type structure as another non-final `impl` [ImplNonFinalSameTypeStructure]
|
||||
// CHECK:STDERR: imported from: fail_decl_of_imported_impl_in_new_scope.impl.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_decl_of_imported_impl_in_new_scope.impl.carbon:[[@LINE+3]]:3-15: error: found non-final `impl` with the same type structure as another non-final `impl` [ImplNonFinalSameTypeStructure]
|
||||
// CHECK:STDERR: decl_of_imported_impl_in_new_scope.carbon:5:1-13: note: other `impl` here [ImplNonFinalSameTypeStructureNote]
|
||||
// CHECK:STDERR:
|
||||
impl C as Z {}
|
||||
|
||||
@@ -42,8 +42,7 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+4]]:28-33: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: imported from: fail_misusing_invalid_interface.carbon:[[@LINE-15]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_misusing_invalid_interface.carbon:[[@LINE+3]]:28-33: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_invalid_interface.carbon:12:3-29: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
fn F(generic T: IMisuse) { T.Op(); }
|
||||
@@ -66,8 +65,7 @@ class ArgC {}
|
||||
|
||||
class C {
|
||||
impl as IMisuse where .Arg = ArgC {
|
||||
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+4]]:27-38: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: imported from: fail_using_invalid_interface.carbon:[[@LINE-7]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+3]]:27-38: error: cannot convert type `ArgC` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_invalid_interface.carbon:5:14-17: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
fn Op(unused self) -> ArgToI(ArgC) {
|
||||
@@ -76,8 +74,7 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+4]]:28-33: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: imported from: fail_using_invalid_interface.carbon:[[@LINE-17]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_using_invalid_interface.carbon:[[@LINE+3]]:28-33: error: 0 arguments passed to function expecting 1 argument [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_invalid_interface.carbon:12:3-29: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
fn F(generic T: IMisuse) { T.Op(); }
|
||||
|
||||
@@ -24,8 +24,7 @@ library "[[@TEST_NAME]]";
|
||||
import library "a";
|
||||
|
||||
// TODO: Replace this diagnostic with one that better describes the error, such as 'DeclaredInMultipleLibraries'.
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:1-13: error: redeclaration of `interface I` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_b.carbon:[[@LINE-4]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:1-13: error: redeclaration of `interface I` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: a.carbon:4:1-12: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
interface I {}
|
||||
|
||||
+1
-2
@@ -186,8 +186,7 @@ library "[[@TEST_NAME]]";
|
||||
import library "final_interfaces";
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: fail_impl_final.carbon:[[@LINE+4]]:3-23: error: attempted to implement `M`, which is final in interface `FinalMethod` [ImplFinalFunction]
|
||||
// CHECK:STDERR: imported from: fail_impl_final.carbon:[[@LINE-4]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_impl_final.carbon:[[@LINE+3]]:3-23: error: attempted to implement `M`, which is final in interface `FinalMethod` [ImplFinalFunction]
|
||||
// CHECK:STDERR: final_interfaces.carbon:10:3-27: note: associated function M declared here [AssociatedFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
impl as FinalMethod {
|
||||
|
||||
@@ -52,8 +52,7 @@ interface C;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+6]]:1-12: error: redeclaration of `interface C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+5]]:1-12: error: redeclaration of `interface C` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: decl_in_api_decl_in_impl.carbon:4:1-12: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_in_impl.impl.carbon:[[@LINE+2]]:1-12: error: no definition found for declaration in impl file [MissingDefinitionInImpl]
|
||||
@@ -70,8 +69,7 @@ interface D;
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+4]]:1-12: error: redeclaration of `interface 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: fail_decl_in_api_decl_and_definition_in_impl.impl.carbon:[[@LINE+3]]:1-12: error: redeclaration of `interface D` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: decl_in_api_decl_and_definition_in_impl.carbon:4:1-12: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
interface D;
|
||||
|
||||
+3
-6
@@ -38,8 +38,7 @@ import library "transitive";
|
||||
fn F[T: Transitive](t: T) {
|
||||
var a: T.A = t.GetA();
|
||||
|
||||
// CHECK:STDERR: fail_todo_equivalent.carbon:[[@LINE+4]]:3-13: error: cannot convert type `T.(Transitive.A)` that implements `P & Core.Destroy` into type implementing `R & Core.Destroy where...` [ConversionFailureFacetToFacet]
|
||||
// CHECK:STDERR: imported from: fail_todo_equivalent.carbon:[[@LINE-6]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_equivalent.carbon:[[@LINE+3]]:3-13: error: cannot convert type `T.(Transitive.A)` that implements `P & Core.Destroy` into type implementing `R & Core.Destroy where...` [ConversionFailureFacetToFacet]
|
||||
// CHECK:STDERR: transitive.carbon:14:3-24: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
t.TakesC(a);
|
||||
@@ -146,8 +145,7 @@ fn F[U: Z](t: U.Z1) {
|
||||
var a: U.Z1.A = t.GetA();
|
||||
|
||||
// Depends on the observe statement in Transitive, which is the type of `Z1`.
|
||||
// CHECK:STDERR: fail_todo_observe_from_type_of_assoc_constant.carbon:[[@LINE+4]]:3-13: error: cannot convert type `U.(Z.Z1).(Transitive.A)` that implements `P & Core.Destroy` into type implementing `R & Core.Destroy where...` [ConversionFailureFacetToFacet]
|
||||
// CHECK:STDERR: imported from: fail_todo_observe_from_type_of_assoc_constant.carbon:[[@LINE-12]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_observe_from_type_of_assoc_constant.carbon:[[@LINE+3]]:3-13: error: cannot convert type `U.(Z.Z1).(Transitive.A)` that implements `P & Core.Destroy` into type implementing `R & Core.Destroy where...` [ConversionFailureFacetToFacet]
|
||||
// CHECK:STDERR: transitive.carbon:14:3-24: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
t.TakesC(a);
|
||||
@@ -419,8 +417,7 @@ import library "generic_observe";
|
||||
fn F[W: A, X: I(W)](x: X) {
|
||||
var v: X.V = x.GetV();
|
||||
|
||||
// CHECK:STDERR: fail_todo_generic_import.carbon:[[@LINE+4]]:3-13: error: cannot convert type `X.(I(W).V)` that implements `C & Core.Destroy where...` into type implementing `A` [ConversionFailureFacetToFacet]
|
||||
// CHECK:STDERR: imported from: fail_todo_generic_import.carbon:[[@LINE-6]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_generic_import.carbon:[[@LINE+3]]:3-13: error: cannot convert type `X.(I(W).V)` that implements `C & Core.Destroy where...` into type implementing `A` [ConversionFailureFacetToFacet]
|
||||
// CHECK:STDERR: generic_observe.carbon:12:3-24: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
x.TakesT(v);
|
||||
|
||||
+54
-57
@@ -72,13 +72,11 @@ interface Bar(a: D);
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+4]]:11-13: error: duplicate name `Foo` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_todo_two_file.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+3]]:11-13: error: duplicate name `Foo` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: two_file.carbon:7:1-20: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
interface Foo(a: C) {}
|
||||
// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+4]]:11-13: error: duplicate name `Bar` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_todo_two_file.impl.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_todo_two_file.impl.carbon:[[@LINE+3]]:11-13: error: duplicate name `Bar` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: two_file.carbon:8:1-20: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
interface Bar(a: D) {}
|
||||
@@ -139,8 +137,7 @@ alias D = C;
|
||||
// TODO: This fails because importing interfaces doesn't work well. It should
|
||||
// fail due to `C` versus `D`, but may succeed if importing interfaces is fixed
|
||||
// before syntax matching on imports is supported.
|
||||
// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+4]]:11-13: error: duplicate name `Foo` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_alias_two_file.impl.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_alias_two_file.impl.carbon:[[@LINE+3]]:11-13: error: duplicate name `Foo` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: alias_two_file.carbon:6:1-20: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
interface Foo(a: D) {}
|
||||
@@ -644,15 +641,15 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a: %C = symbolic_binding a, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Foo.type.bc6a25.1: type = generic_interface_type @Foo.1 [concrete]
|
||||
// CHECK:STDOUT: %Foo.generic.d3ea5a.1: %Foo.type.bc6a25.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.bc6a25.2: type = generic_interface_type @Foo.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.bc6a25.2: type = generic_interface_type @Foo.loc7 [concrete]
|
||||
// CHECK:STDOUT: %Foo.generic.d3ea5a.2: %Foo.type.bc6a25.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.137: type = facet_type <@Foo.loc8, @Foo.loc8(%a)> [symbolic]
|
||||
// CHECK:STDOUT: %Foo.type.137: type = facet_type <@Foo.loc7, @Foo.loc7(%a)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.4d3: %Foo.type.137 = symbolic_binding Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: %Bar.type.3f06c8.1: type = generic_interface_type @Bar.1 [concrete]
|
||||
// CHECK:STDOUT: %Bar.generic.b3011f.1: %Bar.type.3f06c8.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Bar.type.3f06c8.2: type = generic_interface_type @Bar.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Bar.type.3f06c8.2: type = generic_interface_type @Bar.loc11 [concrete]
|
||||
// CHECK:STDOUT: %Bar.generic.b3011f.2: %Bar.type.3f06c8.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Bar.type.309: type = facet_type <@Bar.loc13, @Bar.loc13(%a)> [symbolic]
|
||||
// CHECK:STDOUT: %Bar.type.309: type = facet_type <@Bar.loc11, @Bar.loc11(%a)> [symbolic]
|
||||
// CHECK:STDOUT: %Self.3ee: %Bar.type.309 = symbolic_binding Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -676,23 +673,23 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import.loc2_24.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc2_24.2 = import <none>
|
||||
// CHECK:STDOUT: %Foo.decl: %Foo.type.bc6a25.2 = interface_decl @Foo.loc8 [concrete = constants.%Foo.generic.d3ea5a.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc8_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %Foo.decl: %Foo.type.bc6a25.2 = interface_decl @Foo.loc7 [concrete = constants.%Foo.generic.d3ea5a.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc7_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc8: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.loc7: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.loc8_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc8_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: %a.loc7_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc7_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Bar.decl: %Bar.type.3f06c8.2 = interface_decl @Bar.loc13 [concrete = constants.%Bar.generic.b3011f.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc13_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc13_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %Bar.decl: %Bar.type.3f06c8.2 = interface_decl @Bar.loc11 [concrete = constants.%Bar.generic.b3011f.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc11_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc11_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc13: type = splice_block %D.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %D.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.loc13_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc13_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: %a.loc11_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc11_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -703,20 +700,20 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: interface;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @Foo.loc8(%a.loc8_16.2: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc8_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc8_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc8_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc8_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: generic interface @Foo.loc7(%a.loc7_16.2: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc7_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc7_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc7_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc7_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Foo.type: type = facet_type <@Foo.loc8, @Foo.loc8(%a.loc8_16.1)> [symbolic = %Foo.type (constants.%Foo.type.137)]
|
||||
// CHECK:STDOUT: %Self.loc8_21.2: @Foo.loc8.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc8_21.2 (constants.%Self.4d3)]
|
||||
// CHECK:STDOUT: %Foo.type: type = facet_type <@Foo.loc7, @Foo.loc7(%a.loc7_16.1)> [symbolic = %Foo.type (constants.%Foo.type.137)]
|
||||
// CHECK:STDOUT: %Self.loc7_21.2: @Foo.loc7.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc7_21.2 (constants.%Self.4d3)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: %Self.loc8_21.1: @Foo.loc8.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc8_21.2 (constants.%Self.4d3)]
|
||||
// CHECK:STDOUT: %Foo.WithSelf.decl = interface_with_self_decl @Foo.loc8 [concrete]
|
||||
// CHECK:STDOUT: %Self.loc7_21.1: @Foo.loc7.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc7_21.2 (constants.%Self.4d3)]
|
||||
// CHECK:STDOUT: %Foo.WithSelf.decl = interface_with_self_decl @Foo.loc7 [concrete]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.loc8_21.1
|
||||
// CHECK:STDOUT: .Self = %Self.loc7_21.1
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !requires:
|
||||
@@ -730,20 +727,20 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: interface;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @Bar.loc13(%a.loc13_16.2: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc13_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc13_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc13_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc13_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: generic interface @Bar.loc11(%a.loc11_16.2: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc11_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc11_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc11_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc11_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Bar.type: type = facet_type <@Bar.loc13, @Bar.loc13(%a.loc13_16.1)> [symbolic = %Bar.type (constants.%Bar.type.309)]
|
||||
// CHECK:STDOUT: %Self.loc13_21.2: @Bar.loc13.%Bar.type (%Bar.type.309) = symbolic_binding Self, 1 [symbolic = %Self.loc13_21.2 (constants.%Self.3ee)]
|
||||
// CHECK:STDOUT: %Bar.type: type = facet_type <@Bar.loc11, @Bar.loc11(%a.loc11_16.1)> [symbolic = %Bar.type (constants.%Bar.type.309)]
|
||||
// CHECK:STDOUT: %Self.loc11_21.2: @Bar.loc11.%Bar.type (%Bar.type.309) = symbolic_binding Self, 1 [symbolic = %Self.loc11_21.2 (constants.%Self.3ee)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: %Self.loc13_21.1: @Bar.loc13.%Bar.type (%Bar.type.309) = symbolic_binding Self, 1 [symbolic = %Self.loc13_21.2 (constants.%Self.3ee)]
|
||||
// CHECK:STDOUT: %Bar.WithSelf.decl = interface_with_self_decl @Bar.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Self.loc11_21.1: @Bar.loc11.%Bar.type (%Bar.type.309) = symbolic_binding Self, 1 [symbolic = %Self.loc11_21.2 (constants.%Self.3ee)]
|
||||
// CHECK:STDOUT: %Bar.WithSelf.decl = interface_with_self_decl @Bar.loc11 [concrete]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.loc13_21.1
|
||||
// CHECK:STDOUT: .Self = %Self.loc11_21.1
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !requires:
|
||||
@@ -762,9 +759,9 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a => constants.%a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Foo.loc8(constants.%a) {
|
||||
// CHECK:STDOUT: %a.patt.loc8_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc8_16.1 => constants.%a
|
||||
// CHECK:STDOUT: specific @Foo.loc7(constants.%a) {
|
||||
// CHECK:STDOUT: %a.patt.loc7_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc7_16.1 => constants.%a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Foo.WithSelf(constants.%a, constants.%Self.4d3) {}
|
||||
@@ -774,9 +771,9 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a => constants.%a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Bar.loc13(constants.%a) {
|
||||
// CHECK:STDOUT: %a.patt.loc13_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc13_16.1 => constants.%a
|
||||
// CHECK:STDOUT: specific @Bar.loc11(constants.%a) {
|
||||
// CHECK:STDOUT: %a.patt.loc11_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc11_16.1 => constants.%a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Bar.WithSelf(constants.%a, constants.%Self.3ee) {}
|
||||
@@ -1133,9 +1130,9 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a: %C = symbolic_binding a, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Foo.type.bc6a25.1: type = generic_interface_type @Foo.1 [concrete]
|
||||
// CHECK:STDOUT: %Foo.generic.d3ea5a.1: %Foo.type.bc6a25.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.bc6a25.2: type = generic_interface_type @Foo.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.bc6a25.2: type = generic_interface_type @Foo.loc12 [concrete]
|
||||
// CHECK:STDOUT: %Foo.generic.d3ea5a.2: %Foo.type.bc6a25.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Foo.type.137: type = facet_type <@Foo.loc13, @Foo.loc13(%a)> [symbolic]
|
||||
// CHECK:STDOUT: %Foo.type.137: type = facet_type <@Foo.loc12, @Foo.loc12(%a)> [symbolic]
|
||||
// CHECK:STDOUT: %Self: %Foo.type.137 = symbolic_binding Self, 1 [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1157,14 +1154,14 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: %default.import.loc2_30.2 = import <none>
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %D: type = alias_binding D, %C.ref [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Foo.decl: %Foo.type.bc6a25.2 = interface_decl @Foo.loc13 [concrete = constants.%Foo.generic.d3ea5a.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc13_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc13_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %Foo.decl: %Foo.type.bc6a25.2 = interface_decl @Foo.loc12 [concrete = constants.%Foo.generic.d3ea5a.2] {
|
||||
// CHECK:STDOUT: %a.patt.loc12_16.1: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc12_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.loc13: type = splice_block %D.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %D.ref [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %.Self.frozen: type = symbolic_binding .Self [symbolic_self = constants.%.Self.frozen]
|
||||
// CHECK:STDOUT: %D.ref: type = name_ref D, file.%D [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.loc13_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc13_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: %a.loc12_16.2: %C = symbolic_binding a, 0 [symbolic = %a.loc12_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1175,20 +1172,20 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: interface;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic interface @Foo.loc13(%a.loc13_16.2: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc13_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc13_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc13_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc13_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT: generic interface @Foo.loc12(%a.loc12_16.2: %C) {
|
||||
// CHECK:STDOUT: %a.patt.loc12_16.2: %pattern_type = symbolic_binding_pattern a, 0 [symbolic = %a.patt.loc12_16.2 (constants.%a.patt)]
|
||||
// CHECK:STDOUT: %a.loc12_16.1: %C = symbolic_binding a, 0 [symbolic = %a.loc12_16.1 (constants.%a)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Foo.type: type = facet_type <@Foo.loc13, @Foo.loc13(%a.loc13_16.1)> [symbolic = %Foo.type (constants.%Foo.type.137)]
|
||||
// CHECK:STDOUT: %Self.loc13_21.2: @Foo.loc13.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc13_21.2 (constants.%Self)]
|
||||
// CHECK:STDOUT: %Foo.type: type = facet_type <@Foo.loc12, @Foo.loc12(%a.loc12_16.1)> [symbolic = %Foo.type (constants.%Foo.type.137)]
|
||||
// CHECK:STDOUT: %Self.loc12_21.2: @Foo.loc12.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc12_21.2 (constants.%Self)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface {
|
||||
// CHECK:STDOUT: %Self.loc13_21.1: @Foo.loc13.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc13_21.2 (constants.%Self)]
|
||||
// CHECK:STDOUT: %Foo.WithSelf.decl = interface_with_self_decl @Foo.loc13 [concrete]
|
||||
// CHECK:STDOUT: %Self.loc12_21.1: @Foo.loc12.%Foo.type (%Foo.type.137) = symbolic_binding Self, 1 [symbolic = %Self.loc12_21.2 (constants.%Self)]
|
||||
// CHECK:STDOUT: %Foo.WithSelf.decl = interface_with_self_decl @Foo.loc12 [concrete]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !members:
|
||||
// CHECK:STDOUT: .Self = %Self.loc13_21.1
|
||||
// CHECK:STDOUT: .Self = %Self.loc12_21.1
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !requires:
|
||||
@@ -1207,9 +1204,9 @@ interface Foo(a: const (const C)) {}
|
||||
// CHECK:STDOUT: %a => constants.%a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Foo.loc13(constants.%a) {
|
||||
// CHECK:STDOUT: %a.patt.loc13_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc13_16.1 => constants.%a
|
||||
// CHECK:STDOUT: specific @Foo.loc12(constants.%a) {
|
||||
// CHECK:STDOUT: %a.patt.loc12_16.2 => constants.%a.patt
|
||||
// CHECK:STDOUT: %a.loc12_16.1 => constants.%a
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @Foo.WithSelf(constants.%a, constants.%Self) {}
|
||||
|
||||
+16
-36
@@ -70,8 +70,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "non_function_member_protected.h";
|
||||
|
||||
fn F(c: Cpp.NonFunctionMemberProtected) {
|
||||
// CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+4]]:35-49: error: cannot access protected member `instance_data` of type `Cpp.NonFunctionMemberProtected` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_non_function_member_protected.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_non_function_member_protected.carbon:[[@LINE+3]]:35-49: error: cannot access protected member `instance_data` of type `Cpp.NonFunctionMemberProtected` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./non_function_member_protected.h:2:7: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let unused instance_data: i32 = c.instance_data;
|
||||
@@ -92,8 +91,7 @@ class Derived {
|
||||
}
|
||||
|
||||
fn F(d: Derived) {
|
||||
// CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+4]]:35-49: error: cannot access protected member `instance_data` of type `Derived` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_non_function_member_protected_extend.carbon:[[@LINE-8]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_non_function_member_protected_extend.carbon:[[@LINE+3]]:35-49: error: cannot access protected member `instance_data` of type `Derived` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./non_function_member_protected.h:2:7: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let unused instance_data: i32 = d.instance_data;
|
||||
@@ -139,8 +137,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "non_function_member_private.h";
|
||||
|
||||
fn F(c: Cpp.NonFunctionMemberPrivate) {
|
||||
// CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+4]]:35-49: error: cannot access private member `instance_data` of type `Cpp.NonFunctionMemberPrivate` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_non_function_member_private.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_non_function_member_private.carbon:[[@LINE+3]]:35-49: error: cannot access private member `instance_data` of type `Cpp.NonFunctionMemberPrivate` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./non_function_member_private.h:2:7: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let unused instance_data: i32 = c.instance_data;
|
||||
@@ -159,8 +156,7 @@ import Cpp library "non_function_member_private.h";
|
||||
class Derived {
|
||||
extend base: Cpp.NonFunctionMemberPrivate;
|
||||
fn F(self) {
|
||||
// CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+4]]:37-54: error: cannot access private member `instance_data` of type `Cpp.NonFunctionMemberPrivate` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_non_function_member_private_extend.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+3]]:37-54: error: cannot access private member `instance_data` of type `Cpp.NonFunctionMemberPrivate` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./non_function_member_private.h:2:7: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let unused instance_data: i32 = self.instance_data;
|
||||
@@ -168,8 +164,7 @@ class Derived {
|
||||
}
|
||||
|
||||
fn F(d: Derived) {
|
||||
// CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+4]]:35-49: error: cannot access private member `instance_data` of type `Cpp.NonFunctionMemberPrivate` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_non_function_member_private_extend.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_non_function_member_private_extend.carbon:[[@LINE+3]]:35-49: error: cannot access private member `instance_data` of type `Cpp.NonFunctionMemberPrivate` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./non_function_member_private.h:2:7: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let unused instance_data: i32 = d.instance_data;
|
||||
@@ -265,8 +260,7 @@ class Derived {
|
||||
fn F(self) {
|
||||
//@dump-sem-ir-begin
|
||||
// TODO: It should be possible to call protected methods in the base class.
|
||||
// CHECK:STDERR: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE+5]]:5-20: error: no matching function for call to 'instance_fn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE-8]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE+4]]:5-20: error: no matching function for call to 'instance_fn' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./function_member_protected.h:4:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./function_member_protected.h:4:19-20: note: cannot convert argument of incomplete type 'const Carbon::Main::Derived' to 'FunctionMemberProtected' for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -389,13 +383,11 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "overload_set.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_overload_set_protected.carbon:[[@LINE+4]]:3-64: error: cannot access protected member `OverloadSet` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_protected.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_protected.carbon:[[@LINE+3]]:3-64: error: cannot access protected member `OverloadSet` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:11:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Cpp.OverloadSet.OverloadSet(Cpp.ProtectedCall.ProtectedCall());
|
||||
// CHECK:STDERR: fail_import_overload_set_protected.carbon:[[@LINE+4]]:3-61: error: cannot access protected member `Overload` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_protected.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_protected.carbon:[[@LINE+3]]:3-61: error: cannot access protected member `Overload` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:12:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Cpp.OverloadSet.Overload(Cpp.ProtectedCall.ProtectedCall());
|
||||
@@ -442,13 +434,11 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "overload_set.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_overload_set_private.carbon:[[@LINE+4]]:3-60: error: cannot access private member `OverloadSet` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_private.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_private.carbon:[[@LINE+3]]:3-60: error: cannot access private member `OverloadSet` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:14:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Cpp.OverloadSet.OverloadSet(Cpp.PrivateCall.PrivateCall());
|
||||
// CHECK:STDERR: fail_import_overload_set_private.carbon:[[@LINE+4]]:3-57: error: cannot access private member `Overload` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_private.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_private.carbon:[[@LINE+3]]:3-57: error: cannot access private member `Overload` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:15:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Cpp.OverloadSet.Overload(Cpp.PrivateCall.PrivateCall());
|
||||
@@ -464,16 +454,14 @@ class D {
|
||||
extend base: Cpp.OverloadSet;
|
||||
|
||||
fn MakePrivate() -> D {
|
||||
// CHECK:STDERR: fail_import_overload_set_private_base.carbon:[[@LINE+4]]:21-62: error: cannot access private member `OverloadSet` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_private_base.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_private_base.carbon:[[@LINE+3]]:21-62: error: cannot access private member `OverloadSet` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:14:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
return {.base = OverloadSet(Cpp.PrivateCall.PrivateCall())};
|
||||
}
|
||||
|
||||
fn CallPrivate() {
|
||||
// CHECK:STDERR: fail_import_overload_set_private_base.carbon:[[@LINE+4]]:5-43: error: cannot access private member `Overload` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_private_base.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_private_base.carbon:[[@LINE+3]]:5-43: error: cannot access private member `Overload` of type `Cpp.OverloadSet` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:15:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Overload(Cpp.PrivateCall.PrivateCall());
|
||||
@@ -507,15 +495,11 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "overload_set_base_class.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_overload_set_public_base_class_call_non_public.carbon:[[@LINE+5]]:3-64: error: cannot access protected member `Overload` of type `Cpp.OverloadPublic` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_public_base_class_call_non_public.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./overload_set_base_class.h:2:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_public_base_class_call_non_public.carbon:[[@LINE+3]]:3-64: error: cannot access protected member `Overload` of type `Cpp.OverloadPublic` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:12:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Cpp.OverloadPublic.Overload(Cpp.ProtectedCall.ProtectedCall());
|
||||
// CHECK:STDERR: fail_import_overload_set_public_base_class_call_non_public.carbon:[[@LINE+5]]:3-60: error: cannot access private member `Overload` of type `Cpp.OverloadPublic` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_public_base_class_call_non_public.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./overload_set_base_class.h:2:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_public_base_class_call_non_public.carbon:[[@LINE+3]]:3-60: error: cannot access private member `Overload` of type `Cpp.OverloadPublic` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:15:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Cpp.OverloadPublic.Overload(Cpp.PrivateCall.PrivateCall());
|
||||
@@ -548,9 +532,7 @@ class Derived {
|
||||
extend base: Cpp.OverloadPublic;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_overload_set_public_base_class_derived_call_private.carbon:[[@LINE+5]]:5-43: error: cannot access private member `Overload` of type `Cpp.OverloadPublic` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_public_base_class_derived_call_private.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./overload_set_base_class.h:2:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_public_base_class_derived_call_private.carbon:[[@LINE+3]]:5-43: error: cannot access private member `Overload` of type `Cpp.OverloadPublic` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:15:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Overload(Cpp.PrivateCall.PrivateCall());
|
||||
@@ -605,9 +587,7 @@ class Derived {
|
||||
extend base: Cpp.OverloadProtected;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_overload_set_protected_base_class_derived_call_private.carbon:[[@LINE+5]]:5-43: error: cannot access private member `Overload` of type `Cpp.OverloadProtected` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_import_overload_set_protected_base_class_derived_call_private.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: included from: ./overload_set_base_class.h:2:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_overload_set_protected_base_class_derived_call_private.carbon:[[@LINE+3]]:5-43: error: cannot access private member `Overload` of type `Cpp.OverloadProtected` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./overload_set.h:15:15: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
Overload(Cpp.PrivateCall.PrivateCall());
|
||||
|
||||
@@ -208,13 +208,11 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+4]]:32-52: error: call to deleted function 'DeletedC' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+3]]:32-52: error: call to deleted function 'DeletedC' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./deleted.h:4:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.DeletedC = Cpp.DeletedC.DeletedC();
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+5]]:32-52: error: call to deleted function 'DeletedD' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted.carbon:[[@LINE+4]]:32-52: error: call to deleted function 'DeletedD' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./deleted.h:9:3: note: candidate constructor has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./deleted.h:10:3: note: candidate constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
|
||||
@@ -59,27 +59,23 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "object_param_qualifiers.h";
|
||||
|
||||
fn Value(v: Cpp.HasQualifiers) {
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-9: error: no matching function for call to 'plain' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+3]]:3-9: error: no matching function for call to 'plain' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:3:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
v.plain();
|
||||
|
||||
// TODO: This should remain invalid once we support `volatile`.
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'volatile_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+3]]:3-17: error: no matching function for call to 'volatile_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:5:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
v.volatile_this();
|
||||
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-12: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+3]]:3-12: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
v.ref_this();
|
||||
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+4]]:3-16: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE-23]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_by_value.carbon:[[@LINE+3]]:3-16: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable: 'this' argument has type 'const HasQualifiers', but method is not marked const [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
v.ref_ref_this();
|
||||
@@ -105,15 +101,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "object_param_qualifiers.h";
|
||||
|
||||
fn Ref(p: Cpp.HasQualifiers*) {
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:10:20-21: note: expects an rvalue for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
p->ref_ref_this();
|
||||
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+5]]:3-23: error: no matching function for call to 'const_ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_ref_ref.carbon:[[@LINE+4]]:3-23: error: no matching function for call to 'const_ref_ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:11:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:11:26-27: note: expects an rvalue for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -129,8 +123,7 @@ import Cpp library "object_param_qualifiers.h";
|
||||
fn Make() -> Cpp.HasQualifiers;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_bad_object_param_qualifiers_for_temporary.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'ref_this' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./object_param_qualifiers.h:7:16-17: note: expects an lvalue for object argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
|
||||
@@ -41,8 +41,7 @@ import Cpp library "overload.h";
|
||||
class Overload0Params {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+6]]:3-22: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: included from: fail_overload_no_matching_arity.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+5]]:3-22: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: ./overload.h:6:16: note: base class function has more parameters (1 vs 0 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: ./overload.h:7:16: note: base class function has more parameters (1 vs 0 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: ./overload.h:8:16: note: base class function has more parameters (2 vs 0 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
@@ -53,8 +52,7 @@ class Overload0Params {
|
||||
class Overload3Params {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+6]]:3-52: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: included from: fail_overload_no_matching_arity.carbon:[[@LINE-18]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_no_matching_arity.carbon:[[@LINE+5]]:3-52: error: override without compatible virtual in base class [OverrideWithoutVirtualInBase]
|
||||
// CHECK:STDERR: ./overload.h:6:16: note: base class function has fewer parameters (1 vs 3 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: ./overload.h:7:16: note: base class function has fewer parameters (1 vs 3 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
// CHECK:STDERR: ./overload.h:8:16: note: base class function has fewer parameters (2 vs 3 excluding `self`) [OverrideCandidateArityMismatch]
|
||||
@@ -72,14 +70,13 @@ import Cpp library "overload.h";
|
||||
class OverloadX {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:3-32: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+9]]:3-32: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+9]]:3-32: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:3-32: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+7]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+6]]:3-32: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+5]]:3-32: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+5]]:3-32: error: cannot implicitly convert expression of type `Cpp.Y` to `Cpp.X` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:3-32: note: type `Cpp.Y` does not implement interface `Core.ImplicitAs(Cpp.X)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+3]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ./overload.h:7:16: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR:
|
||||
override fn f(self, x: Cpp.X);
|
||||
@@ -88,14 +85,13 @@ class OverloadX {
|
||||
class OverloadY {
|
||||
extend base: Cpp.OverloadedBase;
|
||||
//
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+10]]:3-32: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+9]]:3-32: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+9]]:3-32: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+8]]:3-32: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+7]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+6]]:3-32: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+5]]:3-32: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: included from: fail_overload_type.carbon:[[@LINE-28]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+5]]:3-32: error: cannot implicitly convert expression of type `Cpp.X` to `Cpp.Y` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+4]]:3-32: note: type `Cpp.X` does not implement interface `Core.ImplicitAs(Cpp.Y)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: fail_overload_type.carbon:[[@LINE+3]]:23-30: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ./overload.h:6:16: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR:
|
||||
override fn f(self, y: Cpp.Y);
|
||||
|
||||
+4
-7
@@ -234,8 +234,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE+4]]:11-16: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_overflow_max.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE+3]]:11-16: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x8000);
|
||||
@@ -260,8 +259,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE+4]]:11-17: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_overflow_min.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE+3]]:11-17: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-0x8001);
|
||||
@@ -274,9 +272,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+5]]:11-18: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+4]]:11-18: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_int32_arg.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+4]]:11-18: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+3]]:11-18: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
|
||||
+4
-8
@@ -54,8 +54,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "int_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE+4]]:11-21: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_int_param_overflow_max.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE+3]]:11-21: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: ./int_param.h:2:14: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x8000_0000);
|
||||
@@ -80,8 +79,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "int_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE+4]]:11-22: error: integer value -2147483649 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_int_param_overflow_min.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE+3]]:11-22: error: integer value -2147483649 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: ./int_param.h:2:14: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-0x8000_0001);
|
||||
@@ -156,16 +154,14 @@ import Cpp library "unsigned_int_param.h";
|
||||
fn F() {
|
||||
Cpp.foo(0);
|
||||
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+4]]:11-12: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: included from: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+3]]:11-12: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: ./unsigned_int_param.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-1);
|
||||
|
||||
Cpp.foo(0x0_FFFF_FFFF);
|
||||
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+4]]:11-23: error: integer value 4294967296 too large for type `u32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+3]]:11-23: error: integer value 4294967296 too large for type `u32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: ./unsigned_int_param.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x1_0000_0000);
|
||||
|
||||
+16
-18
@@ -51,16 +51,14 @@ fn F() {
|
||||
Cpp.TakesFunction(Cpp.Function);
|
||||
|
||||
var n: array(i32, 42);
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+5]]:3-19: error: no matching function for call to 'TakesFunction' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_todo_call_params_2.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:3-19: error: no matching function for call to 'TakesFunction' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./params.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./params.h:3:20-29: note: no known conversion from 'int * _Nonnull' to 'int (*)(int)' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(&n[0]);
|
||||
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+5]]:21-31: error: cannot implicitly convert expression of type `Cpp.nullptr_t` to `<C++ type int (*)(int)>` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:21-31: note: type `Cpp.nullptr_t` does not implement interface `Core.ImplicitAs(<C++ type int (*)(int)>)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_call_params_2.carbon:[[@LINE-20]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:21-31: error: cannot implicitly convert expression of type `Cpp.nullptr_t` to `<C++ type int (*)(int)>` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+3]]:21-31: note: type `Cpp.nullptr_t` does not implement interface `Core.ImplicitAs(<C++ type int (*)(int)>)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./params.h:3:24: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(Cpp.nullptr);
|
||||
@@ -876,25 +874,25 @@ fn F() {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.9c3 = ref_binding_pattern n [concrete = constants.%n.patt.368]
|
||||
// CHECK:STDOUT: %n.var_patt: %pattern_type.9c3 = var_pattern %n.patt [concrete = constants.%n.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc20: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc19: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %n.ref: ref %Array.3b5 = name_ref n, %n
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc20_24.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc19_24.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc20_24.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc20_24.2(%int_0) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_24.2: %i32 = converted %int_0, %.loc20_24.1 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_25: ref %i32 = array_index %n.ref, %.loc20_24.2
|
||||
// CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc20_25
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc27: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %bound_method.loc19_24.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc19_24.2(%int_0) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc19_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc19_24.2: %i32 = converted %int_0, %.loc19_24.1 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc19_25: ref %i32 = array_index %n.ref, %.loc19_24.2
|
||||
// CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc19_25
|
||||
// CHECK:STDOUT: %Cpp.ref.loc25_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc25: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc25_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %nullptr.ref: %Cpp.nullptr_t = name_ref nullptr, %uninit [concrete = constants.%uninit]
|
||||
// CHECK:STDOUT: %.loc27: %.659 = converted %nullptr.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc25: %.659 = converted %nullptr.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %TakesFunction.call: init %empty_tuple.type = call imports.%TakesFunction.decl(<error>)
|
||||
// CHECK:STDOUT: %Destroy.facet.loc14_3.1: %Destroy.type = facet_value constants.%Array.3b5, (constants.%DestroyImpl.impl_witness.be3, constants.%custom_witness.b80ef6.3) [concrete = constants.%Destroy.facet.843]
|
||||
// CHECK:STDOUT: %.loc14_3.2: %Destroy.type = converted constants.%Array.3b5, %Destroy.facet.loc14_3.1 [concrete = constants.%Destroy.facet.843]
|
||||
|
||||
@@ -63,50 +63,43 @@ import Cpp library "functions.h";
|
||||
|
||||
fn Call() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:2:21-54: note: requires at least 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalNoReturn(1);
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:2:21-54: note: requires at least 2 arguments, but 0 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalNoReturn();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-19]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:3:22-55: note: requires at least 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalReturnInt(1);
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-26]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:3:22-55: note: requires at least 2 arguments, but 0 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalReturnInt();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'B' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-33]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'B' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:6:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:6:10-25: note: requires at least argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
({} as Cpp.X).B();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-9: error: no matching function for call to 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-40]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-9: error: no matching function for call to 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:7:15: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:7:17-32: note: requires at least argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.X.C();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'D' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-47]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'D' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./functions.h:8:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:8:10-33: note: requires at least non-object argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -928,49 +921,49 @@ fn Call() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc13: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc20: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc27: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc34: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc34: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc41_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc41: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc41_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc41_5.3: init %X to %.loc41_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc41_7.1: init %X = converted %.loc41_5.1, %.loc41_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc41_7.2: ref %X = temporary %.loc41_5.2, %.loc41_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc12: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc18: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc24: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc24: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc30: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc36_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc36: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc36_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc36_5.3: init %X to %.loc36_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc36_7.1: init %X = converted %.loc36_5.1, %.loc36_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc36_7.2: ref %X = temporary %.loc36_5.2, %.loc36_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc41: <bound method> = bound_method %.loc41_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc41_7.1: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc41_7.3: %Destroy.type = converted constants.%X, %Destroy.facet.loc41_7.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc41_7.2: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc41_7.4: %Destroy.type = converted constants.%X, %Destroy.facet.loc41_7.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %bound_method.loc36: <bound method> = bound_method %.loc36_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc36_7.1: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc36_7.3: %Destroy.type = converted constants.%X, %Destroy.facet.loc36_7.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc36_7.2: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc36_7.4: %Destroy.type = converted constants.%X, %Destroy.facet.loc36_7.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc41: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%.loc41_7.2)
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc36: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%.loc36_7.2)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc42: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc48_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc48: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc48: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc55_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc55: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc55: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc55_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc55_5.3: init %X to %.loc55_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc55_7.1: init %X = converted %.loc55_5.1, %.loc55_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc55_7.2: ref %X = temporary %.loc55_5.2, %.loc55_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %.loc48_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc48_5.3: init %X to %.loc48_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc48_7.1: init %X = converted %.loc48_5.1, %.loc48_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc48_7.2: ref %X = temporary %.loc48_5.2, %.loc48_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc55: <bound method> = bound_method %.loc55_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc55_7.1: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc55_7.3: %Destroy.type = converted constants.%X, %Destroy.facet.loc55_7.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc55_7.2: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc55_7.4: %Destroy.type = converted constants.%X, %Destroy.facet.loc55_7.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %bound_method.loc48: <bound method> = bound_method %.loc48_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc48_7.1: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc48_7.3: %Destroy.type = converted constants.%X, %Destroy.facet.loc48_7.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc48_7.2: %Destroy.type = facet_value constants.%X, (constants.%DestroyImpl.impl_witness.a05, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc48_7.4: %Destroy.type = converted constants.%X, %Destroy.facet.loc48_7.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc55: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%.loc55_7.2)
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc48: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%.loc48_7.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -81,8 +81,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "special_name.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE+5]]:3-12: error: no matching function for call to 'base' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE+4]]:3-12: error: no matching function for call to 'base' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./special_name.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./special_name.h:2:10-11: note: requires 0 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
|
||||
@@ -126,6 +126,8 @@ fn F() {
|
||||
|
||||
// --- forward_decl.h
|
||||
|
||||
// CHECK:STDERR: error: calling function with incomplete return type 'Incomplete' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./forward_decl.h:[[@LINE+1]]:7: note: forward declaration of 'Incomplete' [CppInteropParseNote]
|
||||
class Incomplete;
|
||||
|
||||
using CallbackType = Incomplete (*)();
|
||||
@@ -146,9 +148,6 @@ fn F() {
|
||||
// --- fail_use_forward_decl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: error: calling function with incomplete return type 'Incomplete' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_use_forward_decl.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./forward_decl.h:2:7: note: forward declaration of 'Incomplete' [CppInteropParseNote]
|
||||
import Cpp library "forward_decl.h";
|
||||
|
||||
fn F() {
|
||||
@@ -156,7 +155,7 @@ fn F() {
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+5]]:3-24: error: function returns incomplete type `Cpp.Incomplete` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_use_forward_decl.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./forward_decl.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: ./forward_decl.h:4:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
Cpp.ReturnCallback()();
|
||||
|
||||
@@ -174,8 +174,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "negative_literal_passed_to_unsigned.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+4]]:27-28: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: included from: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+3]]:27-28: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: ./negative_literal_passed_to_unsigned.h:2:39: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.neg_to_unsigned_foo(-1);
|
||||
@@ -203,8 +202,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+4]]:25-32: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_large_floating_point_literal.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+3]]:25-32: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: ./floating_point_literal.h:3:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.float_literal_foo(1.8e+308);
|
||||
@@ -249,37 +247,32 @@ import Cpp library "struct_init.h";
|
||||
fn MakeThreeFields() -> {.a: i32, .b: i32, .c: i32};
|
||||
|
||||
fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: i32, .c: i32}) {
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-46: error: cannot implicitly convert expression of type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: note: type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: error: cannot implicitly convert expression of type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+3]]:23-46: note: type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-27: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-27: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-27: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+3]]:23-27: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-31: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-21]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-31: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+3]]:23-31: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-39: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-39: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-28]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-39: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+3]]:23-39: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(MakeThreeFields());
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-46: error: cannot implicitly convert expression of type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: note: type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-35]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: error: cannot implicitly convert expression of type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+3]]:23-46: note: type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
@@ -292,15 +285,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "struct_init.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_struct_init_field_mismatch.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+4]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./struct_init.h:10:22-34: note: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3, .d = 4});
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_struct_init_field_mismatch.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+4]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./struct_init.h:10:22-34: note: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -331,30 +322,26 @@ import Cpp library "struct_init.h";
|
||||
fn MakeEmpty() -> ();
|
||||
|
||||
fn Empty(value: (), ref reference: ()) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-21: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-21: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-21: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:20-21: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(());
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-24: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-24: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-24: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:20-24: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-28: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-28: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-24]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-28: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:20-28: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-30: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-30: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-31]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-30: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:20-30: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(MakeEmpty());
|
||||
@@ -363,30 +350,26 @@ fn Empty(value: (), ref reference: ()) {
|
||||
fn MakeThreeFields() -> (i32, i32, i32);
|
||||
|
||||
fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-42]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:23-31: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields((1, 2, 3));
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-27: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-27: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-49]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-27: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:23-27: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-56]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:23-31: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-39: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-39: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-63]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-39: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+3]]:23-39: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(MakeThreeFields());
|
||||
@@ -410,16 +393,14 @@ import Cpp library "int_from_struct.h";
|
||||
fn F() {
|
||||
// C++ permits `{}` to be used to initialize an int, but Carbon does not.
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+5]]:15-16: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+3]]:15-16: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./int_from_struct.h:2:18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassInt({});
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+5]]:15-16: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+3]]:15-16: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./int_from_struct.h:2:18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassInt(());
|
||||
@@ -435,16 +416,14 @@ fn F() {
|
||||
// C++ overload resolution prefers to convert `{}` to `int` rather than to an
|
||||
// empty struct. So that's the overload we pick, even though we can't call it.
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+5]]:22-23: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct_overloaded.carbon:[[@LINE-8]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+3]]:22-23: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./int_from_struct.h:6:25: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassOverloaded({});
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+5]]:22-23: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct_overloaded.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+3]]:22-23: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./int_from_struct.h:6:25: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassOverloaded(());
|
||||
@@ -470,8 +449,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "nested_structs.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE+5]]:3-11: error: no matching function for call to 'TakeB' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE+4]]:3-11: error: no matching function for call to 'TakeB' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:12: note: cannot convert initializer list argument to 'B' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -485,9 +463,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "nested_structs.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+5]]:13-43: error: cannot implicitly convert expression of type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` to `Cpp.B` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+4]]:13-43: note: type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_pass_nested_structs.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+4]]:13-43: error: cannot implicitly convert expression of type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` to `Cpp.B` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+3]]:13-43: note: type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:13: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
@@ -522,9 +499,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "signedness_change.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+5]]:22-29: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+4]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_signedness_change_rejected.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+4]]:22-29: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+3]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./signedness_change.h:2:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.signedness_foo(1 as i32);
|
||||
@@ -541,9 +517,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "downsizing_rejected.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+5]]:22-29: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+4]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_import_downsizing_rejected.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+4]]:22-29: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+3]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./downsizing_rejected.h:2:27: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.downsizing_foo(1 as i32);
|
||||
@@ -564,8 +539,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "no_viable_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+5]]:3-19: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_no_viable_function.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+4]]:3-19: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:20-33: note: requires 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -588,8 +562,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "ambiguous_overload.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+5]]:3-19: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_ambiguous_overload.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+4]]:3-19: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:3:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
@@ -612,8 +585,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+5]]:3-17: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted_function.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+4]]:3-17: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./deleted_function.h:3:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./deleted_function.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
|
||||
@@ -43,8 +43,7 @@ fn G() -> const Cpp.NonNullableParamS;
|
||||
|
||||
fn F() {
|
||||
var s: const Cpp.NonNullableParamS = G();
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+5]]:3-28: error: no matching function for call to 'non_nullable_param_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+4]]:3-28: error: no matching function for call to 'non_nullable_param_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:29-55: note: 1st argument ('const NonNullableParamS * _Nonnull') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
|
||||
+109
-120
@@ -44,31 +44,27 @@ fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var v: Cpp.S;
|
||||
let s: Cpp.S = v;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(s);
|
||||
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(s as const Cpp.S);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-22]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: no known conversion from 'T' to 'S &' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(t);
|
||||
|
||||
var u: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-30]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -123,8 +119,7 @@ import Cpp library "param_rvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
let s: Cpp.S = {};
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -140,23 +135,20 @@ import Cpp library "param_rvalue_ref.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var s: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: expects an rvalue for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(s);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: no known conversion from 'T' to 'S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(t);
|
||||
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-21]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+4]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -213,8 +205,7 @@ import Cpp library "param_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+4]]:3-22: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:23-30: note: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -269,16 +260,14 @@ import Cpp library "param_const_rvalue_ref.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var s: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+4]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:23-31: note: expects an rvalue for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstRValue(s);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+4]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:23-31: note: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
@@ -618,28 +607,28 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = value_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc15: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc15: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc22: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc22: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc22: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc22: type = const_type %S.ref.loc22 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc22_21.1: %const = as_compatible %s.ref.loc22
|
||||
// CHECK:STDOUT: %.loc22_21.2: %const = converted %s.ref.loc22, %.loc22_21.1
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc14: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc14: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc20: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc20: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc20: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc20: type = const_type %S.ref.loc20 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc20_21.1: %const = as_compatible %s.ref.loc20
|
||||
// CHECK:STDOUT: %.loc20_21.2: %const = converted %s.ref.loc20, %.loc20_21.1
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc24: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc24_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc24 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc24: type = facet_access_type %.loc24_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc24_15.2: type = converted %.loc24_15.1, %as_type.loc24 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc22: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc22_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc22 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc22: type = facet_access_type %.loc22_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc22_15.2: type = converted %.loc22_15.1, %as_type.loc22 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc24_3.1: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc24: init %T.ed0 to %.loc24_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc24
|
||||
// CHECK:STDOUT: %.loc24_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc22_3.1: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc22: init %T.ed0 to %.loc22_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc22
|
||||
// CHECK:STDOUT: %.loc22_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -647,47 +636,47 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt.420]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc30: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc27: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %u.var: ref %S = var_storage %u.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc32: %DefaultOrUnformed.type = facet_value constants.%S, (constants.%DefaultOrUnformed.impl_witness.e4a) [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %.loc32_15.1: %DefaultOrUnformed.type = converted constants.%S, %DefaultOrUnformed.facet.loc32 [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %as_type.loc32: type = facet_access_type %.loc32_15.1 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc32_15.2: type = converted %.loc32_15.1, %as_type.loc32 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc29: %DefaultOrUnformed.type = facet_value constants.%S, (constants.%DefaultOrUnformed.impl_witness.e4a) [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %.loc29_15.1: %DefaultOrUnformed.type = converted constants.%S, %DefaultOrUnformed.facet.loc29 [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %as_type.loc29: type = facet_access_type %.loc29_15.1 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc29_15.2: type = converted %.loc29_15.1, %as_type.loc29 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc32_3.1: ref %S = splice_block %u.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc32: init %S to %.loc32_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.3()
|
||||
// CHECK:STDOUT: assign %u.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc32
|
||||
// CHECK:STDOUT: %.loc32_13: type = splice_block %S.ref.loc32 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc32: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc29_3.1: ref %S = splice_block %u.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc29: init %S to %.loc29_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.3()
|
||||
// CHECK:STDOUT: assign %u.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc29
|
||||
// CHECK:STDOUT: %.loc29_13: type = splice_block %S.ref.loc29 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %u: ref %S = wrapper_binding u, %u.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %u.patt: %pattern_type.0f5 = ref_binding_pattern u [concrete = constants.%u.patt]
|
||||
// CHECK:STDOUT: %u.var_patt: %pattern_type.0f5 = var_pattern %u.patt [concrete = constants.%u.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc38: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc34_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc34: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %u.ref: ref %S = name_ref u, %u
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc38: type = const_type %S.ref.loc38 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc38_21.1: ref %const = as_compatible %u.ref
|
||||
// CHECK:STDOUT: %.loc38_21.2: ref %const = converted %u.ref, %.loc38_21.1
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.1: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc32_3.2: %Destroy.type = converted constants.%S, %Destroy.facet.loc32_3.1 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc32_3.2: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc32_3.3: %Destroy.type = converted constants.%S, %Destroy.facet.loc32_3.2 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc34_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc34: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc34: type = const_type %S.ref.loc34 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc34_21.1: ref %const = as_compatible %u.ref
|
||||
// CHECK:STDOUT: %.loc34_21.2: ref %const = converted %u.ref, %.loc34_21.1
|
||||
// CHECK:STDOUT: %Destroy.facet.loc29_3.1: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc29_3.2: %Destroy.type = converted constants.%S, %Destroy.facet.loc29_3.1 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc29_3.2: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc29_3.3: %Destroy.type = converted constants.%S, %Destroy.facet.loc29_3.2 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc32: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%u.var)
|
||||
// CHECK:STDOUT: %Destroy.facet.loc24_3.1: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc24_3.2: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc24_3.1 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc24_3.2: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc24_3.3: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc24_3.2 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc29: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%u.var)
|
||||
// CHECK:STDOUT: %Destroy.facet.loc22_3.1: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc22_3.2: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc22_3.1 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc22_3.2: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc22_3.3: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc22_3.2 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc24: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%t.var)
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc22: init %empty_tuple.type = call %SelfDestruct.specific_fn.2(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%S, %Destroy.facet.loc8_3.1 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.580]
|
||||
@@ -836,20 +825,20 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = ref_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.0f5 = var_pattern %s.patt [concrete = constants.%s.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc14: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc13: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc16: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc16_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc16 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc16: type = facet_access_type %.loc16_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %.loc16_15.1, %as_type.loc16 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc15: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc15_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc15 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc15: type = facet_access_type %.loc15_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc15_15.2: type = converted %.loc15_15.1, %as_type.loc15 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16: init %T.ed0 to %.loc16_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc15_3.1: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc15: init %T.ed0 to %.loc15_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc15
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -857,28 +846,28 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt.420]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc22: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc20: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc29: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc29_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc29_21.2: ref %S = temporary_storage
|
||||
// CHECK:STDOUT: %.loc29_21.3: init %S to %.loc29_21.2 = class_init () [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc29_23: init %S = converted %.loc29_21.1, %.loc29_21.3 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref.loc29_45 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc29_33.1: init %const = as_compatible %.loc29_23 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %.loc29_33.2: init %const = converted %.loc29_23, %.loc29_33.1 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc26_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc26: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc26_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc26_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc26_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc26_21.2: ref %S = temporary_storage
|
||||
// CHECK:STDOUT: %.loc26_21.3: init %S to %.loc26_21.2 = class_init () [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc26_23: init %S = converted %.loc26_21.1, %.loc26_21.3 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc26_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc26_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref.loc26_45 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc26_33.1: init %const = as_compatible %.loc26_23 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %.loc26_33.2: init %const = converted %.loc26_23, %.loc26_33.1 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc15_3.1: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc15_3.2: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc15_3.1 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc15_3.2: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc15_3.3: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc15_3.2 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc16: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%t.var)
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc15: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%S, %Destroy.facet.loc8_3.1 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.580]
|
||||
@@ -1224,20 +1213,20 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = ref_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.0f5 = var_pattern %s.patt [concrete = constants.%s.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc14: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc13: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc16: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc16_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc16 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc16: type = facet_access_type %.loc16_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %.loc16_15.1, %as_type.loc16 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc15: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc15_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc15 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc15: type = facet_access_type %.loc15_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc15_15.2: type = converted %.loc15_15.1, %as_type.loc15 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16: init %T.ed0 to %.loc16_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc15_3.1: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc15: init %T.ed0 to %.loc15_3.1 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc15
|
||||
// CHECK:STDOUT: %.loc15_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -1245,15 +1234,15 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt.420]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc22: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc20: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc15_3.1: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc15_3.2: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc15_3.1 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc15_3.2: %Destroy.type = facet_value constants.%T.ed0, (constants.%DestroyImpl.impl_witness.68c, constants.%custom_witness.fe1878.1) [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: %.loc15_3.3: %Destroy.type = converted constants.%T.ed0, %Destroy.facet.loc15_3.2 [concrete = constants.%Destroy.facet.8f8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc16: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%t.var)
|
||||
// CHECK:STDOUT: %SelfDestruct.call.loc15: init %empty_tuple.type = call %SelfDestruct.specific_fn.1(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.facet.loc8_3.1: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %Destroy.type = converted constants.%S, %Destroy.facet.loc8_3.1 [concrete = constants.%Destroy.facet.580]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc8_3.2: %Destroy.type = facet_value constants.%S, (constants.%DestroyImpl.impl_witness.b60, constants.%custom_witness.fe1878.2) [concrete = constants.%Destroy.facet.580]
|
||||
|
||||
+5
-10
@@ -83,24 +83,21 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "types.h";
|
||||
|
||||
fn CopyDeletedCopy(c: Cpp.DeletedCopy) -> Cpp.DeletedCopy {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:14:3: note: 'DeletedCopy' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyMoveOnly(c: Cpp.MoveOnly) -> Cpp.MoveOnly {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:19:3: note: copy constructor is implicitly deleted because 'MoveOnly' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
}
|
||||
|
||||
fn CopyDeletedMove(c: Cpp.DeletedMove) -> Cpp.DeletedMove {
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-20]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:24:3: note: copy constructor is implicitly deleted because 'DeletedMove' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
@@ -124,8 +121,7 @@ fn CopyAmbiguousCopy(c: Cpp.AmbiguousCopy) -> Cpp.AmbiguousCopy {
|
||||
|
||||
fn CopyPrivateCopy(c: Cpp.PrivateCopy) -> Cpp.PrivateCopy {
|
||||
// TODO: Note is missing location.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: cannot access private member `PrivateCopy` of type `Cpp.PrivateCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-45]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot access private member `PrivateCopy` of type `Cpp.PrivateCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:40:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
@@ -133,8 +129,7 @@ fn CopyPrivateCopy(c: Cpp.PrivateCopy) -> Cpp.PrivateCopy {
|
||||
|
||||
fn CopyProtectedCopy(c: Cpp.ProtectedCopy) -> Cpp.ProtectedCopy {
|
||||
// TODO: Note is missing location.
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+4]]:10: error: cannot access protected member `ProtectedCopy` of type `Cpp.ProtectedCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_copy_noncopyable.carbon:[[@LINE-54]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_copy_noncopyable.carbon:[[@LINE+3]]:10: error: cannot access protected member `ProtectedCopy` of type `Cpp.ProtectedCopy` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:45:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
return c;
|
||||
|
||||
+62
-68
@@ -77,8 +77,7 @@ class Derived {
|
||||
|
||||
fn DestroyClassWithProtectedBaseDestructor() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+5]]:3-23: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_destroy_protected_base_destructor.carbon:[[@LINE+4]]:3-23: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
@@ -99,8 +98,7 @@ class Derived {
|
||||
fn DestroyClassWithPrivateBaseDestructor() {
|
||||
//@dump-sem-ir-begin
|
||||
// TODO: We should not allow this, as the destructor of the base class is private.
|
||||
// CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE+5]]:3-23: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_destroy_private_base_destructor.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_private_base_destructor.carbon:[[@LINE+4]]:3-23: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
@@ -126,8 +124,7 @@ fn AmbiguousDestroy() {
|
||||
}
|
||||
|
||||
fn DeletedDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+8]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+7]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
@@ -138,8 +135,7 @@ fn DeletedDestroy() {
|
||||
}
|
||||
|
||||
fn PrivateDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+5]]:3-37: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-27]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3-37: error: cannot access private member `<C++ destructor>` of type `Cpp.PrivateDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:28:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
@@ -147,8 +143,7 @@ fn PrivateDestroy() {
|
||||
}
|
||||
|
||||
fn ProtectedDestroy() {
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+5]]:3-39: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_destroy_nondestroyable.carbon:[[@LINE-36]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_destroy_nondestroyable.carbon:[[@LINE+4]]:3-39: error: cannot access protected member `<C++ destructor>` of type `Cpp.ProtectedDestructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./types.h:33:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
@@ -188,8 +183,7 @@ class AdaptNoDestroy {
|
||||
fn Make() -> AdaptNoDestroy;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_no_destroy.carbon:[[@LINE+5]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_no_destroy.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_no_destroy.carbon:[[@LINE+4]]:3: error: attempt to use a deleted function [CppInteropParseError]
|
||||
// CHECK:STDERR: ./types.h:23:3: note: '~DeletedDestructor' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: min_prelude/parts/destroy.carbon:32:1-39: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
@@ -402,7 +396,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.e5d: %SubobjectDestroy.type = facet_value %ProtectedDestructor, (%custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %DestroyImpl.impl_witness.721: <witness> = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.e5d) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.fe4: %Destroy.type = facet_value %ProtectedDestructor, (%DestroyImpl.impl_witness.721, %custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc17_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.b80ef6.2: <witness> = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.1fc: %SubobjectDestroy.type = facet_value %Derived, (%custom_witness.b80ef6.2) [concrete]
|
||||
@@ -418,52 +412,52 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @DestroyClassWithProtectedBaseDestructor() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc17_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc17_38.1: %struct_type.base.f5e = struct_literal (%.loc17_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc17_38.2: ref %.a6c = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc17_37.2: init %.a6c to %.loc17_38.2 = class_init () [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc17_38.3: init %.a6c = converted %.loc17_37.1, %.loc17_37.2 [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc17_38.4: init %ProtectedDestructor = as_compatible %.loc17_38.3 [concrete = constants.%ProtectedDestructor.val]
|
||||
// CHECK:STDOUT: %.loc17_38.5: init %Derived to %a.var = class_init (%.loc17_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc17_3.1: init %Derived = converted %.loc17_38.1, %.loc17_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc17_3.1
|
||||
// CHECK:STDOUT: %.loc16_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc16_38.1: %struct_type.base.f5e = struct_literal (%.loc16_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc16_38.2: ref %.a6c = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc16_37.2: init %.a6c to %.loc16_38.2 = class_init () [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc16_38.3: init %.a6c = converted %.loc16_37.1, %.loc16_37.2 [concrete = constants.%empty_struct.ec1]
|
||||
// CHECK:STDOUT: %.loc16_38.4: init %ProtectedDestructor = as_compatible %.loc16_38.3 [concrete = constants.%ProtectedDestructor.val]
|
||||
// CHECK:STDOUT: %.loc16_38.5: init %Derived to %a.var = class_init (%.loc16_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc16_3.1: init %Derived = converted %.loc16_38.1, %.loc16_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc16_3.1
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%a.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.1(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc16_3.1(%self.param: ref %struct_type.base.454) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc17_3.1: ref %ProtectedDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %ProtectedDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc16_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc16_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7]
|
||||
// CHECK:STDOUT: %.loc17_3.1: ref %ProtectedDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %ProtectedDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.1: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.2: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.1 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc16_3.2: %Destroy.type = facet_value constants.%ProtectedDestructor, (constants.%DestroyImpl.impl_witness.721, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: %.loc16_3.3: %Destroy.type = converted constants.%ProtectedDestructor, %Destroy.facet.loc16_3.2 [concrete = constants.%Destroy.facet.fe4]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc16_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -498,7 +492,7 @@ fn F() {
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.be1: %SubobjectDestroy.type = facet_value %PrivateDestructor, (%custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %DestroyImpl.impl_witness.a8a: <witness> = impl_witness imports.%DestroyImpl.impl_witness_table, @T.as_type.as.DestroyImpl.impl(%SubobjectDestroy.facet.be1) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.facet.75a: %Destroy.type = facet_value %PrivateDestructor, (%DestroyImpl.impl_witness.a8a, %custom_witness.fe1) [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc18_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.type.6870fd.2: type = fn_type @SubobjectDestroy.WithSelf.Op.loc17_3.2 [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.WithSelf.Op.30f1ee.2: %SubobjectDestroy.WithSelf.Op.type.6870fd.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %custom_witness.b80ef6.2: <witness> = custom_witness (%SubobjectDestroy.WithSelf.Op.30f1ee.2), @SubobjectDestroy [concrete]
|
||||
// CHECK:STDOUT: %SubobjectDestroy.facet.1fc: %SubobjectDestroy.type = facet_value %Derived, (%custom_witness.b80ef6.2) [concrete]
|
||||
@@ -514,52 +508,52 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @DestroyClassWithPrivateBaseDestructor() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %a.var: ref %Derived = var_storage %a.var_patt
|
||||
// CHECK:STDOUT: %.loc18_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc18_38.1: %struct_type.base.f5e = struct_literal (%.loc18_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc18_38.2: ref %.c73 = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc18_37.2: init %.c73 to %.loc18_38.2 = class_init () [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc18_38.3: init %.c73 = converted %.loc18_37.1, %.loc18_37.2 [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc18_38.4: init %PrivateDestructor = as_compatible %.loc18_38.3 [concrete = constants.%PrivateDestructor.val]
|
||||
// CHECK:STDOUT: %.loc18_38.5: init %Derived to %a.var = class_init (%.loc18_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc18_3.1: init %Derived = converted %.loc18_38.1, %.loc18_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc18_3.1
|
||||
// CHECK:STDOUT: %.loc17_37.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %.loc17_38.1: %struct_type.base.f5e = struct_literal (%.loc17_37.1) [concrete = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc17_38.2: ref %.c73 = class_element_access %a.var, element0
|
||||
// CHECK:STDOUT: %.loc17_37.2: init %.c73 to %.loc17_38.2 = class_init () [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc17_38.3: init %.c73 = converted %.loc17_37.1, %.loc17_37.2 [concrete = constants.%empty_struct.d8b]
|
||||
// CHECK:STDOUT: %.loc17_38.4: init %PrivateDestructor = as_compatible %.loc17_38.3 [concrete = constants.%PrivateDestructor.val]
|
||||
// CHECK:STDOUT: %.loc17_38.5: init %Derived to %a.var = class_init (%.loc17_38.4) [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: %.loc17_3.1: init %Derived = converted %.loc17_38.1, %.loc17_38.5 [concrete = constants.%Derived.val]
|
||||
// CHECK:STDOUT: assign %a.var, %.loc17_3.1
|
||||
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [concrete = constants.%Derived]
|
||||
// CHECK:STDOUT: %a: ref %Derived = wrapper_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %pattern_type.746 = ref_binding_pattern a [concrete = constants.%a.patt]
|
||||
// CHECK:STDOUT: %a.var_patt: %pattern_type.746 = var_pattern %a.patt [concrete = constants.%a.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc18_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc18_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc18_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc18_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc18_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc18_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%Derived, (constants.%DestroyImpl.impl_witness.660, constants.%custom_witness.b80ef6.2) [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%Derived, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.35d]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%a.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc18_3.1(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.1(%self.param: ref %struct_type.base.9aa) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc18_3.1: ref %PrivateDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc18_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc18_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc18_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc18_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc18_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc18_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.1: ref %PrivateDestructor = struct_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc18_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc18_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: fn @SubobjectDestroy.WithSelf.Op.loc17_3.2(%self.param: ref %Derived) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %base.ref: %Derived.elem = name_ref base, @Derived.%.loc7 [concrete = @Derived.%.loc7]
|
||||
// CHECK:STDOUT: %.loc18_3.1: ref %PrivateDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc18_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc18_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc18_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc18_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc18_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc18_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.1: ref %PrivateDestructor = class_element_access %self.param, element0
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.1: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.2: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.1 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc17_3.2: %Destroy.type = facet_value constants.%PrivateDestructor, (constants.%DestroyImpl.impl_witness.a8a, constants.%custom_witness.fe1) [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: %.loc17_3.3: %Destroy.type = converted constants.%PrivateDestructor, %Destroy.facet.loc17_3.2 [concrete = constants.%Destroy.facet.75a]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc18_3.1)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc17_3.1)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+49
-52
@@ -107,8 +107,7 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn InaccessibleConstructorTest(s: Cpp.Source) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:40: error: cannot access private member `InaccessibleConstructor` of type `Cpp.InaccessibleConstructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_access.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+3]]:40: error: cannot access private member `InaccessibleConstructor` of type `Cpp.InaccessibleConstructor` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:21:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.InaccessibleConstructor = s;
|
||||
@@ -117,8 +116,7 @@ fn InaccessibleConstructorTest(s: Cpp.Source) {
|
||||
|
||||
fn InaccessibleConversionTest(s: Cpp.InaccessibleConversion) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+4]]:21: error: cannot access private member `<C++ operator>` of type `Cpp.InaccessibleConversion` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: included from: fail_access.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_access.carbon:[[@LINE+3]]:21: error: cannot access private member `<C++ operator>` of type `Cpp.InaccessibleConversion` [ClassInvalidMemberAccess]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:26:3: note: declared here [ClassMemberDeclaration]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.Dest = s;
|
||||
@@ -193,9 +191,8 @@ import Cpp library "implicit_conversions.h";
|
||||
|
||||
fn IntConstructorTest(u: u32) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+5]]:31: error: cannot implicitly convert expression of type `u32` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+4]]:31: note: type `u32` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+4]]:31: error: cannot implicitly convert expression of type `u32` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_no_u32_to_int_conversion_in_carbon.carbon:[[@LINE+3]]:31: note: type `u32` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ./implicit_conversions.h:38:21: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.IntConstructor = u;
|
||||
@@ -602,56 +599,56 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @InaccessibleConstructorTest(%s.param: %Source) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %Source = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc12_40.1: ref %InaccessibleConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc12_40.2: ref %Source = value_as_ref %s.ref
|
||||
// CHECK:STDOUT: %addr.loc12_40.1: %ptr.5f6 = addr_of %.loc12_40.2
|
||||
// CHECK:STDOUT: %addr.loc12_40.2: %ptr.859 = addr_of %.loc12_40.1
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc12_40.1, %addr.loc12_40.2)
|
||||
// CHECK:STDOUT: %.loc12_40.3: init %InaccessibleConstructor to %.loc12_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc12_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc12_40.3
|
||||
// CHECK:STDOUT: %.loc12_40.5: ref %InaccessibleConstructor = temporary %.loc12_40.1, %.loc12_40.4
|
||||
// CHECK:STDOUT: %.loc12_40.6: %InaccessibleConstructor = acquire_value %.loc12_40.5
|
||||
// CHECK:STDOUT: %.loc12_13: type = splice_block %InaccessibleConstructor.ref [concrete = constants.%InaccessibleConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc11_40.1: ref %InaccessibleConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc11_40.2: ref %Source = value_as_ref %s.ref
|
||||
// CHECK:STDOUT: %addr.loc11_40.1: %ptr.5f6 = addr_of %.loc11_40.2
|
||||
// CHECK:STDOUT: %addr.loc11_40.2: %ptr.859 = addr_of %.loc11_40.1
|
||||
// CHECK:STDOUT: %InaccessibleConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%InaccessibleConstructor__carbon_thunk.decl(%addr.loc11_40.1, %addr.loc11_40.2)
|
||||
// CHECK:STDOUT: %.loc11_40.3: init %InaccessibleConstructor to %.loc11_40.1 = mark_in_place_init %InaccessibleConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc11_40.4: init %InaccessibleConstructor = converted %s.ref, %.loc11_40.3
|
||||
// CHECK:STDOUT: %.loc11_40.5: ref %InaccessibleConstructor = temporary %.loc11_40.1, %.loc11_40.4
|
||||
// CHECK:STDOUT: %.loc11_40.6: %InaccessibleConstructor = acquire_value %.loc11_40.5
|
||||
// CHECK:STDOUT: %.loc11_13: type = splice_block %InaccessibleConstructor.ref [concrete = constants.%InaccessibleConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %InaccessibleConstructor.ref: type = name_ref InaccessibleConstructor, imports.%InaccessibleConstructor.decl [concrete = constants.%InaccessibleConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %InaccessibleConstructor = wrapper_binding _, %.loc12_40.6
|
||||
// CHECK:STDOUT: %_: %InaccessibleConstructor = wrapper_binding _, %.loc11_40.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.824 = value_binding_pattern _ [concrete = constants.%_.patt.f1f]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc12_40.1: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc12_40.7: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc12_40.1 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc12_40.2: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc12_40.8: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc12_40.2 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc11_40.1: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc11_40.7: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc11_40.1 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc11_40.2: %Destroy.type = facet_value constants.%InaccessibleConstructor, (constants.%DestroyImpl.impl_witness.8e4, constants.%custom_witness.5760f4.1) [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: %.loc11_40.8: %Destroy.type = converted constants.%InaccessibleConstructor, %Destroy.facet.loc11_40.2 [concrete = constants.%Destroy.facet.8e3]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc12_40.5)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc11_40.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @InaccessibleConversionTest(%s.param: %InaccessibleConversion) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: %InaccessibleConversion = name_ref s, %s
|
||||
// CHECK:STDOUT: %.loc22_21.1: ref %Dest = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc22_21.1
|
||||
// CHECK:STDOUT: %.loc20_21.1: ref %Dest = temporary_storage
|
||||
// CHECK:STDOUT: %addr: %ptr.ca8 = addr_of %.loc20_21.1
|
||||
// CHECK:STDOUT: %Dest__carbon_thunk.call: init %empty_tuple.type = call imports.%Dest__carbon_thunk.decl(%s.ref, %addr)
|
||||
// CHECK:STDOUT: %.loc22_21.2: init %Dest to %.loc22_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc22_21.3: init %Dest = converted %s.ref, %.loc22_21.2
|
||||
// CHECK:STDOUT: %.loc22_21.4: ref %Dest = temporary %.loc22_21.1, %.loc22_21.3
|
||||
// CHECK:STDOUT: %.loc22_21.5: %Dest = acquire_value %.loc22_21.4
|
||||
// CHECK:STDOUT: %.loc22_13: type = splice_block %Dest.ref [concrete = constants.%Dest] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc20_21.2: init %Dest to %.loc20_21.1 = mark_in_place_init %Dest__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc20_21.3: init %Dest = converted %s.ref, %.loc20_21.2
|
||||
// CHECK:STDOUT: %.loc20_21.4: ref %Dest = temporary %.loc20_21.1, %.loc20_21.3
|
||||
// CHECK:STDOUT: %.loc20_21.5: %Dest = acquire_value %.loc20_21.4
|
||||
// CHECK:STDOUT: %.loc20_13: type = splice_block %Dest.ref [concrete = constants.%Dest] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Dest.ref: type = name_ref Dest, imports.%Dest.decl [concrete = constants.%Dest]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %Dest = wrapper_binding _, %.loc22_21.5
|
||||
// CHECK:STDOUT: %_: %Dest = wrapper_binding _, %.loc20_21.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.b72 = value_binding_pattern _ [concrete = constants.%_.patt.664]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc22_21.1: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc22_21.6: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc22_21.1 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc22_21.2: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc22_21.7: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc22_21.2 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc20_21.1: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc20_21.6: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc20_21.1 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc20_21.2: %Destroy.type = facet_value constants.%Dest, (constants.%DestroyImpl.impl_witness.771, constants.%custom_witness.5760f4.2) [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: %.loc20_21.7: %Destroy.type = converted constants.%Dest, %Destroy.facet.loc20_21.2 [concrete = constants.%Destroy.facet.bbf]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc22_21.4)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc20_21.4)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -884,28 +881,28 @@ fn InitFromStruct() {
|
||||
// CHECK:STDOUT: fn @IntConstructorTest(%u.param: %u32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %u.ref: %u32 = name_ref u, %u
|
||||
// CHECK:STDOUT: %.loc13_31.1: ref %IntConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc13_31.2: %i32 = converted %u.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc13_31.1
|
||||
// CHECK:STDOUT: %.loc12_31.1: ref %IntConstructor = temporary_storage
|
||||
// CHECK:STDOUT: %.loc12_31.2: %i32 = converted %u.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %addr: %ptr.100 = addr_of %.loc12_31.1
|
||||
// CHECK:STDOUT: %IntConstructor__carbon_thunk.call: init %empty_tuple.type = call imports.%IntConstructor__carbon_thunk.decl(<error>, %addr)
|
||||
// CHECK:STDOUT: %.loc13_31.3: init %IntConstructor to %.loc13_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc13_31.4: init %IntConstructor = converted %u.ref, %.loc13_31.3
|
||||
// CHECK:STDOUT: %.loc13_31.5: ref %IntConstructor = temporary %.loc13_31.1, %.loc13_31.4
|
||||
// CHECK:STDOUT: %.loc13_31.6: %IntConstructor = acquire_value %.loc13_31.5
|
||||
// CHECK:STDOUT: %.loc13_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] {
|
||||
// CHECK:STDOUT: %.loc12_31.3: init %IntConstructor to %.loc12_31.1 = mark_in_place_init %IntConstructor__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc12_31.4: init %IntConstructor = converted %u.ref, %.loc12_31.3
|
||||
// CHECK:STDOUT: %.loc12_31.5: ref %IntConstructor = temporary %.loc12_31.1, %.loc12_31.4
|
||||
// CHECK:STDOUT: %.loc12_31.6: %IntConstructor = acquire_value %.loc12_31.5
|
||||
// CHECK:STDOUT: %.loc12_13: type = splice_block %IntConstructor.ref [concrete = constants.%IntConstructor] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %IntConstructor.ref: type = name_ref IntConstructor, imports.%IntConstructor.decl [concrete = constants.%IntConstructor]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc13_31.6
|
||||
// CHECK:STDOUT: %_: %IntConstructor = wrapper_binding _, %.loc12_31.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %_.patt: %pattern_type.c4e = value_binding_pattern _ [concrete = constants.%_.patt.151]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.facet.loc13_31.1: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc13_31.7: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc13_31.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc13_31.2: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc13_31.8: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc13_31.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc12_31.1: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc12_31.7: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc12_31.1 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %Destroy.facet.loc12_31.2: %Destroy.type = facet_value constants.%IntConstructor, (constants.%DestroyImpl.impl_witness.1d9, constants.%custom_witness.576) [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: %.loc12_31.8: %Destroy.type = converted constants.%IntConstructor, %Destroy.facet.loc12_31.2 [concrete = constants.%Destroy.facet]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc13_31.5)
|
||||
// CHECK:STDOUT: %SelfDestruct.call: init %empty_tuple.type = call %SelfDestruct.specific_fn(%.loc12_31.5)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -128,10 +128,9 @@ fn MyF() {
|
||||
// file split.
|
||||
// TODO: Pass a location into Clang when performing C++ name lookup so that
|
||||
// its error has a location attached.
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE+6]]:3-7: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR: fail_import_inline_ambiguity.carbon:[[@LINE+5]]:3-7: error: name `error` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: error: reference to 'N' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_inline_ambiguity.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./inline_ambiguity.h:2:11: note: candidate found by name lookup is 'N' [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./inline_ambiguity.h:3:30: note: candidate found by name lookup is '(anonymous namespace)::N' [CppInteropParseNote]
|
||||
error;
|
||||
|
||||
@@ -45,8 +45,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_too_few_arguments.carbon:[[@LINE+4]]:26: error: too few template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_too_few_arguments.carbon:[[@LINE-3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_too_few_arguments.carbon:[[@LINE+3]]:26: error: too few template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./templates.h:5:41: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTypes(Cpp.A);
|
||||
@@ -57,8 +56,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_too_many_arguments.carbon:[[@LINE+4]]:38-40: error: too many template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_too_many_arguments.carbon:[[@LINE-3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_too_many_arguments.carbon:[[@LINE+3]]:38-40: error: too many template arguments for class template 'TwoTypes' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./templates.h:5:41: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
var x: Cpp.TwoTypes(Cpp.A, Cpp.A, Cpp.A);
|
||||
@@ -90,14 +88,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "templates.h";
|
||||
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+4]]:57: error: too few template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_fixed_size_pack_wrong_size.carbon:[[@LINE-3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+3]]:57: error: too few template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./templates.h:15:33: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
var too_few: Cpp.FixedSizePack(Cpp.A, Cpp.A).Inner(Cpp.B);
|
||||
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+4]]:70-72: error: too many template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_fixed_size_pack_wrong_size.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_fixed_size_pack_wrong_size.carbon:[[@LINE+3]]:70-72: error: too many template arguments for class template 'Inner' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./templates.h:15:33: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
var too_many: Cpp.FixedSizePack(Cpp.A, Cpp.A).Inner(Cpp.B, Cpp.B, Cpp.B);
|
||||
|
||||
+2
-3
@@ -36,9 +36,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "templates.h";
|
||||
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+6]]:35: error: too few template arguments for class template 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+5]]:35: note: template template argument has different template parameters than its corresponding template template parameter [CppInteropParseNote]
|
||||
// CHECK:STDERR: included from: fail_template_mismatch.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+5]]:35: error: too few template arguments for class template 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_template_mismatch.carbon:[[@LINE+4]]:35: note: template template argument has different template parameters than its corresponding template template parameter [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./templates.h:6:66: note: previous template template parameter is here [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./templates.h:4:37: note: template is declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
|
||||
@@ -28,8 +28,7 @@ import library "namespace";
|
||||
// imported declaration.
|
||||
namespace NS;
|
||||
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:4-5: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE-7]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:4-5: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: namespace.carbon:4:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn NS();
|
||||
@@ -38,8 +37,7 @@ fn NS();
|
||||
// we don't move it.
|
||||
namespace NS;
|
||||
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:4-5: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE-17]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:4-5: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: namespace.carbon:4:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn NS();
|
||||
@@ -66,9 +64,9 @@ fn NS();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %NS.type.20a02b.1: type = fn_type @NS.loc14 [concrete]
|
||||
// CHECK:STDOUT: %NS.type.20a02b.1: type = fn_type @NS.loc13 [concrete]
|
||||
// CHECK:STDOUT: %NS.bab1af.1: %NS.type.20a02b.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %NS.type.20a02b.2: type = fn_type @NS.loc24 [concrete]
|
||||
// CHECK:STDOUT: %NS.type.20a02b.2: type = fn_type @NS.loc22 [concrete]
|
||||
// CHECK:STDOUT: %NS.bab1af.2: %NS.type.20a02b.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -89,12 +87,12 @@ fn NS();
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %NS.loc8: <namespace> = namespace imports.%Example.NS, [concrete] {}
|
||||
// CHECK:STDOUT: %NS.decl.loc14: %NS.type.20a02b.1 = fn_decl @NS.loc14 [concrete = constants.%NS.bab1af.1] {} {}
|
||||
// CHECK:STDOUT: %NS.loc18: <namespace> = namespace imports.%Example.NS, [concrete] {}
|
||||
// CHECK:STDOUT: %NS.decl.loc24: %NS.type.20a02b.2 = fn_decl @NS.loc24 [concrete = constants.%NS.bab1af.2] {} {}
|
||||
// CHECK:STDOUT: %NS.decl.loc13: %NS.type.20a02b.1 = fn_decl @NS.loc13 [concrete = constants.%NS.bab1af.1] {} {}
|
||||
// CHECK:STDOUT: %NS.loc17: <namespace> = namespace imports.%Example.NS, [concrete] {}
|
||||
// CHECK:STDOUT: %NS.decl.loc22: %NS.type.20a02b.2 = fn_decl @NS.loc22 [concrete = constants.%NS.bab1af.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @NS.loc14();
|
||||
// CHECK:STDOUT: fn @NS.loc13();
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @NS.loc24();
|
||||
// CHECK:STDOUT: fn @NS.loc22();
|
||||
// CHECK:STDOUT:
|
||||
+1
-2
@@ -24,8 +24,7 @@ package Example;
|
||||
|
||||
import library "namespace";
|
||||
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:4-5: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:4-5: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: namespace.carbon:4:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
fn NS();
|
||||
|
||||
+1
-2
@@ -24,8 +24,7 @@ import Other;
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE-2]]:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
namespace Other;
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:10-15: error: imported packages cannot be used for declarations [QualifiedDeclOutsidePackage]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE-6]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:10-15: error: imported packages cannot be used for declarations [QualifiedDeclOutsidePackage]
|
||||
// CHECK:STDERR: fn.carbon:3:1-17: note: package imported here [QualifiedDeclOutsidePackageSource]
|
||||
// CHECK:STDERR:
|
||||
fn Other.Nested.F();
|
||||
|
||||
+3
-5
@@ -24,14 +24,12 @@ package Example;
|
||||
|
||||
import library "fn";
|
||||
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:11-12: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:11-12: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: fn.carbon:4:1-8: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
namespace NS;
|
||||
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+4]]:4-5: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE-9]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_conflict.carbon:[[@LINE+3]]:4-5: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
||||
// CHECK:STDERR: fn.carbon:4:1-8: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity]
|
||||
// CHECK:STDERR:
|
||||
fn NS.Foo();
|
||||
@@ -87,7 +85,7 @@ fn NS.Foo();
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %.loc10: <namespace> = namespace [concrete] {}
|
||||
// CHECK:STDOUT: %.loc9: <namespace> = namespace [concrete] {}
|
||||
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ fn NS() {}
|
||||
|
||||
package Example library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: fn.carbon:4:1-9: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: namespace.carbon:4:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "namespace";
|
||||
|
||||
+1
-2
@@ -29,9 +29,8 @@ fn NS.Foo() {}
|
||||
|
||||
package Example library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: namespace.carbon:4:1-13: error: duplicate name `NS` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: fn.carbon:4:1-9: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "fn";
|
||||
|
||||
@@ -56,11 +56,10 @@ package Same library "[[@TEST_NAME]]";
|
||||
|
||||
import library "b";
|
||||
|
||||
// CHECK:STDERR: fail_named_indirectly_same_package.carbon:[[@LINE+7]]:10-12: error: function returns incomplete type `A.C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: fail_named_indirectly_same_package.carbon:[[@LINE+6]]:10-12: error: function returns incomplete type `A.C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: imported from: fail_named_indirectly_same_package.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: b.carbon:3:1 [InImport]
|
||||
// CHECK:STDERR: a.carbon:6:1-10: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: imported from: fail_named_indirectly_same_package.carbon:[[@LINE-6]]:1 [InImport]
|
||||
// CHECK:STDERR: b.carbon:7:8-13: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
fn G() { F(); }
|
||||
@@ -71,11 +70,10 @@ package Other library "[[@TEST_NAME]]";
|
||||
|
||||
import Same library "b";
|
||||
|
||||
// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE+7]]:10-17: error: function returns incomplete type `Same.A.C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: fail_named_indirectly_different_package.carbon:[[@LINE+6]]:10-17: error: function returns incomplete type `Same.A.C` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: imported from: fail_named_indirectly_different_package.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: b.carbon:3:1 [InImport]
|
||||
// CHECK:STDERR: a.carbon:6:1-10: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: imported from: fail_named_indirectly_different_package.carbon:[[@LINE-6]]:1 [InImport]
|
||||
// CHECK:STDERR: b.carbon:7:8-13: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
fn G() { Same.F(); }
|
||||
|
||||
@@ -157,9 +157,8 @@ import Other library "conflict";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_conflict_on_export_import.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_conflict_on_export_import.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: base.carbon:4:1-9: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict_on_export_import.carbon:[[@LINE+2]]:1 [InImport]
|
||||
// CHECK:STDERR: conflict.carbon:4:1-8: note: name is previously declared here [NameDeclPrevious]
|
||||
import Other library "export_import";
|
||||
import Other library "conflict";
|
||||
@@ -172,10 +171,8 @@ alias C = Other.C;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_conflict_on_export_name.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: conflict.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict_on_export_name.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: export_name.carbon:4:1 [InImport]
|
||||
// CHECK:STDERR: conflict.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: base.carbon:4:1-9: note: name is previously declared here [NameDeclPrevious]
|
||||
import Other library "export_name";
|
||||
import Other library "conflict";
|
||||
|
||||
@@ -74,9 +74,8 @@ fn Run() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_todo_main_use_other_extern.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_todo_main_use_other_extern.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: other_fn_extern.carbon:4:1-14: error: duplicate name `F` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_todo_main_use_other_extern.carbon:[[@LINE+2]]:1 [InImport]
|
||||
// CHECK:STDERR: other_fn.carbon:4:1-8: note: name is previously declared here [NameDeclPrevious]
|
||||
import Other library "other_fn";
|
||||
import Other library "other_fn_extern";
|
||||
@@ -98,9 +97,8 @@ import Other library "other_fn_conflict";
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_main_use_other_ambiguous.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_main_use_other_ambiguous.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: other_fn_conflict.carbon:4:1-20: error: duplicate name `F` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_main_use_other_ambiguous.carbon:[[@LINE+2]]:1 [InImport]
|
||||
// CHECK:STDERR: other_fn.carbon:4:1-8: note: name is previously declared here [NameDeclPrevious]
|
||||
import Other library "other_fn";
|
||||
import Other library "other_fn_conflict";
|
||||
@@ -116,14 +114,12 @@ fn Run() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import library "main_other_ns";
|
||||
// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+4]]:1-32: error: duplicate name `Other` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_main_namespace_conflict.carbon:[[@LINE-2]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+3]]:1-32: error: duplicate name `Other` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: main_other_ns.carbon:4:1-16: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import Other library "other_fn";
|
||||
|
||||
// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+4]]:1-14: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: imported from: fail_main_namespace_conflict.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_main_namespace_conflict.carbon:[[@LINE+3]]:1-14: error: redeclaration of `fn F` is redundant [RedeclRedundant]
|
||||
// CHECK:STDERR: other_fn.carbon:4:1-8: note: previously declared here [RedeclPrevDecl]
|
||||
// CHECK:STDERR:
|
||||
fn Other.F() {}
|
||||
@@ -459,7 +455,7 @@ fn UseF() { Other.F(); }
|
||||
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %F.type.2a8c71.1: type = fn_type @F.1 [concrete]
|
||||
// CHECK:STDOUT: %F.1be9f8.1: %F.type.2a8c71.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.type.2a8c71.2: type = fn_type @F.loc15 [concrete]
|
||||
// CHECK:STDOUT: %F.type.2a8c71.2: type = fn_type @F.loc13 [concrete]
|
||||
// CHECK:STDOUT: %F.1be9f8.2: %F.type.2a8c71.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -478,12 +474,12 @@ fn UseF() { Other.F(); }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import = import <none>
|
||||
// CHECK:STDOUT: %Other.import = import Other
|
||||
// CHECK:STDOUT: %F.decl: %F.type.2a8c71.2 = fn_decl @F.loc15 [concrete = constants.%F.1be9f8.2] {} {}
|
||||
// CHECK:STDOUT: %F.decl: %F.type.2a8c71.2 = fn_decl @F.loc13 [concrete = constants.%F.1be9f8.2] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.1 [from "other_fn.carbon"];
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F.loc15() {
|
||||
// CHECK:STDOUT: fn @F.loc13() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+2
-4
@@ -91,8 +91,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "base";
|
||||
|
||||
// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+4]]:1-10: error: only imported entities are valid for `export` [ExportNotImportedEntity]
|
||||
// CHECK:STDERR: imported from: fail_export_ns.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_export_ns.carbon:[[@LINE+3]]:1-10: error: only imported entities are valid for `export` [ExportNotImportedEntity]
|
||||
// CHECK:STDERR: base.carbon:8:1-13: note: name is declared here [ExportNotImportedEntitySource]
|
||||
// CHECK:STDERR:
|
||||
export NS;
|
||||
@@ -114,8 +113,7 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import library "base";
|
||||
|
||||
// CHECK:STDERR: fail_export_member.carbon:[[@LINE+4]]:8: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
||||
// CHECK:STDERR: imported from: fail_export_member.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_export_member.carbon:[[@LINE+3]]:8: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
||||
// CHECK:STDERR: base.carbon:4:1-9: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity]
|
||||
// CHECK:STDERR:
|
||||
export C.x;
|
||||
|
||||
@@ -28,9 +28,8 @@ var Foo: i32;
|
||||
|
||||
package Example library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: var.carbon:4:5-12: error: duplicate name `Foo` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_conflict.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: fn.carbon:4:1-9: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import library "fn";
|
||||
|
||||
@@ -28,8 +28,7 @@ import library "a";
|
||||
|
||||
// TODO: This diagnostic doesn't clearly explain the problem. We should instead
|
||||
// say something like: Only namespace-scope names can be exported.
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+4]]:8: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
||||
// CHECK:STDERR: imported from: fail_b.carbon:[[@LINE-5]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_b.carbon:[[@LINE+3]]:8: error: name qualifiers are only allowed for entities that provide a scope [QualifiedNameInNonScope]
|
||||
// CHECK:STDERR: a.carbon:4:1-9: note: referenced non-scope entity declared here [QualifiedNameNonScopeEntity]
|
||||
// CHECK:STDERR:
|
||||
export C.n;
|
||||
|
||||
@@ -135,9 +135,8 @@ import Other library "o1";
|
||||
|
||||
// --- fail_import_conflict.impl.carbon
|
||||
|
||||
// CHECK:STDERR: imported from: fail_import_conflict.impl.carbon:[[@LINE+5]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: fail_import_conflict.impl.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: import_conflict.carbon:4:1-26: error: duplicate name `Other` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_conflict.impl.carbon:[[@LINE+3]]:1 [InImport]
|
||||
// CHECK:STDERR: local_other.carbon:4:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
impl library "[[@TEST_NAME]]";
|
||||
@@ -154,9 +153,7 @@ import library "local_other";
|
||||
|
||||
impl library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+5]]:1-26: error: duplicate name `Other` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: imported from: fail_import_conflict_reverse.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: imported from: import_conflict_reverse.carbon:4:1 [InImport]
|
||||
// CHECK:STDERR: fail_import_conflict_reverse.impl.carbon:[[@LINE+3]]:1-26: error: duplicate name `Other` being declared in the same scope [NameDeclDuplicate]
|
||||
// CHECK:STDERR: local_other.carbon:4:1-13: note: name is previously declared here [NameDeclPrevious]
|
||||
// CHECK:STDERR:
|
||||
import Other library "o1";
|
||||
@@ -751,8 +748,8 @@ import Other library "o1";
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Other = imports.%Other
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %default.import.loc7_31.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc7_31.2 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc6_31.1 = import <none>
|
||||
// CHECK:STDOUT: %default.import.loc6_31.2 = import <none>
|
||||
// CHECK:STDOUT: %Other.import = import Other
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+1
-2
@@ -34,8 +34,7 @@ var c: C({.a = 1, .b = 2}) = F();
|
||||
// --- fail_bad_type.impl.carbon
|
||||
|
||||
impl package Implicit;
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+4]]:14-29: error: struct `{.a: i32, .b: i32}` has no field named `c` [StructInitUnexpectedFieldInLiteral]
|
||||
// CHECK:STDERR: imported from: fail_bad_type.impl.carbon:[[@LINE-2]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+3]]:14-29: error: struct `{.a: i32, .b: i32}` has no field named `c` [StructInitUnexpectedFieldInLiteral]
|
||||
// CHECK:STDERR: implicit.carbon:8:9-29: note: initializing generic parameter `S` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C({.c = 1, .d = 2}) = F();
|
||||
|
||||
+1
-2
@@ -35,8 +35,7 @@ var c: C((1, 2)) = F();
|
||||
|
||||
impl package Implicit;
|
||||
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+4]]:14-22: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: imported from: fail_bad_type.impl.carbon:[[@LINE-3]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_bad_type.impl.carbon:[[@LINE+3]]:14-22: error: cannot initialize tuple of 2 elements from tuple with 3 elements [TupleInitElementCountMismatch]
|
||||
// CHECK:STDERR: implicit.carbon:7:9-21: note: initializing generic parameter `X` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C((1, 2, 3)) = F();
|
||||
|
||||
+1
-2
@@ -120,8 +120,7 @@ class C {}
|
||||
impl C as J {}
|
||||
|
||||
fn DoesNotImplI() {
|
||||
// CHECK:STDERR: fail_enforce_impls_constraint.carbon:[[@LINE+4]]:3-10: error: cannot convert type `C` into type implementing `J where .Self impls I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: imported from: fail_enforce_impls_constraint.carbon:[[@LINE-8]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_enforce_impls_constraint.carbon:[[@LINE+3]]:3-10: error: cannot convert type `C` into type implementing `J where .Self impls I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: state_constraints.carbon:14:18-41: note: initializing generic parameter `V` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
Impls(C);
|
||||
|
||||
@@ -115,14 +115,12 @@ import library "equal_constraint";
|
||||
import library "nested_rewrites";
|
||||
|
||||
fn Calls() {
|
||||
// CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+4]]:3-13: error: cannot convert type `bool` into type implementing `N where .(N.P) = {}` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: imported from: fail_import_rewrites.carbon:[[@LINE-5]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+3]]:3-13: error: cannot convert type `bool` into type implementing `N where .(N.P) = {}` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: equal_constraint.carbon:9:18-35: note: initializing generic parameter `T` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
Equal(bool);
|
||||
|
||||
// CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+4]]:3-20: error: cannot convert type `i32` into type implementing `A where .(A.C) = () and .(A.B) = bool` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: imported from: fail_import_rewrites.carbon:[[@LINE-11]]:1 [InImport]
|
||||
// CHECK:STDERR: fail_import_rewrites.carbon:[[@LINE+3]]:3-20: error: cannot convert type `i32` into type implementing `A where .(A.C) = () and .(A.B) = bool` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: nested_rewrites.carbon:10:26-61: note: initializing generic parameter `D` declared here [InitializingGenericParam]
|
||||
// CHECK:STDERR:
|
||||
NestedRewrite(i32);
|
||||
|
||||
@@ -362,8 +362,8 @@ struct Diagnostic {
|
||||
// A context names the operation that failed, and when a diagnostic has one that
|
||||
// is what the reader is told about; the message is then read against the code
|
||||
// like anything else explaining it. Anything presenting a diagnostic as a
|
||||
// single sentence -- the headline of the rendering, an editor's hover text --
|
||||
// wants this rather than the message.
|
||||
// single sentence, such as an editor's hover text, uses this instead of the
|
||||
// message.
|
||||
inline auto LeadingContext(const Diagnostic& diagnostic) -> const Context* {
|
||||
return diagnostic.contexts.empty() ? nullptr : &diagnostic.contexts.front();
|
||||
}
|
||||
|
||||
+966
-636
File diff suppressed because it is too large.
Load diff
@@ -5,7 +5,6 @@
|
||||
#ifndef CARBON_TOOLCHAIN_DIAGNOSTICS_RENDERER_H_
|
||||
#define CARBON_TOOLCHAIN_DIAGNOSTICS_RENDERER_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#include "common/ostream.h"
|
||||
@@ -22,26 +21,25 @@ struct PreparedPart;
|
||||
|
||||
// Draws diagnostics for a terminal.
|
||||
//
|
||||
// A diagnostic renders as its headline, and then a frame holding everything
|
||||
// that explains it: which file, the source there, and the text of each label
|
||||
// against the code it marks.
|
||||
// A diagnostic renders as one frame holding a snippet of each file it points
|
||||
// into. The message's text is placed under the range that is wrong, which has a
|
||||
// heavy underline, and begins with the level word. Every label is placed under
|
||||
// the range it is attached to.
|
||||
//
|
||||
// error: 1 argument passed to function expecting 0 arguments
|
||||
// ╭─┤ foo.carbon:19:3
|
||||
// │
|
||||
// 1 │ fn Run0() {}
|
||||
// · ──────┬─────
|
||||
// · ╰──┤ calling function declared here
|
||||
// ┆
|
||||
// -> 19 │ Run0(1);
|
||||
// · ───┬───
|
||||
// · ╰──┤ 1 argument passed here
|
||||
// ╰────────────
|
||||
// · ━━━┳━━━
|
||||
// · ┗━━┫ error: invalid arguments in function call
|
||||
// ╰────
|
||||
//
|
||||
// With snippets off, each part of the diagnostic is one line, led by its
|
||||
// location and the extent of its range:
|
||||
//
|
||||
// foo.carbon:19:3-9: error: 1 argument passed to function expecting 0
|
||||
// foo.carbon:19:3-9: error: invalid arguments in function call
|
||||
// foo.carbon:1:1-12: note: calling function declared here
|
||||
//
|
||||
// See /toolchain/docs/diagnostics_rendering.md for the full form, the palette,
|
||||
@@ -91,7 +89,7 @@ class Renderer {
|
||||
// Renders the framed form into the geometry `Render` chose.
|
||||
auto RenderFramed(Terminal::OutputBufferRef out,
|
||||
llvm::MutableArrayRef<Internal::PreparedPart> parts,
|
||||
int headline, Level level, int frame_x, int content_x,
|
||||
int leading, Level level, int frame_x, int content_x,
|
||||
int source_columns, int columns) const -> void;
|
||||
|
||||
Terminal::Capabilities capabilities_;
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,150 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
|
||||
// ARGS: --include-diagnostic-kind --diagnostic-snippets --terminal-unicode=always compile --phase=check %s
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/diagnostics/testdata/fail_diagnostics_demo.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/diagnostics/testdata/fail_diagnostics_demo.carbon
|
||||
|
||||
// A tour of how diagnostics are drawn. None of the code below is meant to
|
||||
// compile: every line is here to pull a different part of the rendering into
|
||||
// the output. See /toolchain/docs/diagnostics_rendering.md for what each part
|
||||
// is and why it looks the way it does.
|
||||
//
|
||||
// This is an ordinary Carbon file, so it runs outside the test suite too:
|
||||
//
|
||||
// carbon compile --include-diagnostic-kind --terminal-unicode=always \
|
||||
// --phase=check toolchain/diagnostics/testdata/fail_diagnostics_demo.carbon
|
||||
//
|
||||
// The `CHECK` lines below are that output, captured, so the tour reads without
|
||||
// running anything. With no terminal to measure, layout targets the width code
|
||||
// is formatted to, so the fitting behaviors appear here too: a long source
|
||||
// line windowed to fit, a label line slid left inside its range, and a label
|
||||
// wrapped inside its frame are all below. What can't appear is anything that
|
||||
// needs a real terminal's width -- an out-dented label needs a narrower
|
||||
// terminal than the fixed target; `renderer_test` covers it. A diagnostic
|
||||
// reaching into a second file, with the import path drawn above it, needs a
|
||||
// library to import and so isn't here either.
|
||||
//
|
||||
// What each line is for:
|
||||
//
|
||||
// - `Blend(1)`: a label elsewhere in the same file, shown with the error in
|
||||
// one view of the file, with the lines between them elided.
|
||||
// - `Blend(0, "...")`: a context leading the diagnostic, so the message is read
|
||||
// against the code as a label. The underline is measured in columns rather
|
||||
// than bytes.
|
||||
// - `Cpp.Paint(0)`: a diagnostic from Clang, drawn here rather than by Clang.
|
||||
// It is located at the callee the message names, as Clang does, and its note
|
||||
// becomes two labels: the candidate considered, on its name, and what was
|
||||
// wrong with it, on the parameters the count it reports came from.
|
||||
// - `missing`: the message placed under its own range with nothing else on
|
||||
// the line, which is the common case. The warning below it has the same
|
||||
// shape on the binding it initializes.
|
||||
// - `count * flag`: the message placed under the whole expression it reports,
|
||||
// which is a binary operator and both its operands. The other two errors on
|
||||
// this line are separate diagnostics, so each is drawn in its own frame,
|
||||
// which shows the line again.
|
||||
// - `cell[n]`: the same shape for an index, with the message under the object
|
||||
// and the index together.
|
||||
// - `-flag`: the same shape for a prefix operator, with the message under the
|
||||
// operator and its operand.
|
||||
|
||||
library "demo";
|
||||
|
||||
import Cpp inline '''
|
||||
void Paint(int layer, int depth);
|
||||
''';
|
||||
|
||||
fn Blend(first_operand: i32, second_operand: Core.Optional(i32));
|
||||
|
||||
fn Tour(count: i32, flag: bool, cell: {.a: i32}, n: i32) -> i32 {
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+12]]:3
|
||||
// CHECK:STDERR: 63 │ fn Blend(first_operand: i32, second_operand: Core.Optional(i32));
|
||||
// CHECK:STDERR: · ────────────────────────────────┬────────────────────────────────
|
||||
// CHECK:STDERR: · ╰──┤ calling function declared here
|
||||
// CHECK:STDERR: · │ [InCallToEntity]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> 78 │ Blend(1);
|
||||
// CHECK:STDERR: · ━━━━┳━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: 1 argument passed to function expecting 2 arguments
|
||||
// CHECK:STDERR: · ┃ [CallArgCountMismatch]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Blend(1);
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+16]]:12
|
||||
// CHECK:STDERR: 63 │ fn Blend(first_operand: i32, second_operand: Core.Optional(i32));
|
||||
// CHECK:STDERR: · ───────────────┬──────────────────
|
||||
// CHECK:STDERR: · ╰──┤ initializing function parameter
|
||||
// CHECK:STDERR: · │ [InCallToFunctionParam]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> 95 │ Blend(0, "全角文字の幅も列で数えるので、下線はずれず、長すぎる行は両端を...
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot implicitly convert expression of type `str` to
|
||||
// CHECK:STDERR: · │ ┃ `Core.Optional(i32 as Core.OptionalStorage)`
|
||||
// CHECK:STDERR: · │ ┃ [ConversionFailure]
|
||||
// CHECK:STDERR: · ╰────┤ type `str` does not implement interface
|
||||
// CHECK:STDERR: · │ `Core.ImplicitAs(Core.Optional(i32 as Core.OptionalStorage))`
|
||||
// CHECK:STDERR: · │ [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Blend(0, "全角文字の幅も列で数えるので、下線はずれず、長すぎる行は両端を切り詰めて窓のように表示されます");
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+13]]:3
|
||||
// CHECK:STDERR: 60 │ void Paint(int layer, int depth);
|
||||
// CHECK:STDERR: · ┬ ──────────┬─────────
|
||||
// CHECK:STDERR: · ╰──────────────────┤ candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: · ╰────┤ requires 2 arguments, but 1 was provided
|
||||
// CHECK:STDERR: · │ [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR: ┆
|
||||
// CHECK:STDERR: -> 109 │ Cpp.Paint(0);
|
||||
// CHECK:STDERR: · ━━━━┳━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: no matching function for call to 'Paint'
|
||||
// CHECK:STDERR: · ┃ [CppInteropParseError]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
Cpp.Paint(0);
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+6]]:19
|
||||
// CHECK:STDERR: -> 116 │ var tint: i32 = missing;
|
||||
// CHECK:STDERR: · ━━━┳━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: name `missing` not found [NameNotFound]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var tint: i32 = missing;
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+32]]:10
|
||||
// CHECK:STDERR: -> 149 │ return count * flag + cell[n] + -flag;
|
||||
// CHECK:STDERR: · ┳━━━━━━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access member of interface `Core.MulWith(bool)` in
|
||||
// CHECK:STDERR: · ┃ type `i32` that does not implement that interface
|
||||
// CHECK:STDERR: · ┃ [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+24]]:25
|
||||
// CHECK:STDERR: -> 149 │ return count * flag + cell[n] + -flag;
|
||||
// CHECK:STDERR: · ┳━━━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access member of interface
|
||||
// CHECK:STDERR: · ┃ `Core.IndexWith(i32)` in type `{.a: i32}`
|
||||
// CHECK:STDERR: · ┃ that does not implement that interface
|
||||
// CHECK:STDERR: · ┃ [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE+15]]:35
|
||||
// CHECK:STDERR: -> 149 │ return count * flag + cell[n] + -flag;
|
||||
// CHECK:STDERR: · ┳━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ error: cannot access member of interface
|
||||
// CHECK:STDERR: · ┃ `Core.Negate` in type `bool` that
|
||||
// CHECK:STDERR: · ┃ does not implement that interface
|
||||
// CHECK:STDERR: · ┃ [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: ╭─┤ fail_diagnostics_demo.carbon:[[@LINE-27]]:7
|
||||
// CHECK:STDERR: -> 116 │ var tint: i32 = missing;
|
||||
// CHECK:STDERR: · ━━━━┳━━━━
|
||||
// CHECK:STDERR: · ┗━━┫ warning: binding `tint` unused [UnusedBinding]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
return count * flag + cell[n] + -flag;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
|
||||
// ARGS: --include-diagnostic-kind --diagnostic-snippets --terminal-unicode=always compile --phase=parse %s
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/diagnostics/testdata/fail_recovery_demo.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/diagnostics/testdata/fail_recovery_demo.carbon
|
||||
|
||||
// A tour of how a missing token is drawn, which is the case where nothing in
|
||||
// the source is wrong: what the reader needs is not a range to look at but a
|
||||
// place to put something. See /toolchain/docs/diagnostics_rendering.md for
|
||||
// the rendering.
|
||||
//
|
||||
// The rule is that the message is located at the token the parser found where
|
||||
// the missing one should be, which is the first token after the gap. That token
|
||||
// is underlined like any other range, so the place to put the missing token is
|
||||
// its left edge. When it is the end of the file, the message is located just
|
||||
// past the last token, which covers no text and is drawn as a lone `┳`.
|
||||
//
|
||||
// This is a parse-phase tour, so nothing here reaches checking. What each line
|
||||
// is for:
|
||||
//
|
||||
// - `fn Paint`: a separator missing between two elements of a list, located at
|
||||
// the first token of the element after the gap.
|
||||
// - `if true`: an opening delimiter missing after its introducer, located at
|
||||
// the token after the introducer.
|
||||
// - `var n`: the lexer inserting a `)` to recover, which the label reports,
|
||||
// because everything reported after that point is about that reading of the
|
||||
// file rather than about what was written.
|
||||
// - `class Widget`: a `;` missing at the end of a declaration, which is the
|
||||
// case where the next token is the end of the file, so the message is drawn
|
||||
// as a point just past `Widget`. This is last in the file because recovery
|
||||
// skips to what looks like the end of the declaration, which consumes
|
||||
// everything after it.
|
||||
|
||||
library "recovery_demo";
|
||||
|
||||
// CHECK:STDERR: ╭─┤ fail_recovery_demo.carbon:[[@LINE+7]]:17
|
||||
// CHECK:STDERR: -> 50 │ fn Paint(a: i32 b: i32);
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: expected `,` or `)`
|
||||
// CHECK:STDERR: · ┃ [UnexpectedTokenAfterListElement]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
fn Paint(a: i32 b: i32);
|
||||
|
||||
fn Blend() {
|
||||
// CHECK:STDERR: ╭─┤ fail_recovery_demo.carbon:[[@LINE+6]]:6
|
||||
// CHECK:STDERR: -> 59 │ if true { }
|
||||
// CHECK:STDERR: · ━━┳━
|
||||
// CHECK:STDERR: · ┗━━┫ error: expected `(` after `if` [ExpectedParenAfter]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
if true { }
|
||||
}
|
||||
|
||||
fn Tint() {
|
||||
// CHECK:STDERR: ╭─┤ fail_recovery_demo.carbon:[[@LINE+9]]:16
|
||||
// CHECK:STDERR: -> 72 │ var n: i32 = (1;
|
||||
// CHECK:STDERR: · ┳ ┬
|
||||
// CHECK:STDERR: · ┗━━━━┫ error: opening symbol without a corresponding closing
|
||||
// CHECK:STDERR: · │ ┃ symbol
|
||||
// CHECK:STDERR: · │ ┃ [UnmatchedOpening]
|
||||
// CHECK:STDERR: · ╰────┤ possibly missing `)` here [PossiblyMissingBracketHere]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
var n: i32 = (1;
|
||||
}
|
||||
|
||||
// CHECK:STDERR: ╭─┤ fail_recovery_demo.carbon:[[@LINE+8]]:13
|
||||
// CHECK:STDERR: -> 83 │ class Widget
|
||||
// CHECK:STDERR: · ┳
|
||||
// CHECK:STDERR: · ┗━━┫ error: `class` declarations must either end with a `;` or have
|
||||
// CHECK:STDERR: · ┃ a `{ ... }` block for a definition
|
||||
// CHECK:STDERR: · ┃ [ExpectedDeclSemiOrDefinition]
|
||||
// CHECK:STDERR: ╰────
|
||||
// CHECK:STDERR:
|
||||
class Widget
|
||||
+63
-71
@@ -20,19 +20,17 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: error: name `missing` not found [NameNotFound]
|
||||
// CHECK:STDERR: .-| fail_one_message.carbon:[[@LINE+13]]:23
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 19 | var unused_x: i32 = missing;
|
||||
// CHECK:STDERR: : -------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: .-| fail_one_message.carbon:[[@LINE+12]]:23
|
||||
// CHECK:STDERR: -> 17 | var unused_x: i32 = missing;
|
||||
// CHECK:STDERR: : ^^^^^^^
|
||||
// CHECK:STDERR: : '--| error: name `missing` not found [NameNotFound]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: warning: binding `unused_x` unused [UnusedBinding]
|
||||
// CHECK:STDERR: .-| fail_one_message.carbon:[[@LINE+6]]:7
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 19 | var unused_x: i32 = missing;
|
||||
// CHECK:STDERR: : -------------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: -> 17 | var unused_x: i32 = missing;
|
||||
// CHECK:STDERR: : ^^^^^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| warning: binding `unused_x` unused [UnusedBinding]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
var unused_x: i32 = missing;
|
||||
}
|
||||
@@ -44,16 +42,16 @@ library "[[@TEST_NAME]]";
|
||||
fn G() {}
|
||||
|
||||
fn H() {
|
||||
// CHECK:STDERR: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: .-| fail_note_in_same_file.carbon:[[@LINE+10]]:3
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: .-| fail_note_in_same_file.carbon:[[@LINE+11]]:3
|
||||
// CHECK:STDERR: 4 | fn G() {}
|
||||
// CHECK:STDERR: : ----.---
|
||||
// CHECK:STDERR: : '--| calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 18 | G(1);
|
||||
// CHECK:STDERR: : ----
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: : ^^^^
|
||||
// CHECK:STDERR: : '--| error: 1 argument passed to function expecting 0 arguments
|
||||
// CHECK:STDERR: : | [CallArgCountMismatch]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
G(1);
|
||||
}
|
||||
@@ -68,19 +66,18 @@ fn Wide() {
|
||||
//
|
||||
//
|
||||
//
|
||||
// CHECK:STDERR: error: name `also_missing` not found [NameNotFound]
|
||||
// CHECK:STDERR: .-| fail_wide_line_numbers.carbon:[[@LINE+13]]:23
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 24 | var unused_y: i32 = also_missing;
|
||||
// CHECK:STDERR: : ------------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: -> 23 | var unused_y: i32 = also_missing;
|
||||
// CHECK:STDERR: : ^^^^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| error: name `also_missing` not found
|
||||
// CHECK:STDERR: : | [NameNotFound]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: warning: binding `unused_y` unused [UnusedBinding]
|
||||
// CHECK:STDERR: .-| fail_wide_line_numbers.carbon:[[@LINE+6]]:7
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 24 | var unused_y: i32 = also_missing;
|
||||
// CHECK:STDERR: : -------------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: -> 23 | var unused_y: i32 = also_missing;
|
||||
// CHECK:STDERR: : ^^^^^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| warning: binding `unused_y` unused [UnusedBinding]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
var unused_y: i32 = also_missing;
|
||||
}
|
||||
@@ -98,19 +95,17 @@ library "[[@TEST_NAME]]";
|
||||
import library "declared";
|
||||
|
||||
fn Use() {
|
||||
// CHECK:STDERR: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: .-| fail_across_files.carbon:[[@LINE+13]]:3
|
||||
// CHECK:STDERR: .-| fail_across_files.carbon:[[@LINE+12]]:3
|
||||
// CHECK:STDERR: -> 19 | Declared(1);
|
||||
// CHECK:STDERR: : ^^^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| error: 1 argument passed to function expecting 0 arguments
|
||||
// CHECK:STDERR: : | [CallArgCountMismatch]
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 21 | Declared(1);
|
||||
// CHECK:STDERR: : -----------
|
||||
// CHECK:STDERR: |------------
|
||||
// CHECK:STDERR: | .-- imported from: fail_across_files.carbon:[[@LINE-9]]:1 [InImport]
|
||||
// CHECK:STDERR: |-| declared.carbon:4:1
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: 4 | fn Declared();
|
||||
// CHECK:STDERR: : -------.------
|
||||
// CHECK:STDERR: : '--| calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
Declared(1);
|
||||
}
|
||||
@@ -119,13 +114,14 @@ fn Use() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: .-| fail_two_spans_on_one_line.carbon:[[@LINE+7]]:27
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 12 | fn Same() {} fn Twice() { Same(1); }
|
||||
// CHECK:STDERR: : -----.----- -------
|
||||
// CHECK:STDERR: : '--| calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: .-| fail_two_spans_on_one_line.carbon:[[@LINE+9]]:27
|
||||
// CHECK:STDERR: -> 13 | fn Same() {} fn Twice() { Same(1); }
|
||||
// CHECK:STDERR: : -----.----- ^^^^^^^
|
||||
// CHECK:STDERR: : | '--| error: 1 argument passed to function expecting 0
|
||||
// CHECK:STDERR: : | | arguments
|
||||
// CHECK:STDERR: : | | [CallArgCountMismatch]
|
||||
// CHECK:STDERR: : '-------------------------| calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
fn Same() {} fn Twice() { Same(1); }
|
||||
|
||||
@@ -134,19 +130,19 @@ fn Same() {} fn Twice() { Same(1); }
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn Wide() {
|
||||
// CHECK:STDERR: error: name `Core.String` implicitly referenced here, but not found [CoreNameNotFound]
|
||||
// CHECK:STDERR: .-| fail_non_ascii_source.carbon:[[@LINE+13]]:19
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: .-| fail_non_ascii_source.carbon:[[@LINE+14]]:19
|
||||
// CHECK:STDERR: -> 19 | var text: i32 = "<E4><B8><96><E7><95><8C>";
|
||||
// CHECK:STDERR: : --------------------------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: : ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| error: name `Core.String` implicitly referenced here, but
|
||||
// CHECK:STDERR: : | not found
|
||||
// CHECK:STDERR: : | [CoreNameNotFound]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: warning: binding `text` unused [UnusedBinding]
|
||||
// CHECK:STDERR: .-| fail_non_ascii_source.carbon:[[@LINE+6]]:7
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 19 | var text: i32 = "<E4><B8><96><E7><95><8C>";
|
||||
// CHECK:STDERR: : ---------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: : ^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| warning: binding `text` unused [UnusedBinding]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
var text: i32 = "世界";
|
||||
}
|
||||
@@ -156,19 +152,18 @@ fn Wide() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn Tabbed() {
|
||||
// CHECK:STDERR: error: name `nowhere` not found [NameNotFound]
|
||||
// CHECK:STDERR: .-| fail_tab_indented.carbon:[[@LINE+13]]:26
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 19 | var also_missing: i32 = nowhere;
|
||||
// CHECK:STDERR: : -------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: -> 18 | var also_missing: i32 = nowhere;
|
||||
// CHECK:STDERR: : ^^^^^^^
|
||||
// CHECK:STDERR: : '--| error: name `nowhere` not found
|
||||
// CHECK:STDERR: : | [NameNotFound]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: warning: binding `also_missing` unused [UnusedBinding]
|
||||
// CHECK:STDERR: .-| fail_tab_indented.carbon:[[@LINE+6]]:6
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 19 | var also_missing: i32 = nowhere;
|
||||
// CHECK:STDERR: : -----------------
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: -> 18 | var also_missing: i32 = nowhere;
|
||||
// CHECK:STDERR: : ^^^^^^^^^^^^^^^^^
|
||||
// CHECK:STDERR: : '--| warning: binding `also_missing` unused [UnusedBinding]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
var also_missing: i32 = nowhere;
|
||||
}
|
||||
@@ -185,21 +180,18 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "cpp_decl.h";
|
||||
|
||||
fn CallIt() {
|
||||
// CHECK:STDERR: error: no matching function for call to 'Use' [CppInteropParseError]
|
||||
// CHECK:STDERR: .-| fail_cpp_interop.carbon:[[@LINE+15]]:3
|
||||
// CHECK:STDERR: .-| fail_cpp_interop.carbon:[[@LINE+13]]:3
|
||||
// CHECK:STDERR: -> 20 | Cpp.Use(1);
|
||||
// CHECK:STDERR: : ^^^^^^^
|
||||
// CHECK:STDERR: : '--| error: no matching function for call to 'Use' [CppInteropParseError]
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: -> 23 | Cpp.Use(1);
|
||||
// CHECK:STDERR: : -------
|
||||
// CHECK:STDERR: |------------
|
||||
// CHECK:STDERR: | .-- included from: fail_cpp_interop.carbon:[[@LINE-9]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: |-| ./cpp_decl.h:3:6
|
||||
// CHECK:STDERR: :
|
||||
// CHECK:STDERR: 3 | void Use(Widget w, int extra);
|
||||
// CHECK:STDERR: : . ---------.---------
|
||||
// CHECK:STDERR: : | '--| requires 2 arguments, but 1 was provided
|
||||
// CHECK:STDERR: : | | [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR: : '--| candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: '------------
|
||||
// CHECK:STDERR: : '---------------| candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: : '----| requires 2 arguments, but 1 was provided
|
||||
// CHECK:STDERR: : | [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR: '----
|
||||
// CHECK:STDERR:
|
||||
Cpp.Use(1);
|
||||
}
|
||||
@@ -74,20 +74,20 @@ and one or more **ranges** that the problem covers: the location's own, plus
|
||||
any the emitter added, such as the operand of an `&` that has no address to
|
||||
take. A range containing the location is underlined instead of the location
|
||||
itself, and the message's text is placed under that range; every other range
|
||||
is underlined by itself. In the rendered form the text appears under the range
|
||||
it marks, and in the compact form or an editor it appears by itself, so it is
|
||||
worded for both.
|
||||
is underlined by itself. In the rendered form the text appears under its range,
|
||||
and in the compact form or an editor it appears by itself, so it is worded for
|
||||
both.
|
||||
|
||||
**Labels** are attached to the message to explain it. A label is a range of
|
||||
source with optional **text** saying what that range has to do with the
|
||||
problem, read together with the code it marks: `declared here` is not a
|
||||
sentence anyone would read alone. A label with no text marks its range and
|
||||
nothing more, telling the reader to look there but not why, which is all a
|
||||
problem, read together with the code it is attached to: `declared here` is not
|
||||
a sentence anyone would read alone. A label with no text underlines its range
|
||||
and nothing more, telling the reader to look there but not why, which is all a
|
||||
Clang note's ranges convey.
|
||||
|
||||
The **path** is how the message's location was reached: an import, an
|
||||
`#include`, a macro expansion. Each **step** is drawn as a single
|
||||
`<text>: <location>` row above the anchor of the file it reached, with no
|
||||
`<text>: <location>` row above the location row of the file it reached, with no
|
||||
snippet. The emitter calls a step location information.
|
||||
|
||||
Which code emits the message and which attaches a label is the emitter's
|
||||
@@ -218,61 +218,62 @@ it, under the exact range that is wrong:
|
||||
|
||||
```
|
||||
╷ ╭── imported from: c.carbon:2:1 path row
|
||||
├─┤ b.carbon:3:1 anchor
|
||||
-> 3 │ fn Shape() {} source row, marked in the margin
|
||||
· ━━━━━━┳━━━━━ mark row: the mark
|
||||
· ┗━━┫ error: duplicate name ... label row: connector, bar, text
|
||||
├─┤ b.carbon:3:1 location row
|
||||
-> 3 │ fn Shape() {} source row, `->` in the margin
|
||||
· ━━━━━━┳━━━━━ underline row: the heavy underline
|
||||
· ┗━━┫ error: duplicate name ... label row: label line, bar, text
|
||||
┆ elision
|
||||
├─┤ a.carbon:3:7 anchor for a second file
|
||||
├─┤ a.carbon:3:7 location row for a second file
|
||||
3 │ class Shape {} source row
|
||||
· ──┬── mark row
|
||||
· ──┬── underline row
|
||||
· ╰──┤ previously declared here label row
|
||||
╰──── close
|
||||
```
|
||||
|
||||
- The **frame** runs from the `╭` of the first anchor to the `╰────`
|
||||
- The **frame** runs from the `╭` of the first location row to the `╰────`
|
||||
**close**.
|
||||
|
||||
- An **anchor**, `╭─┤ <file>:<line>:<column>`, gives the location of the part
|
||||
whose snippet is below it: the message's, or a label's for a file the
|
||||
- A **location row**, `╭─┤ <file>:<line>:<column>`, gives the location of the
|
||||
part whose snippet is below it: the message's, or a label's for a file the
|
||||
message is not in. It is a location to go to, not the first row shown:
|
||||
ranges in one file share one view of it in source order, so a declaration
|
||||
above the problem is drawn above the message, and the anchor's line can
|
||||
name a row further down. Unknown parts of the location are omitted from
|
||||
the right. The frame's first anchor starts with `╭`, any other with `├`.
|
||||
above the problem is drawn above the message, and the location row's line
|
||||
can name a row further down. Unknown parts of the location are omitted from
|
||||
the right. The frame's first location row starts with `╭`, any other with
|
||||
`├`.
|
||||
|
||||
- A **source row** is a line of the file, numbered in the gutter. The line
|
||||
the message is placed under is marked `->` in the **margin**, and its
|
||||
number takes the level's color: that is where to begin reading, wherever
|
||||
it is in the frame.
|
||||
the message is placed under has `->` in the **margin**, and its number
|
||||
takes the level's color: that is where to begin reading, wherever it is in
|
||||
the frame.
|
||||
|
||||
- A **mark row** holds the **marks**, the underlines under ranges, with `·`
|
||||
in place of the frame so the row isn't mistaken for source. The mark the
|
||||
message is placed under is heavy; every other mark is light, in the
|
||||
level's colors for
|
||||
another of the message's ranges and the label color for a label's.
|
||||
Everything marking one line goes on one row.
|
||||
- An **underline row** holds the **underlines** under ranges, with `·` in
|
||||
place of the frame so the row isn't mistaken for source. The underline the
|
||||
message is placed under is heavy; every other underline is light, in the
|
||||
level's colors for another of the message's ranges and the label color for a
|
||||
label's. Every underline for one line goes on one row.
|
||||
|
||||
- A **label row** holds the text placed under a mark: a **connector** leaves
|
||||
the mark at a tee and meets the **bar** framing the text, `╰──┤`. The
|
||||
message's row is a label row beginning with the **level word**, `error:`,
|
||||
with bold text and a heavy connector and bar.
|
||||
- A **label row** holds the text placed under an underline: a **label line**
|
||||
leaves the underline at a tee and meets the **bar** framing the text,
|
||||
`╰──┤`. The message's row is a label row beginning with the **level word**,
|
||||
`error:`, with bold text and a heavy label line and bar.
|
||||
|
||||
- An **elision row**, `┆`, continues the frame as a dotted line across
|
||||
whatever isn't contiguous: skipped lines, or the step to the next anchor. A
|
||||
single skipped line is shown instead, which takes the same number of rows.
|
||||
whatever isn't contiguous: skipped lines, or the step to the next location
|
||||
row. A single skipped line is shown instead, which takes the same number of
|
||||
rows.
|
||||
|
||||
- A **path row**, `╭── <text>: <location>`, is drawn above an anchor and
|
||||
- A **path row**, `╭── <text>: <location>`, is drawn above a location row and
|
||||
states how that file was reached, its line continuing down into the
|
||||
anchor's bracket.
|
||||
location row's bracket.
|
||||
|
||||
- A part with **no source**, because its location names only a file or nothing
|
||||
at all, is the fallback. It still gets an anchor, naming what location it
|
||||
has or `<no location>`, and its text is placed under the anchor instead of
|
||||
under a mark, starting at the source's first column. A message's text is
|
||||
placed the same way, beginning with the level word, with the `->` on its
|
||||
anchor, and the file's other ranges follow under that anchor past an
|
||||
elision:
|
||||
at all, is the fallback. It still gets a location row, naming what location
|
||||
it has or `<no location>`, and its text is placed under the location row
|
||||
instead of under an underline, starting at the source's first column. A
|
||||
message's text is placed the same way, beginning with the level word, with
|
||||
the `->` on its location row, and the file's other ranges follow under that
|
||||
location row past an elision:
|
||||
|
||||
```
|
||||
-> ╭─┤ thunk.carbon
|
||||
@@ -295,50 +296,52 @@ it, under the exact range that is wrong:
|
||||
### Finding the message
|
||||
|
||||
There is no headline. Everything that makes the message findable is on its own
|
||||
row: the level word, its weight and color, the heavy mark, and the `->` in the
|
||||
margin of its line. With color the red `error:` is the first thing seen;
|
||||
without it the `->` points to the heavy mark, whose connector runs down to the
|
||||
sentence. The reading order is the same either way: the sentence and its code,
|
||||
the other labels as needed, and the anchors as the coordinates for going there.
|
||||
row: the level word, its weight and color, the heavy underline, and the `->` in
|
||||
the margin of its line. With color the red `error:` is the first thing seen;
|
||||
without it the `->` points to the heavy underline, whose label line runs down to
|
||||
the sentence. The reading order is the same either way: the sentence and its
|
||||
code, the other labels as needed, and the location rows as the coordinates for
|
||||
going there.
|
||||
|
||||
The drawback is that the message is not at a fixed row of its frame, since a
|
||||
declaration above the problem is drawn first. The fixed positions to scan for
|
||||
in a long log are the `╭` that starts every diagnostic and the `->` in column
|
||||
zero, drawn once per frame on the row to begin reading at. A message with no
|
||||
source to mark is placed under its anchor, and the `->` marks the anchor.
|
||||
source to underline is placed under its location row, and the `->` points to
|
||||
that row.
|
||||
|
||||
One frame per diagnostic, rather than one per message, shows the reader where
|
||||
one problem ends and the next begins. Each file the diagnostic points into
|
||||
gets an anchor inside that frame, and the frame continues as a dotted `┆`
|
||||
gets a location row inside that frame, and the frame continues as a dotted `┆`
|
||||
rather than breaking.
|
||||
|
||||
The message is placed under its location's range unless another of its ranges
|
||||
contains that location, in which case that range is used instead: the location
|
||||
is a point chosen for a cursor, and the range shows what the problem covers.
|
||||
Overlapping ranges are drawn widest first, so the narrowest mark on a column is
|
||||
the one left visible, except that the heavy mark is drawn last so nothing
|
||||
repaints it. A range inside it appears only as the tee where its connector
|
||||
leaves the heavy stroke, or not at all if it has no text.
|
||||
Overlapping ranges are drawn widest first, so the narrowest underline on a
|
||||
column is the one left visible, except that the heavy underline is drawn last so
|
||||
nothing repaints it. A range inside it appears only as the tee where its label
|
||||
line leaves the heavy underline, or not at all if it has no text.
|
||||
|
||||
### Placing the text
|
||||
|
||||
The rows under a mark row hold the text placed under its marks, laid out by
|
||||
these rules in this order.
|
||||
The rows under an underline row hold the text placed under its underlines, laid
|
||||
out by these rules in this order.
|
||||
|
||||
**Order.** The rows read top to bottom the way the code reads left to right: the
|
||||
message first, then each label in the order of its range. Each label's text
|
||||
starts two columns right of the text above, so the indentation steps with the
|
||||
order.
|
||||
|
||||
**Meeting the text.** A connector reaches the bar on the first row of its text,
|
||||
**Meeting the text.** A label line reaches the bar on the first row of its text,
|
||||
where the level word is, so following the heavy line arrives at the start of
|
||||
the sentence. The bar continues down every row the text wraps onto.
|
||||
|
||||
**Placement.** Every label's text, the message's included, starts right of every
|
||||
connector's column, so a connector descending to a later label runs beside the
|
||||
label line's column, so a label line descending to a later label runs beside the
|
||||
text above it, never behind it.
|
||||
|
||||
**Crossings.** Reading order makes a later connector descend through rows
|
||||
**Crossings.** Reading order makes a later label line descend through rows
|
||||
already drawn. Earlier rows keep what they drew: the descending line breaks
|
||||
around each run it meets in a single cell, never at a junction, and the gap
|
||||
shows that the two don't connect. On a terminal wide enough that nothing wraps
|
||||
@@ -346,33 +349,33 @@ this is the common shape: a label right of a one-row message descends `┬`, a
|
||||
gap, `╰`, with no vertical cell showing. The tee and the corner are what show
|
||||
the connection.
|
||||
|
||||
**Out-dented blocks.** Text that does not fit under its mark, because its
|
||||
widest word does not fit right of the connector, is out-dented to the source's
|
||||
**Out-dented blocks.** Text that does not fit under its underline, because its
|
||||
widest word does not fit right of the label line, is out-dented to the source's
|
||||
column (see [Fitting the terminal](#fitting-the-terminal)). A block occupies
|
||||
its rows entirely, blank cells included, so a connector descending past it
|
||||
its rows entirely, blank cells included, so a label line descending past it
|
||||
skips those rows and resumes below.
|
||||
|
||||
**Quoted code.** Wrapping breaks at spaces, except inside backticks: a quoted
|
||||
type or snippet moves to the next row whole or extends past the edge like a
|
||||
path.
|
||||
|
||||
A mark and the connector and bar of its label take the color of the message they
|
||||
belong to, following `rustc`; the label's text does not, since color belongs on
|
||||
what it points at. Only the message's marks are heavy and bold: the heavy
|
||||
strokes supply the emphasis where a terminal ignores bold on line art, and bold
|
||||
matches the marks to the text where it doesn't.
|
||||
An underline and the label line and bar of its label take the color of the
|
||||
message they belong to, following `rustc`; the label's text does not, since
|
||||
color belongs on what it points at. Only the message's underlines are heavy and
|
||||
bold: the heavy stroke weight supplies the emphasis where a terminal ignores
|
||||
bold on line art, and bold matches the underlines to the text where it doesn't.
|
||||
|
||||
Ranges that touch would run together, so an end that meets another range stops
|
||||
at the center of its cell, leaving a gap, but only where the range still has a
|
||||
column for its label's connector. A one-column mark that gives up an end has
|
||||
nothing to tee into, so its connector is drawn down the column in place of it,
|
||||
from the cell's center, and two such columns side by side look like two marks.
|
||||
ASCII has no half cell, so it does not draw the gap.
|
||||
column for its label line. A one-column underline that gives up an end has
|
||||
nothing to tee into, so its label line is drawn down the column in place of it,
|
||||
from the cell's center, and two such columns side by side look like two
|
||||
underlines. ASCII has no half cell, so it does not draw the gap.
|
||||
|
||||
### Several files in one diagnostic
|
||||
|
||||
Each file a diagnostic points into gets an anchor, in the order the parts reach
|
||||
it, and the frame runs down through all of them.
|
||||
Each file a diagnostic points into gets a location row, in the order the parts
|
||||
reach it, and the frame runs down through all of them.
|
||||
|
||||
Only the path to the problem itself is drawn: the message's own location, never
|
||||
a label's. How the file holding a declaration was reached is rarely useful to
|
||||
@@ -410,49 +413,49 @@ Sixty columns is a guess; nothing depends on it being right.
|
||||
|
||||
Clang's diagnostics are drawn here rather than by Clang. Its message, location,
|
||||
ranges, and fix-its each become the thing they correspond to. A location names a
|
||||
point and is marked as the one column Clang's caret marks; a range containing
|
||||
that point is used instead, the `~~~` of `^~~~`, so the text is placed under the
|
||||
whole range. The diagnostic's other ranges are the message's, in the level's
|
||||
color; a note's are labels with no text, in the label color, as Clang would draw
|
||||
them. A fix-it becomes a label saying what to do, which is still shown in the
|
||||
compact form, where an inline rendering would not be; carrying the edit as data
|
||||
is [future work](#future-work).
|
||||
point and is underlined as the one column Clang's caret points to; a range
|
||||
containing that point is used instead, the `~~~` of `^~~~`, so the text is
|
||||
placed under the whole range. The diagnostic's other ranges are the message's,
|
||||
in the level's color; a note's are labels with no text, in the label color, as
|
||||
Clang would draw them. A fix-it becomes a label saying what to do, which is
|
||||
still shown in the compact form, where an inline rendering would not be;
|
||||
carrying the edit as data is [future work](#future-work).
|
||||
|
||||
`SemIR::ConvertClangRangeToLoc` turns a Clang range into the location the
|
||||
renderer needs, on both the path with a Carbon `Context` and the one without.
|
||||
Several notes on one line share its source row, each placed under its own
|
||||
mark.
|
||||
underline.
|
||||
|
||||
Overload-resolution candidate notes are written as
|
||||
`<what was considered>: <why it was not viable>` and mark the source the second
|
||||
half is about, so each becomes two labels: the candidate on the declaration the
|
||||
note names, and the reason on what Clang marked. The notes split are listed by
|
||||
kind, since any note might contain a colon. Moving the split upstream is
|
||||
[future work](#future-work).
|
||||
`<what was considered>: <why it was not viable>` and are located at the
|
||||
source the second half is about, so each becomes two labels: the candidate on
|
||||
the declaration the note names, and the reason on the source Clang located it
|
||||
at. The notes split are listed by kind, since any note might contain a colon.
|
||||
Moving the split upstream is [future work](#future-work).
|
||||
|
||||
The `#include` and macro expansion stacks arrive as location information and
|
||||
read `included from`, `imported from module at`, and `expanded from macro
|
||||
defined at` above the anchor of the message's own location. They are left out
|
||||
for a note, as Clang leaves them out.
|
||||
defined at` above the location row of the message's own location. They are left
|
||||
out for a note, as Clang leaves them out.
|
||||
|
||||
## Style
|
||||
|
||||
### The palette
|
||||
|
||||
Styles are named for what they mark, so changing a color is one edit.
|
||||
Styles are named for what they apply to, so changing a color is one edit.
|
||||
|
||||
| Element | Style | Rationale |
|
||||
| :--------------------------- | :-------------------- | :------------------------------------------------------------------------------------------ |
|
||||
| `error` | bold, bright red | Clang, GCC, and `rustc` agree. |
|
||||
| `warning` | bold, bright yellow | `rustc`'s choice and the conventional caution color; Clang and GCC use magenta. |
|
||||
| `note` | bold, bright cyan | GCC's choice; distinct from error and warning at any brightness. Begins a label's line in the compact form; in the frame a label's text is placed under its mark or anchor with no level word. |
|
||||
| `note` | bold, bright cyan | GCC's choice; distinct from error and warning at any brightness. Begins a label's line in the compact form; in the frame a label's text is placed under its underline or location row with no level word. |
|
||||
| Message | bold, no color | The longest run of text; color belongs on what it points at. Bold only when placed under code. |
|
||||
| Frame | bold, bright blue | `rustc`'s choice. Not dim, which several terminals don't implement. |
|
||||
| Line numbers | bright blue | Not bold, so the one number colored as the reported line stands out. |
|
||||
| Location in an anchor | plain | The bracket already delimits it. |
|
||||
| Location in a location row | plain | The bracket already delimits it. |
|
||||
| Location in the compact form | bold | Begins the line with nothing around it. |
|
||||
| The message's marks | the level color, bold | Makes the range and the sentence one unit. |
|
||||
| A label's marks and connectors | the label ramp | Connects a mark to its text. Not bold or heavy: that emphasis is the message's alone. |
|
||||
| The message's underlines | the level color, bold | Makes the range and the sentence one unit. |
|
||||
| A label's underlines and label lines | the label ramp | Connects an underline to its text. Not bold or heavy: that emphasis is the message's alone. |
|
||||
| Path | dim | How the reader got here, not what is wrong. |
|
||||
| Kind | dim | Only present under a flag. |
|
||||
|
||||
@@ -469,9 +472,9 @@ express more, colors are given as RGB, and each theme gets a ramp of three:
|
||||
|
||||
A ramp is assigned darker, center, lighter, so several ranges on one line read
|
||||
as a progression; a range with no others of its theme beside it takes the
|
||||
center. The mark the message is placed under always takes the center, and its
|
||||
other ranges on that line take successive colors from the ramp, with the center
|
||||
left out.
|
||||
center. The underline the message is placed under always takes the center, and
|
||||
its other ranges on that line take successive colors from the ramp, with the
|
||||
center left out.
|
||||
|
||||
The three centers are at one lightness: bright yellow is over four times the
|
||||
luminance of bright red, which would make a warning brighter than an error, and
|
||||
@@ -487,40 +490,41 @@ rendered without dim would make the frame as prominent as the code.
|
||||
|
||||
### Character set
|
||||
|
||||
| Element | `Charset::Utf8` | `Charset::Ascii` |
|
||||
| :-------------------------- | :---------------- | :----------------------- |
|
||||
| Frame and connectors | `│ ╭ ├ ╰ ─ ┤ ╯` | `\| . \| ' - \| '` |
|
||||
| Frame stub above a path row | `╷` | `\|` |
|
||||
| Mark and label rows' frame | `·` | `:` |
|
||||
| Elision | `┆` | `:` |
|
||||
| Light marks | `─ ┬ ╷ ╴ ╶` | `- . \| - -` |
|
||||
| The message's marks | `━ ┳ ┗ ┫ ┃ ╻ ╸ ╺` | `^ ^ ' \| \| ^ ^ ^` |
|
||||
| Out-dented message's reach | `┏ ┛` | `. '` |
|
||||
| A label's tee on the heavy | `┯` | `.` |
|
||||
| The margin's pointer | `->` | `->` |
|
||||
| Element | `Charset::Utf8` | `Charset::Ascii` |
|
||||
| :------------------------------ | :---------------- | :----------------------- |
|
||||
| Frame and label lines | `│ ╭ ├ ╰ ─ ┤ ╯` | `\| . \| ' - \| '` |
|
||||
| Frame's start above a path row | `╷` | `\|` |
|
||||
| Underline and label rows' frame | `·` | `:` |
|
||||
| Elision | `┆` | `:` |
|
||||
| Light underlines | `─ ┬ ╷ ╴ ╶` | `- . \| - -` |
|
||||
| The message's underlines | `━ ┳ ┗ ┫ ┃ ╻ ╸ ╺` | `^ ^ ' \| \| ^ ^ ^` |
|
||||
| Out-dented message's reach | `┏ ┛` | `. '` |
|
||||
| A label's tee on the heavy | `┯` | `.` |
|
||||
| The margin's pointer | `->` | `->` |
|
||||
|
||||
The last two light marks and the last two heavy ones are ends that stop at the
|
||||
center of their cell, the gap between touching ranges.
|
||||
The last two light underline glyphs and the last two heavy ones are ends that
|
||||
stop at the center of their cell, the gap between touching ranges.
|
||||
|
||||
Everything is drawn as lines through `Terminal::Buffer`, which picks the glyph
|
||||
for the character set and forms corners and tees where lines meet, so a
|
||||
connector joins an underline at a junction and a light connector on the heavy
|
||||
for the character set and forms corners and tees where lines meet, so a label
|
||||
line joins an underline at a junction and a light label line on the heavy
|
||||
underline forms `┯`. Each glyph is one column in both character sets, so the
|
||||
frame occupies the same columns. A label's connector never joins the message's:
|
||||
sharing its column it leaves the shared stretch heavy, and crossing its rows it
|
||||
gaps.
|
||||
frame occupies the same columns. No other label line joins the message's:
|
||||
sharing its column one leaves the shared stretch heavy, and crossing its rows
|
||||
one gaps.
|
||||
|
||||
ASCII has no weights, so weight degrades to one distinction. A cell holding a
|
||||
heavy stroke that no line enters from above is `^`, the emphatic underline C++
|
||||
compilers have long used: the heavy run, the tee the message's own connector
|
||||
leaves it by, and a one-column mark that the connector replaces. The connector
|
||||
below keeps a label's strokes. A light tee degrades to `.`, the corner for a
|
||||
line leaving downward, on a light run or the heavy one: the dashes either side
|
||||
draw the through-stroke, and the branch is the only thing marking the connection
|
||||
when the connector below may be rows away with only gaps between. `+` is a
|
||||
crossing where lines connect, which a diagnostic never draws.
|
||||
ASCII has no weights, so weight degrades to one distinction. A cell with a heavy
|
||||
line leaving it that no line enters from above is `^`, the emphatic underline
|
||||
C++ compilers have long used: the heavy underline, the tee where the message's
|
||||
own label line leaves it, and a one-column underline that the label line
|
||||
replaces. Below that cell the label line is drawn as a light line, as a label's
|
||||
is. A light tee degrades to `.`, the corner for a line leaving downward, on a
|
||||
light underline or the heavy one: the dashes either side draw the underline, and
|
||||
the `.` is the only thing showing where the label line leaves it when the rest
|
||||
of the label line may be rows away with only gaps between. `+` is a crossing
|
||||
where lines connect, which a diagnostic never draws.
|
||||
|
||||
A run of `~` provides no junction for a connector to join, and Unicode has no
|
||||
A run of `~` provides no junction for a label line to join, and Unicode has no
|
||||
one-column wavy character. A glyph also has to be one column in practice, not
|
||||
only by the width tables: a terminal that counts one as two cells shifts the
|
||||
rest of its row, and in the margin that puts the source a column off from its
|
||||
@@ -533,8 +537,8 @@ something other than color, so plain output loses appearance and no information.
|
||||
|
||||
## Fitting the terminal
|
||||
|
||||
Nothing a diagnostic says is ever dropped; source outside a marked range is what
|
||||
gets elided. The width comes from `COLUMNS` if exported, otherwise from the
|
||||
Nothing a diagnostic says is ever dropped; source outside an underlined range is
|
||||
what gets elided. The width comes from `COLUMNS` if exported, otherwise from the
|
||||
terminal with `TIOCGWINSZ`, and otherwise is the width code is formatted to plus
|
||||
the gutter, so a formatted line is shown whole.
|
||||
|
||||
@@ -548,15 +552,15 @@ the gutter, so a formatted line is shown whole.
|
||||
another diagnostic. Wrapping breaks only at spaces outside backticks, so a
|
||||
path, a URL, or a quoted type overhangs rather than splitting.
|
||||
|
||||
- Connectors slide left before any text wraps. Since text starts right of
|
||||
every connector, making room for one label's text can require moving
|
||||
several: each connector right of where the text needs to start slides
|
||||
- Label lines slide left before any text wraps. Since text starts right of
|
||||
every label line, making room for one label's text can require moving
|
||||
several: each label line right of where the text needs to start slides
|
||||
within its own range, as far as the widest word requires, whichever label
|
||||
it belongs to.
|
||||
|
||||
- A label whose widest word still does not fit is out-dented to the
|
||||
source's column, keeping its place in the reading order, with the top of
|
||||
its bar turning right to reach back to its connector. Several such blocks
|
||||
its bar turning right to reach back to its label line. Several such blocks
|
||||
stack in that order.
|
||||
|
||||
## Normalizing source text
|
||||
@@ -582,11 +586,11 @@ Generating them is the HTML target under [Future work](#future-work).
|
||||
The message is placed under the operator, which connects the syntax to the
|
||||
interface it reports missing, a rule the reader has no other way to learn. The
|
||||
operands are labeled with the types they contributed, since a type is nothing
|
||||
the source can show. Their marks take successive colors from the label ramp, the
|
||||
labels read in operand order stepping right, and the right operand's connector
|
||||
runs beside the message, crossing its run in single cells. That connector is at
|
||||
its range's start rather than its middle because the message's text occupies the
|
||||
columns its middle would need.
|
||||
the source can show. Their underlines take successive colors from the label
|
||||
ramp, the labels read in operand order stepping right, and the right operand's
|
||||
label line runs beside the message, crossing its line in single cells. That
|
||||
label line is at its range's start rather than its middle because the message's
|
||||
text occupies the columns its middle would need.
|
||||
|
||||
<!-- The colored examples are the renderer's terminal output with its ANSI
|
||||
styling transcribed into inline-styled HTML, so that the rendered markdown
|
||||
@@ -611,8 +615,9 @@ rendered rather than raw. -->
|
||||
### Several files, reached by an import
|
||||
|
||||
The problem is in an imported file, so the path by which the reader's own build
|
||||
reached it draws above its anchor, dim. The declaration it collides with gets a
|
||||
bare anchor, since a label's path is never drawn, and the label marks the name.
|
||||
reached it draws above its location row, dim. The declaration it collides with
|
||||
gets a location row with no path, since a label's path is never drawn, and the
|
||||
label is attached to the name.
|
||||
|
||||
<!-- rumdl-disable -->
|
||||
|
||||
@@ -659,9 +664,9 @@ completing a type, attached one to whatever was diagnosed inside it.
|
||||
|
||||
### Without color or Unicode
|
||||
|
||||
The message's mark degrades to `^`, every other mark to `-` with a `.` where a
|
||||
label leaves it, and the `->`, the `^` run, and the level word still say where
|
||||
to look first:
|
||||
The message's underline degrades to `^`, every other underline to `-` with a `.`
|
||||
where a label line leaves it, and the `->`, the `^` run, and the level word
|
||||
still say where to look first:
|
||||
|
||||
```
|
||||
.-| foo.carbon:4:3
|
||||
@@ -689,7 +694,7 @@ Three invariants shape the code:
|
||||
|
||||
- Everything is drawn as lines through the buffer, so every corner and tee is
|
||||
a junction it forms, and the ASCII fallback is whatever it draws lines
|
||||
with. The message's marks are the same lines drawn heavy.
|
||||
with. The message's underlines are the same lines drawn heavy.
|
||||
|
||||
- The renderer repairs what it is given rather than failing: a range past the
|
||||
end of its line is clamped, a location missing parts still draws, and
|
||||
@@ -734,12 +739,12 @@ File tests cover the rendering end to end. `toolchain/diagnostics/testdata`
|
||||
keeps full numbering, and its `fail_rendering.carbon` checks the ASCII form.
|
||||
Every other `file_test` runs with `--terminal-unicode=always` and
|
||||
`--no-diagnostic-line-numbers`, so its goldens are the frames nearly every
|
||||
terminal gets, with one location apiece, the leading anchor's, which autoupdate
|
||||
maintains as a `[[@LINE...]]` offset. Full numbering would make a golden depend
|
||||
on the positions of its own `CHECK` lines, and an anchor in a second file names
|
||||
lines no offset can express. The rows above the leading anchor, the path, take
|
||||
its location in `ToolchainFileTest::FinalizeCheckLines` so a frame moves as one
|
||||
block.
|
||||
terminal gets, with one location apiece, the leading location row's, which
|
||||
autoupdate maintains as a `[[@LINE...]]` offset. Full numbering would make a
|
||||
golden depend on the positions of its own `CHECK` lines, and a location row in a
|
||||
second file names lines no offset can express. The rows above the leading
|
||||
location row, the path, take its location in
|
||||
`ToolchainFileTest::FinalizeCheckLines` so a frame moves as one block.
|
||||
|
||||
Goldens differ from what a user sees in two ways: every file test also passes
|
||||
`--include-diagnostic-kind`, so a wrapped block may use an extra row that only
|
||||
@@ -753,16 +758,16 @@ None of this is needed for the rendering to be useful.
|
||||
- Removing location-less parts: everything that reaches the renderer with
|
||||
only a filename, such as conversions in compiler-generated thunks and C++
|
||||
imports without a mapped location, restructured to carry one, and a
|
||||
diagnostic about a file as a whole anchored at its start or end.
|
||||
diagnostic about a file as a whole located at its start or end.
|
||||
|
||||
- Ranges spanning several lines, which are clamped to their first line today,
|
||||
usually a declaration's least informative part.
|
||||
|
||||
- Two ranges on one line too far apart to share a window. The one outside the
|
||||
window is marked at its edge, over the `...`, rather than getting its own
|
||||
view of the line.
|
||||
window is underlined at its edge, over the `...`, rather than getting its
|
||||
own view of the line.
|
||||
|
||||
- Marking ranges within the source row, with color on or behind the text,
|
||||
- Showing ranges within the source row, with color on or behind the text,
|
||||
where past two or three the underlines stack faster than a reader can match
|
||||
them; it has to leave the row no worse to read without color.
|
||||
|
||||
@@ -802,24 +807,24 @@ None of this is needed for the rendering to be useful.
|
||||
## Alternatives considered
|
||||
|
||||
- A headline row above the frame, as an earlier iteration did. It uses a row
|
||||
to say, away from the code, what the message says better on its mark, and
|
||||
splits the cues a reader finds a diagnostic by between the headline and the
|
||||
mark below. It provides a fixed row to scan for, which the `╭` corner and
|
||||
the margin's `->` provide instead.
|
||||
to say, away from the code, what the message says better on its underline,
|
||||
and splits the cues a reader finds a diagnostic by between the headline and
|
||||
the underline below. It provides a fixed row to scan for, which the `╭`
|
||||
corner and the margin's `->` provide instead.
|
||||
|
||||
- Stacking labels rightmost first, so no connector crosses another. Every
|
||||
- Stacking labels rightmost first, so no label line crosses another. Every
|
||||
line stayed whole, but the rows read in reverse and the message could end
|
||||
up mid-stack. Reading order matters more than unbroken connectors.
|
||||
up mid-stack. Reading order matters more than unbroken label lines.
|
||||
|
||||
- Meeting wrapped words at their middle row, where a brace would. A reader
|
||||
following the heavy line then arrives partway through the sentence.
|
||||
|
||||
- Out-denting a label before its text fails to fit, whenever placing it under
|
||||
its mark would wrap deeply. At seventy columns a message anchored far right
|
||||
can wrap four ways in a twenty-column column where out-denting would give
|
||||
two clean rows. Placing it under the mark is kept: out-denting adds a
|
||||
reach-back row and moves the text away from its mark, and a threshold would
|
||||
be one more guess.
|
||||
its underline would wrap deeply. At seventy columns a message placed far
|
||||
right can wrap four ways in a twenty-column column where out-denting would
|
||||
give two clean rows. Placing it under the underline is kept: out-denting
|
||||
adds a reach-back row and moves the text away from its underline, and a
|
||||
threshold would be one more guess.
|
||||
|
||||
- Clang and GCC's location-first header. The message is what the reader
|
||||
needs, and the tooling case for the location is met by the language server
|
||||
@@ -831,33 +836,33 @@ None of this is needed for the rendering to be useful.
|
||||
- A frame per file, separated by blank lines: a blank line stops meaning
|
||||
"next diagnostic", and it uses more rows.
|
||||
|
||||
- A heavier frame, with a blank row under each anchor, a rule between
|
||||
- A heavier frame, with a blank row under each location row, a rule between
|
||||
snippets, and a full-width close. Each added a row that showed nothing the
|
||||
neighboring rows didn't already show.
|
||||
|
||||
- A path above every anchor. On anything explanatory it restates the
|
||||
- A path above every location row. On anything explanatory it restates the
|
||||
filename, and it was the most prominent text in the frame and the least
|
||||
useful.
|
||||
|
||||
- A message row, `├─ note: <text>`, for a part with no source, as an earlier
|
||||
iteration did. It was a row shorter than an anchor and its label, but a
|
||||
iteration did. It was a row shorter than a location row and its label, but a
|
||||
form of its own, which dropped the part's filename and began with a level
|
||||
word no other label has.
|
||||
|
||||
- Closing the anchor after the location, `╭─┤ file:1:1 │`, as `ariadne`
|
||||
draws it: the location then looks like a caption rather than where the
|
||||
snippet comes from.
|
||||
- Closing the location row's bracket after the location, `╭─┤ file:1:1 │`, as
|
||||
`ariadne` draws it: the location then looks like a caption rather than where
|
||||
the snippet comes from.
|
||||
|
||||
- Placing the path below the anchor. It only reads correctly with the steps
|
||||
reversed, since each row's subject is the file named on the row above.
|
||||
- Placing the path below the location row. It only reads correctly with the
|
||||
steps reversed, since each row's subject is the file named on the row above.
|
||||
|
||||
- Underlining with `~`, as Clang does: a run of characters gives a connector
|
||||
- Underlining with `~`, as Clang does: a run of characters gives a label line
|
||||
no junction to join, and doesn't degrade through the same line drawing as
|
||||
the frame.
|
||||
|
||||
- Reverse video on the source row instead of an underline, which halves a
|
||||
snippet's rows. It shows nothing without color, and the mark row is where
|
||||
every connector tees in.
|
||||
snippet's rows. It shows nothing without color, and the underline row is
|
||||
where every label line tees in.
|
||||
|
||||
- Emoji for the severity. They are one column in some terminals and two in
|
||||
others, and a font drawing one in color ignores the color asked for, which
|
||||
|
||||
Reference in new issue
Block a user