Two flat imports each declare `absval` via `extern libc "abs"` (the `extern` twin of example 0729's `#foreign` form). Like its #foreign twin, this must compile + run (prints 7), not error as an ambiguous bare-call collision. Today `isPlainFreeFn` / `isPlainFreeFnDecl` exclude a `#foreign` body but classify an empty-block `extern` fn as a plain free function, so the two extern authors ARE counted in the bare-call ambiguity verdict and the call errors. A third extern/#foreign divergence (after visibility + variadic) and a prerequisite for migrating the fn-decl `#foreign` path onto `extern`. 646 corpus (1230 xfail), 444 unit.
7 lines
395 B
Plaintext
7 lines
395 B
Plaintext
// One of two flat authors of `absval`, an `extern` libc binding — the
|
|
// `extern` twin of example 0729's `#foreign libc "abs"`. A consumer
|
|
// flat-importing BOTH must NOT see this as an ambiguous bare-call
|
|
// collision: extern authors (external C symbols) are excluded from the
|
|
// bare-call ambiguity verdict, exactly like their `#foreign` twins.
|
|
absval :: (n: i32) -> i32 extern libc "abs";
|