Open
Description
An issue I discovered while testing this PR. Apparently, the issue is unrelated to the PR, and I couldn't find an existing issue for that. The problem is that overloading by a local proc does work in this example:
import tables
from hashes import THash
block:
proc hash(x: int): THash {.inline.} =
echo "overloaded hash"
result = x
var t = initTable[int, int]()
t[0] = 0 # will call the overloaded hash
But if I add another (supposedly unrelated) code block, I can no longer use the overloaded function:
import tables
from hashes import THash
block:
var t = initTable[int,int]()
t[0] = 42 # comment this line and it works again!
block:
proc hash(x: int): THash {.inline.} =
echo "overloaded hash"
result = x
var t = initTable[int, int]()
t[0] = 0 # now, this no longer calls the overloaded hash!
Activity