odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.1k stars 550 forks source link

disallow non-global foreign import of variables on wasm #3823

Closed laytan closed 4 days ago

laytan commented 4 days ago

AFAIK (checked with clang, which disallows this) this is not allowed, + we are currently ignoring the module for variables.

foreign import foo "foo"

foreign foo {
   bar: baz,
}

should not be allowed, but (global)

foreign {
    bar: baz,
}

is allowed just going of what clang and LLVM allow