Skip to content

Commit 3f6b26c

Browse files
authored
Fix the import C++ namespace indirectly test to make it expected to fail (#6076)
Imported namespace do not implicitly import its content, so lookup inside them is expected to fail.
1 parent aa0095c commit 3f6b26c

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

toolchain/check/testdata/interop/cpp/import.carbon

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,19 @@ import Cpp library "namespace.h";
3030

3131
alias MyNamespaceAlias = Cpp.MyNamespace;
3232

33-
// --- fail_todo_import_namespace_api.carbon
33+
// --- fail_import_namespace_api.carbon
3434

3535
library "[[@TEST_NAME]]";
3636

3737
import library "namespace_api";
3838

3939
fn F() {
40-
//@dump-sem-ir-begin
41-
// CHECK:STDERR: fail_todo_import_namespace_api.carbon:[[@LINE+4]]:10: error: member name `MyClass` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope]
40+
// Imports are not implicitly re-exported, so lookup is expected to fail.
41+
// CHECK:STDERR: fail_import_namespace_api.carbon:[[@LINE+4]]:10: error: member name `MyClass` not found in `Cpp.MyNamespace` [MemberNameNotFoundInInstScope]
4242
// CHECK:STDERR: var x: MyNamespaceAlias.MyClass;
4343
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
4444
// CHECK:STDERR:
4545
var x: MyNamespaceAlias.MyClass;
46-
//@dump-sem-ir-end
4746
}
4847

4948
// ============================================================================
@@ -112,26 +111,6 @@ fn F() {
112111
//@dump-sem-ir-end
113112
}
114113

115-
// CHECK:STDOUT: --- fail_todo_import_namespace_api.carbon
116-
// CHECK:STDOUT:
117-
// CHECK:STDOUT: constants {
118-
// CHECK:STDOUT: }
119-
// CHECK:STDOUT:
120-
// CHECK:STDOUT: imports {
121-
// CHECK:STDOUT: }
122-
// CHECK:STDOUT:
123-
// CHECK:STDOUT: fn @F() {
124-
// CHECK:STDOUT: !entry:
125-
// CHECK:STDOUT: name_binding_decl {
126-
// CHECK:STDOUT: %x.patt: <error> = binding_pattern x [concrete]
127-
// CHECK:STDOUT: %x.var_patt: <error> = var_pattern %x.patt [concrete]
128-
// CHECK:STDOUT: }
129-
// CHECK:STDOUT: %x.var: ref <error> = var %x.var_patt [concrete = <error>]
130-
// CHECK:STDOUT: <elided>
131-
// CHECK:STDOUT: %x: <error> = bind_name x, <error> [concrete = <error>]
132-
// CHECK:STDOUT: <elided>
133-
// CHECK:STDOUT: }
134-
// CHECK:STDOUT:
135114
// CHECK:STDOUT: --- fail_todo_import_struct_api.carbon
136115
// CHECK:STDOUT:
137116
// CHECK:STDOUT: constants {

0 commit comments

Comments
 (0)