test(ffi-linkage): Phase 8.0 — xfail #foreign-removed rejection diagnostic

Add examples/1176-diagnostics-foreign-removed.sx pinning the DESIRED Phase 8 cutover
behavior: a bare '#foreign' decl must be rejected with a clear migration message
('#foreign has been removed; use the postfix extern/export'). RED — '#foreign' still
parses (routes onto extern) so the decl compiles and exits 0 instead of erroring.
The very next commit (8.1, parser hard-reject) greens it.
This commit is contained in:
agra
2026-06-15 07:40:12 +03:00
parent d132aab232
commit 8180faf839
4 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
// Phase 8 (FFI-linkage) cutover: the prefix `#foreign` linkage directive has
// been removed. A declaration imports an external C symbol via the postfix
// `extern` keyword (or defines + exposes one via `export`). The parser rejects
// `#foreign` with a clear migration message instead of routing it onto `extern`.
//
// Expected: one error on the `#foreign` token; exit 1.
abs_c :: (n: i32) -> i32 #foreign;
main :: () -> i32 { 0 }

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1,5 @@
error: `#foreign` has been removed; use the postfix `extern` (import) / `export` (define) linkage keyword instead
--> examples/1176-diagnostics-foreign-removed.sx:8:26
|
8 | abs_c :: (n: i32) -> i32 #foreign;
| ^^^^^^^^