Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Names of redefined intrinsics seem to be not getting exported

Open fabiansperber opened this issue 3 years ago • 0 comments

I am getting an error trying to call an intrinsic proc in the global scope that's is assigned a new name in the imported lib. Expected it to work similar to a normal function.

import "core:sys/windows"
CLASSNAME := windows.L("ApplicationWindowClass") // error: 'L' is not exported by 'windows'

add :: proc(a, b: int) -> int { return a + b }
c := add(3, 4) // works
// Note: this proc could also be in a separate lib and the call prefixed with that lib's name and it still works

Related is the following error when trying to access the same exported name without the library name with using the lib:

dummy :: proc() {
    CLASSNAME = windows.L("ApplicationWindowClass") // ok
    using windows
    CLASSNAME = L("ApplicationWindowClass") // error: Undeclared name: L
}

odin report

Odin: dev-2022-08:1f622579 OS: Windows 10 Professional (version: 21H2), build 19044.1889 CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz RAM: 16332 MiB

fabiansperber avatar Sep 01 '22 20:09 fabiansperber