mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 01:42:41 +00:00
Render diagnostics through the terminal library (#7683)
Diagnostic rendering was part of the data model: `Loc::FormatLocation` and `Loc::FormatSnippet` wrote plain text to a stream, so no capability, color, or terminal width could reach them. A diagnostic is now one message with labels, contexts, and location information attached, and `Diagnostics::Renderer` draws it into a `Terminal::Buffer`. The design is in `toolchain/docs/diagnostics_rendering.md` (#7668), authoring in `toolchain/docs/diagnostics.md`. Before: ``` example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments Run0(1); ^~~~~~~ example.carbon:3:1: note: calling function declared here fn Run0() {} ^~~~~~~~~~~ ``` After: ``` error: 1 argument passed to function expecting 0 arguments ╭─┤ example.carbon:6:3 ┆ 3 │ fn Run0() {} · ─────┬───── · ╰──┤ calling function declared here ┆ -> 6 │ Run0(1); · ─────── ╰──────────── ``` `--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`. File tests use it; the rendering tests under `toolchain/diagnostics/testdata` ask for snippets. C++ interop diagnostics are data now rather than text Clang drew: `SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang location is marked as the point it names. `StreamConsumer` moves to a `:renderer` target that `:emitter` does not depend on, keeping `common/terminal` out of `consumer.h`. Capabilities come from the file behind the error stream, so tests get plain ASCII. `renderer_fuzzer` draws diagnostics built from fuzzer bytes with every capability combination, since a shape the renderer doesn't expect must never be why the compiler dies while reporting a problem. TODOs mark the follow-ups: line weights and crossing lines, wrapping that keeps a quoted type whole, and ordering diagnostics that share a byte offset. Also: `IncorrectExtension`'s hint moves into its message, since its note had no location of its own, and `strip_noise` in `check_diagnostics.py` blanks multi-line `#define`s instead of deleting them. Assisted-by: Claude Code
This commit is contained in:
1 parent
e1c8c1f855
commit
2c9739799b
1205 files changed
+20291
-24988
No files matched your search
@@ -51,24 +51,16 @@ enum class EC { e1, e2, e3 };
|
||||
''';
|
||||
|
||||
fn TestEnumClass(a: Cpp.EC, b: Cpp.EC) {
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitAndWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = a & b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-23: error: cannot access member of interface `Core.BitAndWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = a & b;
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitOrWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = a | b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-23: error: cannot access member of interface `Core.BitOrWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = a | b;
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitXorWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = a ^ b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-23: error: cannot access member of interface `Core.BitXorWith(Cpp.EC)` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = a ^ b;
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+4]]:19: error: cannot access member of interface `Core.BitComplement` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: Cpp.EC = ^a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_enum_class_bitwise_operators.carbon:[[@LINE+2]]:19-20: error: cannot access member of interface `Core.BitComplement` in type `Cpp.EC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: Cpp.EC = ^a;
|
||||
}
|
||||
@@ -145,163 +137,105 @@ struct ConvertibleToFloat {
|
||||
|
||||
fn TestInteger(a: Cpp.ConvertibleToInt, b: Cpp.ConvertibleToInt) {
|
||||
// Test arithmetic.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a + b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a + b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a - b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a - b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a * b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a * b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a / b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a / b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.ModWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a % b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.ModWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a % b;
|
||||
|
||||
// Test bitwise.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitAndWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a & b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.BitAndWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a & b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitOrWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a | b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.BitOrWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a | b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitXorWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a ^ b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.BitXorWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a ^ b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.LeftShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a << b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-21: error: cannot access member of interface `Core.LeftShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a << b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.RightShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = a >> b;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-21: error: cannot access member of interface `Core.RightShiftWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = a >> b;
|
||||
|
||||
// Test comparison.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a == b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a == b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a != b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a != b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a < b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a < b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a <= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a <= b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a > b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a > b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a >= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToInt)` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a >= b);
|
||||
|
||||
// Test unary.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = -a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-17: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = -a;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.BitComplement` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: i32 = ^a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-17: error: cannot access member of interface `Core.BitComplement` in type `Cpp.ConvertibleToInt` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: i32 = ^a;
|
||||
}
|
||||
|
||||
fn TestFloat(a: Cpp.ConvertibleToFloat, b: Cpp.ConvertibleToFloat) {
|
||||
// Test arithmetic.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a + b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.AddWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a + b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a - b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.SubWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a - b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a * b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.MulWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a * b;
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = a / b;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-20: error: cannot access member of interface `Core.DivWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = a / b;
|
||||
|
||||
// Test comparison.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a == b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a == b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a != b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.EqWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a != b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a < b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a < b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a <= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a <= b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a > b);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-22: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a > b);
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:18: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: bool = (a >= b);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:18-23: error: cannot access member of interface `Core.OrderedWith(Cpp.ConvertibleToFloat)` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: bool = (a >= b);
|
||||
|
||||
// Test unary.
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+4]]:16: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let _: f32 = -a;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_convert_all_operands.carbon:[[@LINE+2]]:16-17: error: cannot access member of interface `Core.Negate` in type `Cpp.ConvertibleToFloat` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let _: f32 = -a;
|
||||
}
|
||||
@@ -62,9 +62,7 @@ public:
|
||||
''';
|
||||
|
||||
fn TestDerefPass(var int_ptr: Cpp.MultiDeref) -> ref i32 {
|
||||
// CHECK:STDERR: fail_todo_multi_deref.carbon:[[@LINE+4]]:10: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR: return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_multi_deref.carbon:[[@LINE+2]]:10-41: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
}
|
||||
@@ -91,9 +89,7 @@ public:
|
||||
''';
|
||||
|
||||
fn TestDerefPass(var int_ptr: Cpp.MaybeDeref(i32)) -> ref i32 {
|
||||
// CHECK:STDERR: fail_todo_maybe_deref.carbon:[[@LINE+4]]:10: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR: return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_maybe_deref.carbon:[[@LINE+2]]:10-41: error: semantics TODO: `operator* overload sets not implemented yet` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
return int_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
}
|
||||
@@ -107,9 +103,7 @@ class NotAPtr {};
|
||||
''';
|
||||
|
||||
fn TestDerefFail(not_ptr: Cpp.NotAPtr) {
|
||||
// CHECK:STDERR: fail_not_a_ptr.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.CppUnsafeDeref` in type `Cpp.NotAPtr` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: not_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_not_a_ptr.carbon:[[@LINE+2]]:3-34: error: cannot access member of interface `Core.CppUnsafeDeref` in type `Cpp.NotAPtr` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
not_ptr.(Core.CppUnsafeDeref.Op)();
|
||||
}
|
||||
|
||||
+39
-117
@@ -93,15 +93,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp inline '''c++
|
||||
struct NeqBoolish {
|
||||
auto operator==(NeqBoolish) const -> bool;
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+9]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator!=(NeqBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator!=(NeqBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: default fn NotEqual(self, other: Other) -> bool {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+3]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3-51: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
auto operator!=(NeqBoolish) const -> int;
|
||||
};
|
||||
|
||||
@@ -120,48 +114,22 @@ struct BothBoolish {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-18]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator==(EqBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-21]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator==(EqBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Equal(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-16]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-17]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3-39: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+12]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-22]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator==(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-25]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator==(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Equal(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-12]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-13]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:13:3-39: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+7]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-34]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator!=(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-37]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator!=(BothBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: default fn NotEqual(self, other: Other) -> bool {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-16]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-17]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:14:3-51: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
x == y;
|
||||
@@ -200,29 +168,19 @@ fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
}
|
||||
|
||||
fn Test(default_eq_only: Cpp.DefaultEqOnly,
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+4]]:33: error: member name `DefaultSpaceshipOnly` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: default_spaceship_only: Cpp.DefaultSpaceshipOnly,
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+2]]:33-56: error: member name `DefaultSpaceshipOnly` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
default_spaceship_only: Cpp.DefaultSpaceshipOnly,
|
||||
only_eq_declared: Cpp.OnlyEqDeclared) {
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(default_eq_only, default_eq_only);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-15]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+3]]:3-42: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-11]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(default_eq_only, default_eq_only);
|
||||
|
||||
EqWith(default_spaceship_only, default_spaceship_only);
|
||||
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(only_eq_declared, only_eq_declared);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-26]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE+3]]:3-44: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_comparison_rewrites.carbon:[[@LINE-18]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(only_eq_declared, only_eq_declared);
|
||||
}
|
||||
@@ -277,82 +235,46 @@ fn Test(only_neq: Cpp.OnlyNeq,
|
||||
deleted_neq: Cpp.DeletedNeq,
|
||||
non_const_eq: Cpp.NonConstEq,
|
||||
a2: Cpp.A2, b2: Cpp.B2) {
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.OnlyNeq` into type implementing `Core.EqWith(Cpp.OnlyNeq)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(only_neq, only_neq);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-15]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-28: error: cannot convert type `Cpp.OnlyNeq` into type implementing `Core.EqWith(Cpp.OnlyNeq)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-13]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(only_neq, only_neq);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+8]]:10: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR: EqWith(only_non_default_spaceship, only_non_default_spaceship);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+4]]:10-35: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+4]]:38: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR: EqWith(only_non_default_spaceship, only_non_default_spaceship);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+2]]:38-63: error: name `only_non_default_spaceship` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
EqWith(only_non_default_spaceship, only_non_default_spaceship);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.EqWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(no_relevant_members, no_relevant_members);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-34]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-50: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.EqWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-24]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(no_relevant_members, no_relevant_members);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.EqReturnsVoid` into type implementing `Core.EqWith(Cpp.EqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(eq_returns_void, eq_returns_void);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-42: error: cannot convert type `Cpp.EqReturnsVoid` into type implementing `Core.EqWith(Cpp.EqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-29]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(eq_returns_void, eq_returns_void);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NeqReturnsVoid` into type implementing `Core.EqWith(Cpp.NeqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(neq_returns_void, neq_returns_void);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-52]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-44: error: cannot convert type `Cpp.NeqReturnsVoid` into type implementing `Core.EqWith(Cpp.NeqReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-34]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(neq_returns_void, neq_returns_void);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+13]]:34: error: overload resolution selected deleted operator '!=' [CppInteropParseError]
|
||||
// CHECK:STDERR: 109 | EqWith(deleted_neq, deleted_neq);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-77]]:8: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | auto operator==(DeletedNeq) const -> bool;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-79]]:8: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 23 | auto operator!=(DeletedNeq) const -> bool = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-67]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+5]]:34: error: overload resolution selected deleted operator '!=' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-55]]:8: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-55]]:8: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-41]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(deleted_neq, deleted_neq);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(non_const_eq, non_const_eq);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-76]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-36: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-46]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(non_const_eq, non_const_eq);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.A2` into type implementing `Core.EqWith(Cpp.B2)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(a2, b2);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-85]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-16: error: cannot convert type `Cpp.A2` into type implementing `Core.EqWith(Cpp.B2)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-51]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(a2, b2);
|
||||
}
|
||||
|
||||
+90
-189
@@ -69,18 +69,12 @@ import Cpp library "prefix_inc_and_dec.h";
|
||||
|
||||
fn F() {
|
||||
var prefix: Cpp.Prefix = Cpp.Prefix.Prefix();
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+8]]:9: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: prefix++;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:9-10: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:3: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: prefix++;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+2]]:3-11: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
prefix++;
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+4]]:9: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: prefix--;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_prefix_calling_postfix.carbon:[[@LINE+2]]:9-10: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
prefix--;
|
||||
}
|
||||
@@ -99,14 +93,10 @@ import Cpp library "postfix_inc_and_dec.h";
|
||||
|
||||
fn F() {
|
||||
var postfix: Cpp.Postfix = Cpp.Postfix.Postfix();
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Inc` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: ++postfix;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+2]]:3-11: error: cannot access member of interface `Core.Inc` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
++postfix;
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+4]]:3: error: cannot access member of interface `Core.Dec` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: --postfix;
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_postfix_calling_prefix.carbon:[[@LINE+2]]:3-11: error: cannot access member of interface `Core.Dec` in type `Cpp.Postfix` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
--postfix;
|
||||
}
|
||||
@@ -221,12 +211,8 @@ fn F() {
|
||||
var c: Cpp.BinaryC = {};
|
||||
|
||||
// Simple assignment.
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `Core.IntLiteral` to `Cpp.BinaryC` [ConversionFailure]
|
||||
// CHECK:STDERR: c = 42;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+4]]:3: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(Cpp.BinaryC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: c = 42;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+3]]:3-8: error: cannot implicitly convert expression of type `Core.IntLiteral` to `Cpp.BinaryC` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_import_assignment.carbon:[[@LINE+2]]:3-8: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(Cpp.BinaryC)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
c = 42;
|
||||
}
|
||||
@@ -256,14 +242,10 @@ import Cpp library "binary_operators.h";
|
||||
fn F() {
|
||||
let c1: Cpp.BinaryC = Cpp.BinaryC.BinaryC();
|
||||
// TODO: Include a list of non-viable candidate operators with this diagnostic.
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:32: error: cannot access member of interface `Core.AddWith(Core.IntLiteral)` in type `Cpp.BinaryC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c2: Cpp.BinaryC = c1 + 5;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+2]]:32-37: error: cannot access member of interface `Core.AddWith(Core.IntLiteral)` in type `Cpp.BinaryC` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c2: Cpp.BinaryC = c1 + 5;
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+4]]:32: error: cannot access member of interface `Core.AddWith(Cpp.BinaryC)` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c3: Cpp.BinaryC = 6 + c1;
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_call_with_wrong_type.carbon:[[@LINE+2]]:32-37: error: cannot access member of interface `Core.AddWith(Cpp.BinaryC)` in type `Core.IntLiteral` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c3: Cpp.BinaryC = 6 + c1;
|
||||
}
|
||||
@@ -283,15 +265,9 @@ void operator+(AmbiguousC, short);
|
||||
''';
|
||||
|
||||
fn Test(c: Cpp.AmbiguousC) {
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE+10]]:5: error: use of overloaded operator '+' is ambiguous (with operand types 'const AmbiguousC' and 'int') [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | c + 1;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-8]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void operator+(AmbiguousC, char);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-10]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void operator+(AmbiguousC, short);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE+4]]:5: error: use of overloaded operator '+' is ambiguous (with operand types 'const AmbiguousC' and 'int') [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-6]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_ambiguous.carbon:[[@LINE-6]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
c + 1;
|
||||
}
|
||||
@@ -307,15 +283,10 @@ void operator+(DeletedC, void*) = delete;
|
||||
''';
|
||||
|
||||
fn Test(c: Cpp.DeletedC) {
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+10]]:5: error: overload resolution selected deleted operator '+' [CppInteropParseError]
|
||||
// CHECK:STDERR: 21 | c + 1;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-8]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void operator+(DeletedC, int) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-10]]:6: note: candidate function not viable: no known conversion from 'int' to 'void *' for 2nd argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void operator+(DeletedC, void*) = delete;
|
||||
// CHECK:STDERR: | ^ ~~~~~
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE+5]]:5: error: overload resolution selected deleted operator '+' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-6]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-6]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_deleted.carbon:[[@LINE-7]]:26-30: note: no known conversion from 'int' to 'void *' for 2nd argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
c + 1;
|
||||
}
|
||||
@@ -346,16 +317,12 @@ fn F() {
|
||||
let unused greater_than: bool = c1 > c2;
|
||||
|
||||
// Rewrite.
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:32: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused less_than: bool = c1 < c2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+2]]:32-38: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let unused less_than: bool = c1 < c2;
|
||||
|
||||
// Rewrite.
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+4]]:44: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused greater_than_or_equal: bool = c1 >= c2;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_rewrite_spaceship.carbon:[[@LINE+2]]:44-51: error: semantics TODO: `Rewriting operator>= using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let unused greater_than_or_equal: bool = c1 >= c2;
|
||||
|
||||
@@ -379,15 +346,9 @@ auto operator<(CDel lhs, BaseDel rhs) -> bool;
|
||||
|
||||
fn F(c: Cpp.CDel) -> bool {
|
||||
// Note that we mention `operator '<=>'` in the diagnostic.
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE+10]]:12: error: overload resolution selected deleted operator '<=>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | return c < c;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-9]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 9 | auto operator<=>(CDel lhs, CDel rhs) -> std::strong_ordering = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-11]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | auto operator<(CDel lhs, BaseDel rhs) -> bool;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE+4]]:12: error: overload resolution selected deleted operator '<=>' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-7]]:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_rewrite_deleted.carbon:[[@LINE-7]]:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return c < c;
|
||||
}
|
||||
@@ -415,9 +376,7 @@ fn F() {
|
||||
let unused equal: bool = c1 == c2;
|
||||
|
||||
// Rewrite.
|
||||
// CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+4]]:32: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: let unused not_equal: bool = c1 != c2;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_rewrite_equal.carbon:[[@LINE+2]]:32-39: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let unused not_equal: bool = c1 != c2;
|
||||
//@dump-sem-ir-end
|
||||
@@ -489,9 +448,7 @@ import Cpp library "plus_with_string_view_conversion.h";
|
||||
fn F() {
|
||||
let s1: str = "hello";
|
||||
let s2: str = "world";
|
||||
// CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+4]]:46: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c: Cpp.StringViewConvertibleC = s1 + s2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_plus_with_string_view_conversion.carbon:[[@LINE+2]]:46-52: error: cannot access member of interface `Core.AddWith(str)` in type `str` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c: Cpp.StringViewConvertibleC = s1 + s2;
|
||||
}
|
||||
@@ -536,47 +493,31 @@ fn F() {
|
||||
var c: Cpp.UnsupportedUnaryC = Cpp.UnsupportedUnaryC.UnsupportedUnaryC();
|
||||
|
||||
// Arithmetic.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+12]]:37: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+6]]:37: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+8]]:37: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:37: error: whitespace missing after binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:37: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:37: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let plus: Cpp.UnsupportedUnaryC = +c;
|
||||
|
||||
// Increment and Decrement.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: c++;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:4-5: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
c++;
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:4: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR: c--;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:4-5: error: expected `;` after expression statement [ExpectedExprSemi]
|
||||
// CHECK:STDERR:
|
||||
c--;
|
||||
|
||||
// Bitwise.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+8]]:42: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: let not_value: Cpp.UnsupportedUnaryC = ~c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:42: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:42: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: let not_value: Cpp.UnsupportedUnaryC = ~c;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:42: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
let not_value: Cpp.UnsupportedUnaryC = ~c;
|
||||
|
||||
// Logical.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+4]]:51: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR: let not_result: Cpp.UnsupportedUnaryC = operator!(c1);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_unary_operators.carbon:[[@LINE+2]]:51: error: `let` declarations must end with a `;` [ExpectedDeclSemi]
|
||||
// CHECK:STDERR:
|
||||
let not_result: Cpp.UnsupportedUnaryC = operator!(c1);
|
||||
|
||||
@@ -611,42 +552,24 @@ fn F() {
|
||||
var c1: Cpp.UnsupportedBinaryC = Cpp.UnsupportedBinaryC.UnsupportedBinaryC();
|
||||
|
||||
// Logical.
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+16]]:44: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:44-51: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+12]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+6]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:59: error: name `c2` not found [NameNotFound]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:59-60: error: name `c2` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:53: error: cannot take the address of non-reference expression [AddrOfNonRef]
|
||||
// CHECK:STDERR: let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+2]]:53: error: cannot take the address of non-reference expression [AddrOfNonRef]
|
||||
// CHECK:STDERR:
|
||||
let and_result: Cpp.UnsupportedBinaryC = operator&&(c1, c2);
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+20]]:43: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+10]]:43-50: error: name `operator` not found [NameNotFound]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+16]]:51: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:51: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+12]]:52: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+6]]:52: error: expected expression [ExpectedExpr]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+8]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:52: error: whitespace missing around binary operator [BinaryOperatorRequiresWhitespace]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+4]]:52: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR: let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_binary_operators.carbon:[[@LINE+2]]:52: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
let or_result: Cpp.UnsupportedBinaryC = operator||(c1, c2);
|
||||
}
|
||||
@@ -731,9 +654,7 @@ fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let c1: Cpp.GlobalOpN.C = Cpp.GlobalOpN.C.C();
|
||||
let c2: Cpp.GlobalOpN.C = Cpp.GlobalOpN.C.C();
|
||||
// CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+4]]:36: error: cannot access member of interface `Core.AddWith(Cpp.GlobalOpN.C)` in type `Cpp.GlobalOpN.C` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c3: Cpp.GlobalOpN.C = c1 + c2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_operands_in_namespace_operator_in_global.carbon:[[@LINE+2]]:36-42: error: cannot access member of interface `Core.AddWith(Cpp.GlobalOpN.C)` in type `Cpp.GlobalOpN.C` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c3: Cpp.GlobalOpN.C = c1 + c2;
|
||||
//@dump-sem-ir-end
|
||||
@@ -840,9 +761,7 @@ import Cpp library "not_found.h";
|
||||
fn F() {
|
||||
let c1: Cpp.NoOperators = Cpp.NoOperators.NoOperators();
|
||||
let c2: Cpp.NoOperators = Cpp.NoOperators.NoOperators();
|
||||
// CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+4]]:36: error: cannot access member of interface `Core.AddWith(Cpp.NoOperators)` in type `Cpp.NoOperators` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: let unused c3: Cpp.NoOperators = c1 + c2;
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_not_found.carbon:[[@LINE+2]]:36-42: error: cannot access member of interface `Core.AddWith(Cpp.NoOperators)` in type `Cpp.NoOperators` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
let unused c3: Cpp.NoOperators = c1 + c2;
|
||||
}
|
||||
@@ -865,13 +784,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+8]]:34: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: let unused result_unary: i32 = -*Cpp.CreateIncomplete();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete_unary.carbon:[[@LINE+4]]:34-57: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete_unary.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let unused result_unary: i32 = -*Cpp.CreateIncomplete();
|
||||
}
|
||||
@@ -884,13 +799,9 @@ import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
var complete: Cpp.Complete = Cpp.Complete.Complete();
|
||||
// CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+8]]:35: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: let unused result_binary: i32 = complete + *Cpp.CreateIncomplete();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete_binary.carbon:[[@LINE+4]]:35-68: error: looking up a C++ operator with incomplete operand type `Cpp.Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete_binary.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
let unused result_binary: i32 = complete + *Cpp.CreateIncomplete();
|
||||
}
|
||||
@@ -914,12 +825,8 @@ fn CreateIncomplete() -> Incomplete*;
|
||||
|
||||
fn F() {
|
||||
var complete: Cpp.CompleteCpp = Cpp.CompleteCpp.CompleteCpp();
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+7]]:28: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: let unused result: i32 = *CreateIncomplete() + complete;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-8]]:1: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE+3]]:28-57: error: looking up a C++ operator with incomplete operand type `Incomplete` [IncompleteOperandTypeInCppOperatorLookup]
|
||||
// CHECK:STDERR: fail_incomplete_operand_carbon_type.carbon:[[@LINE-6]]:1-17: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR:
|
||||
let unused result: i32 = *CreateIncomplete() + complete;
|
||||
}
|
||||
@@ -953,9 +860,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp inline '''
|
||||
template<typename T> struct FailTemplateB {};
|
||||
template<typename T> struct FailTemplateA {
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+3]]:19: error: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
|
||||
// CHECK:STDERR: 10 | friend typename T::error operator+(FailTemplateB<FailTemplateA>, FailTemplateB<FailTemplateA>);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+1]]:19: error: type 'int' cannot be used prior to '::' because it has no members [CppInteropParseError]
|
||||
friend typename T::error operator+(FailTemplateB<FailTemplateA>, FailTemplateB<FailTemplateA>);
|
||||
};
|
||||
|
||||
@@ -963,13 +868,9 @@ using FailTemplateX = FailTemplateB<FailTemplateA<int>>;
|
||||
''';
|
||||
|
||||
fn F(x: Cpp.FailTemplateX) -> i32 {
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+8]]:12: note: in instantiation of template class 'FailTemplateA<int>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 25 | return x + x;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+4]]:12: note: in instantiation of template class 'FailTemplateA<int>' requested here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+4]]:10: error: cannot access member of interface `Core.AddWith(Cpp.FailTemplateB)` in type `Cpp.FailTemplateB` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR: return x + x;
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_indirect_template_instantiation_error.carbon:[[@LINE+2]]:10-14: error: cannot access member of interface `Core.AddWith(Cpp.FailTemplateB)` in type `Cpp.FailTemplateB` that does not implement that interface [MissingImplInMemberAccess]
|
||||
// CHECK:STDERR:
|
||||
return x + x;
|
||||
}
|
||||
@@ -2229,11 +2130,11 @@ fn F() {
|
||||
// CHECK:STDOUT: %operator_LessEqual__carbon_thunk: %operator_LessEqual__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.40d: %pattern_type.831 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.560: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt.40d [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfc: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01: %Destroy.WithSelf.SubobjectDestroy.type.dfc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc36 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc36 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.e2f: %pattern_type.bbc = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.790: %pattern_type.bbc = wrapper_binding_pattern self, %self.param_patt.e2f [concrete]
|
||||
@@ -2275,14 +2176,14 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc36 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl: %Destroy.WithSelf.SubobjectDestroy.type.dfc = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc32 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref bool = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref bool = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc36 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc32 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.831 = ref_param_pattern [concrete = constants.%self.param_patt.40d]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.831 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.560]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -2355,41 +2256,41 @@ fn F() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %greater_than.patt: %pattern_type.831 = value_binding_pattern greater_than [concrete = constants.%greater_than.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc26: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc26: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc26: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %c1.ref.loc24: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc24: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc24: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %less_than: bool = wrapper_binding less_than, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %less_than.patt: %pattern_type.831 = value_binding_pattern less_than [concrete = constants.%less_than.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc33: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc33: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc33: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %c1.ref.loc29: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc29: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc29: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %greater_than_or_equal: bool = wrapper_binding greater_than_or_equal, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %greater_than_or_equal.patt: %pattern_type.831 = value_binding_pattern greater_than_or_equal [concrete = constants.%greater_than_or_equal.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc36: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc36: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc36_41.1: %C = acquire_value %c1.ref.loc36
|
||||
// CHECK:STDOUT: %.loc36_47.1: %C = acquire_value %c2.ref.loc36
|
||||
// CHECK:STDOUT: %.loc36_41.2: ref %C = value_as_ref %.loc36_41.1
|
||||
// CHECK:STDOUT: %addr.loc36_44.1: %ptr.0a2 = addr_of %.loc36_41.2
|
||||
// CHECK:STDOUT: %.loc36_47.2: ref %C = value_as_ref %.loc36_47.1
|
||||
// CHECK:STDOUT: %addr.loc36_44.2: %ptr.0a2 = addr_of %.loc36_47.2
|
||||
// CHECK:STDOUT: %.loc36_44.1: ref bool = temporary_storage
|
||||
// CHECK:STDOUT: %addr.loc36_44.3: %ptr.bb2 = addr_of %.loc36_44.1
|
||||
// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc36_44.1, %addr.loc36_44.2, %addr.loc36_44.3)
|
||||
// CHECK:STDOUT: %.loc36_44.2: init bool to %.loc36_44.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc36_44.3: ref bool = temporary %.loc36_44.1, %.loc36_44.2
|
||||
// CHECK:STDOUT: %.loc36_44.4: bool = acquire_value %.loc36_44.3
|
||||
// CHECK:STDOUT: %.loc36_34: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %less_than_or_equal: bool = wrapper_binding less_than_or_equal, %.loc36_44.4
|
||||
// CHECK:STDOUT: %c1.ref.loc32: ref %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc32: ref %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc32_41.1: %C = acquire_value %c1.ref.loc32
|
||||
// CHECK:STDOUT: %.loc32_47.1: %C = acquire_value %c2.ref.loc32
|
||||
// CHECK:STDOUT: %.loc32_41.2: ref %C = value_as_ref %.loc32_41.1
|
||||
// CHECK:STDOUT: %addr.loc32_44.1: %ptr.0a2 = addr_of %.loc32_41.2
|
||||
// CHECK:STDOUT: %.loc32_47.2: ref %C = value_as_ref %.loc32_47.1
|
||||
// CHECK:STDOUT: %addr.loc32_44.2: %ptr.0a2 = addr_of %.loc32_47.2
|
||||
// CHECK:STDOUT: %.loc32_44.1: ref bool = temporary_storage
|
||||
// CHECK:STDOUT: %addr.loc32_44.3: %ptr.bb2 = addr_of %.loc32_44.1
|
||||
// CHECK:STDOUT: %operator_LessEqual__carbon_thunk.call: init %empty_tuple.type = call imports.%operator_LessEqual__carbon_thunk.decl(%addr.loc32_44.1, %addr.loc32_44.2, %addr.loc32_44.3)
|
||||
// CHECK:STDOUT: %.loc32_44.2: init bool to %.loc32_44.1 = mark_in_place_init %operator_LessEqual__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc32_44.3: ref bool = temporary %.loc32_44.1, %.loc32_44.2
|
||||
// CHECK:STDOUT: %.loc32_44.4: bool = acquire_value %.loc32_44.3
|
||||
// CHECK:STDOUT: %.loc32_34: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %less_than_or_equal: bool = wrapper_binding less_than_or_equal, %.loc32_44.4
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %less_than_or_equal.patt: %pattern_type.831 = value_binding_pattern less_than_or_equal [concrete = constants.%less_than_or_equal.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc36: <bound method> = bound_method %.loc36_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc36(%.loc36_44.3)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc32: <bound method> = bound_method %.loc32_44.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc32(%.loc32_44.3)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %.loc19_38.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%.loc19_38.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -2400,11 +2301,11 @@ fn F() {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc36(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc32(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc36(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32(%self.param: ref bool) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc36(%self.param: ref bool) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32(%self.param: ref bool) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl(%self.param)
|
||||
@@ -2565,9 +2466,9 @@ fn F() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %equal.patt: %pattern_type.831 = value_binding_pattern equal [concrete = constants.%equal.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref.loc23: ref %EqualC = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc23: ref %EqualC = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc23: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %c1.ref.loc21: ref %EqualC = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref.loc21: ref %EqualC = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc21: type = type_literal bool [concrete = bool]
|
||||
// CHECK:STDOUT: %not_equal: bool = wrapper_binding not_equal, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %not_equal.patt: %pattern_type.831 = value_binding_pattern not_equal [concrete = constants.%not_equal.patt]
|
||||
@@ -3072,10 +2973,10 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c1.ref: %C = name_ref c1, %c1
|
||||
// CHECK:STDOUT: %c2.ref: %C = name_ref c2, %c2
|
||||
// CHECK:STDOUT: %.loc14: type = splice_block %C.ref.loc14 [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalOpN.ref.loc14: <namespace> = name_ref GlobalOpN, imports.%GlobalOpN [concrete = imports.%GlobalOpN]
|
||||
// CHECK:STDOUT: %C.ref.loc14: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %C.ref.loc12 [concrete = constants.%C] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalOpN.ref.loc12: <namespace> = name_ref GlobalOpN, imports.%GlobalOpN [concrete = imports.%GlobalOpN]
|
||||
// CHECK:STDOUT: %C.ref.loc12: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c3: %C = wrapper_binding c3, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
|
||||
+40
-120
@@ -118,15 +118,9 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''c++
|
||||
struct LessReturnsBoolish {
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+9]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+6]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<(LessReturnsBoolish) const -> int;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Less(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+3]]:8: error: cannot implicitly convert expression of type `i32` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:8: note: type `i32` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3-38: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
auto operator<(LessReturnsBoolish) const -> int;
|
||||
auto operator<=(LessReturnsBoolish) const -> bool;
|
||||
auto operator>(LessReturnsBoolish) const -> bool;
|
||||
@@ -167,87 +161,37 @@ struct AllReturnBoolish {
|
||||
};
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+82]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+32]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-36]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-39]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<=(LessEqualReturnsBoolish) const -> int*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn LessOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+69]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-34]]:8: error: cannot implicitly convert expression of type `Core.Optional(i32* as Core.OptionalStorage)` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-35]]:8: note: type `Core.Optional(i32* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3-50: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+27]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-39]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-42]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator>=(GreaterEqualReturnsBoolish) const -> Result;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn GreaterOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+56]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-29]]:8: error: cannot implicitly convert expression of type `Cpp.Result` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-30]]:8: note: type `Cpp.Result` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3-53: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+22]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-37]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-40]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Less(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-19]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-20]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:28:3-38: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-49]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-52]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator<=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn LessOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+30]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-23]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-24]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:29:3-50: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+12]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-61]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-64]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator>(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:30:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn Greater(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-27]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-28]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:30:3-41: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+7]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-73]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-76]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: auto operator>=(AllReturnBoolish) const -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fn GreaterOrEquivalent(self, other: Other) -> bool;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+4]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-31]]:8: error: cannot implicitly convert expression of type `f64` to `bool` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE-32]]:8: note: type `f64` does not implement interface `Core.ImplicitAs(bool)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: {{.*}}/prelude/operators/comparison.carbon:31:3-53: note: while building thunk to match the signature of this function [ThunkSignature]
|
||||
// CHECK:STDERR: fail_todo_returns_boolish.carbon:[[@LINE+2]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
x < y;
|
||||
@@ -332,57 +276,33 @@ fn Test(missing_less: Cpp.MissingLess,
|
||||
no_relevant_members: Cpp.NoRelevantMembers,
|
||||
less_returns_void: Cpp.LessReturnsVoid,
|
||||
less_non_const: Cpp.LessNonConst) {
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingLess` into type implementing `Core.OrderedWith(Cpp.MissingLess)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_less, missing_less);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-17]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-41: error: cannot convert type `Cpp.MissingLess` into type implementing `Core.OrderedWith(Cpp.MissingLess)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-15]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_less, missing_less);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingLessEqual` into type implementing `Core.OrderedWith(Cpp.MissingLessEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_less_equal, missing_less_equal);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-26]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-53: error: cannot convert type `Cpp.MissingLessEqual` into type implementing `Core.OrderedWith(Cpp.MissingLessEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-20]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_less_equal, missing_less_equal);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingGreater` into type implementing `Core.OrderedWith(Cpp.MissingGreater)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_greater, missing_greater);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-35]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-47: error: cannot convert type `Cpp.MissingGreater` into type implementing `Core.OrderedWith(Cpp.MissingGreater)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-25]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_greater, missing_greater);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.MissingGreaterEqual` into type implementing `Core.OrderedWith(Cpp.MissingGreaterEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(missing_greater_equal, missing_greater_equal);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-44]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-59: error: cannot convert type `Cpp.MissingGreaterEqual` into type implementing `Core.OrderedWith(Cpp.MissingGreaterEqual)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-30]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(missing_greater_equal, missing_greater_equal);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.OrderedWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(no_relevant_members, no_relevant_members);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-53]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-55: error: cannot convert type `Cpp.NoRelevantMembers` into type implementing `Core.OrderedWith(Cpp.NoRelevantMembers)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-35]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(no_relevant_members, no_relevant_members);
|
||||
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.LessReturnsVoid` into type implementing `Core.OrderedWith(Cpp.LessReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: OrderedWith(less_returns_void, less_returns_void);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-62]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-51: error: cannot convert type `Cpp.LessReturnsVoid` into type implementing `Core.OrderedWith(Cpp.LessReturnsVoid)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-40]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(less_returns_void, less_returns_void);
|
||||
|
||||
|
||||
+15
-45
@@ -152,57 +152,31 @@ fn Test(default_spaceship_only: Cpp.DefaultSpaceshipOnly,
|
||||
returns_partial_ordering: Cpp.ReturnsPartialOrdering,
|
||||
cross_type_lhs: Cpp.CrossTypeLhs,
|
||||
cross_type_rhs: Cpp.CrossTypeRhs) {
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: EqWith(default_spaceship_only, default_spaceship_only);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-25]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-56: error: semantics TODO: `Rewriting operator!= using operator== is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-23]]:1-51: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(default_spaceship_only, default_spaceship_only);
|
||||
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(default_spaceship_only, default_spaceship_only);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-27]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-61: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-21]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(default_spaceship_only, default_spaceship_only);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(returns_strong_ordering, returns_strong_ordering);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-35]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-63: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-25]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(returns_strong_ordering, returns_strong_ordering);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(returns_partial_ordering, returns_partial_ordering);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-43]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-65: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-29]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(returns_partial_ordering, returns_partial_ordering);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+7]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(cross_type_lhs, cross_type_rhs);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-51]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+3]]:3-45: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-33]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(cross_type_lhs, cross_type_rhs);
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+11]]:3: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: OrderedWith(cross_type_rhs, cross_type_lhs);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-59]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn OrderedWith[U: type, T: Core.OrderedWith(U)](x: T, y: U) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE+5]]:3-45: error: semantics TODO: `Rewriting operator< using operator<=> is not supported` [SemanticsTodo]
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-37]]:1-61: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-52]]:9: warning: binding `returns_weak_ordering` unused [UnusedBinding]
|
||||
// CHECK:STDERR: returns_weak_ordering: Cpp.ReturnsWeakOrdering,
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_spaceship_rewrites.carbon:[[@LINE-28]]:9-54: warning: binding `returns_weak_ordering` unused [UnusedBinding]
|
||||
// CHECK:STDERR:
|
||||
OrderedWith(cross_type_rhs, cross_type_lhs);
|
||||
}
|
||||
@@ -216,12 +190,8 @@ import Cpp library "three_way_comparable_types.h";
|
||||
fn EqWith[U: type, T: Core.EqWith(U)](unused x: T, unused y: U) {}
|
||||
|
||||
fn Test(returns_strong_ordering: Cpp.ReturnsStrongOrdering) {
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+7]]:3: error: cannot convert type `Cpp.ReturnsStrongOrdering` into type implementing `Core.EqWith(Cpp.ReturnsStrongOrdering)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EqWith(returns_strong_ordering, returns_strong_ordering);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EqWith[U: type, T: Core.EqWith(U)](unused x: T, unused y: U) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE+3]]:3-58: error: cannot convert type `Cpp.ReturnsStrongOrdering` into type implementing `Core.EqWith(Cpp.ReturnsStrongOrdering)` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_never_valid.carbon:[[@LINE-4]]:1-65: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EqWith(returns_strong_ordering, returns_strong_ordering);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user