breaking change: symbol lookups in generics follows spec more closely; fixes #2664
This commit is contained in:
parent
2e4b59f3d3
commit
c733b3181e
4 changed files with 88 additions and 65 deletions
10
tests/generics/mclosed_sym.nim
Normal file
10
tests/generics/mclosed_sym.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
type R* = object
|
||||
|
||||
type Data*[T] = object
|
||||
d*: T
|
||||
|
||||
proc same(r:R, d:int) = echo "TEST2"
|
||||
|
||||
proc doIt*(d:Data, r:R) =
|
||||
r.same(1) # Expecting this to invoke the local `same()` method
|
||||
11
tests/generics/tclosed_sym.nim
Normal file
11
tests/generics/tclosed_sym.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
discard """
|
||||
output: "TEST2"
|
||||
"""
|
||||
|
||||
# bug #2664
|
||||
|
||||
import mclosed_sym
|
||||
|
||||
proc same(r:R, d:int) = echo "TEST1"
|
||||
|
||||
doIt(Data[int](d:123), R())
|
||||
Loading…
Add table
Add a link
Reference in a new issue