mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:21:05 +01:00
Remove duplicate check for exporting a specific class (#7541)
The check for a specific in `TryMapClassType` is unnecessary; immediately after it calls `ExportClassToCpp`, which has the same check. The latter also has a `context.TODO`, which provides a clearer error. Also improved the `LocId` in `ExportClassToCpp` to use the location of the first decl rather than the empty location of the class type. This is the same fix as https://github.com/carbon-language/carbon-lang/pull/7533, just applied a little more broadly. This makes the `context.TODO` above point at the class rather than the start of the source file.
This commit is contained in:
@@ -90,6 +90,10 @@ void G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:1: error: semantics TODO: `interop with specific class` [SemanticsTodo]
|
||||
// CHECK:STDERR: class A(T: type) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
class A(T: type) {
|
||||
fn F[U: type](x: T, y: U);
|
||||
}
|
||||
@@ -105,7 +109,7 @@ void f() {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:11: error: no type named 'B' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 22 | Carbon::B b;
|
||||
// CHECK:STDERR: 26 | Carbon::B b;
|
||||
// CHECK:STDERR: | ~~~~~~~~^
|
||||
// CHECK:STDERR:
|
||||
Carbon::B b;
|
||||
|
||||
Reference in New Issue
Block a user