mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
fixes #23596 When importing a module and declaring an overloadable symbol with the same name as the module in the same scope, the module symbol can take over and make the declared overload impossible to access. Previously enum overloading had a quirk that bypassed this in a context where a specific enum type was expected but this was removed in #23588. Now this is bypassed in every place where a specific type is expected since module symbols don't have a type and so wouldn't be compatible anyway. But the issue still exists in places where no type is expected like `let x = modulename`. I don't see a way of fixing this without nerfing module symbols to the point where they're not accessible by default, which might break some macro code.
7 lines
143 B
Nim
7 lines
143 B
Nim
import std/heapqueue
|
|
proc heapqueue(x: int) = discard
|
|
let x: proc (x: int) = heapqueue
|
|
let y: proc = heapqueue
|
|
when false:
|
|
let z = heapqueue
|