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:
10
examples/1176-diagnostics-foreign-removed.sx
Normal file
10
examples/1176-diagnostics-foreign-removed.sx
Normal 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 }
|
||||
1
examples/expected/1176-diagnostics-foreign-removed.exit
Normal file
1
examples/expected/1176-diagnostics-foreign-removed.exit
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -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;
|
||||
| ^^^^^^^^
|
||||
Reference in New Issue
Block a user