parent
b90b45b01b
commit
dd65986795
2 changed files with 22 additions and 1 deletions
21
tests/distinct/t4435.nim
Normal file
21
tests/distinct/t4435.nim
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
discard """
|
||||
output: '''
|
||||
A
|
||||
A
|
||||
'''
|
||||
"""
|
||||
|
||||
type
|
||||
A[T] = distinct T
|
||||
B[T] = distinct T
|
||||
|
||||
proc foo[T](x:A[T]) = echo "A"
|
||||
proc foo[T](x:B[T]) = echo "B"
|
||||
proc bar(x:A) = echo "A"
|
||||
proc bar(x:B) = echo "B"
|
||||
|
||||
var
|
||||
a:A[int]
|
||||
|
||||
foo(a) # fine
|
||||
bar(a) # testdistinct.nim(14, 4) Error: ambiguous call; both testdistinct.bar(x: A) and testdistinct.bar(x: B) match for: (A[system.int])
|
||||
Loading…
Add table
Add a link
Reference in a new issue