Odin icon indicating copy to clipboard operation
Odin copied to clipboard

`using windows` doesn't work with `windows.L`

Open yay opened this issue 1 year ago • 3 comments

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Odin:    dev-2024-05:2250eb3e7
OS:      Windows 11 Professional (version: 23H2), build 22631.3447
CPU:     12th Gen Intel(R) Core(TM) i9-12900H
RAM:     65219 MiB
Backend: LLVM 17.0.1

Expected Behavior

Program compiles as is.

Current Behavior

Program only compiles with test2 proc commented out.

Failure Information (for bugs)

Screenshot 2024-05-10 180444

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

package main

import "core:sys/windows"

main :: proc() {
	test1()
	test2()
}

test1 :: proc() {
	test := windows.L("test") // compiles fine
}

test2 :: proc() {
	using windows
	test := L("test") // Error: Undeclared name: L
}

Failure Logs

Please include any relevant log snippets or files here.

yay avatar May 10 '24 16:05 yay

just curious what happen if you alias "core:sys/windows" e.g. import win32 "core:sys/windows" ?

Hyrtwol avatar May 10 '24 16:05 Hyrtwol

just curious what happen if you alias "core:sys/windows" e.g. import win32 "core:sys/windows" ?

It doesn't change anything.

yay avatar May 10 '24 16:05 yay

I don't have a Windows machine to test this with, but I was able to recreate the same issue on Linux by aliasing L in a subpackage to a couple different procs in intrinsics (i.e. trap, count_ones).

Seems to be something with how the compiler is interpreting intrinsic proc aliases.

Feoramund avatar May 10 '24 21:05 Feoramund