test(ffi-linkage): xfail extern+export mutual-exclusion diagnostic (Phase 4)
This commit is contained in:
11
examples/1175-diagnostics-extern-export-conflict.sx
Normal file
11
examples/1175-diagnostics-extern-export-conflict.sx
Normal file
@@ -0,0 +1,11 @@
|
||||
// Phase 4 (FFI-linkage) interplay diagnostic: `extern` and `export` are the two
|
||||
// values of the same linkage axis — a declaration is either an import (`extern`)
|
||||
// or a definition (`export`), never both. The parser rejects the redundant
|
||||
// second keyword with a clear message (instead of the bare "expected ';'" the
|
||||
// body parser would otherwise emit).
|
||||
//
|
||||
// Expected: one error caret on the second keyword; exit 1.
|
||||
|
||||
f :: (a: i32) -> i32 extern export;
|
||||
|
||||
main :: () -> i32 { 0 }
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,5 @@
|
||||
error: conflicting linkage: 'extern' and 'export' cannot be combined — a declaration is either an import ('extern') or a definition ('export')
|
||||
--> examples/1175-diagnostics-extern-export-conflict.sx:9:29
|
||||
|
|
||||
9 | f :: (a: i32) -> i32 extern export;
|
||||
| ^^^^^^
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user