test(ffi-linkage): xfail extern+export mutual-exclusion diagnostic (Phase 4)

This commit is contained in:
agra
2026-06-14 15:46:33 +03:00
parent a8e0a8961b
commit 847a027fb1
4 changed files with 18 additions and 0 deletions

View 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 }

View File

@@ -0,0 +1 @@
1

View File

@@ -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;
| ^^^^^^