fixes #4478
This commit is contained in:
parent
55db59a897
commit
d779a9b722
2 changed files with 49 additions and 9 deletions
19
tests/typerel/tgeneric_subtype_regression.nim
Normal file
19
tests/typerel/tgeneric_subtype_regression.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
discard """
|
||||
errormsg: "type mismatch: got (FooRef[system.string])"
|
||||
line: 15
|
||||
"""
|
||||
|
||||
# bug #4478
|
||||
|
||||
type
|
||||
Foo[T] = object
|
||||
FooRef[T] = ref Foo[T]
|
||||
|
||||
proc takeFoo[T](foo: Foo[T]): int = discard
|
||||
|
||||
proc g(x: FooRef[string]) =
|
||||
echo x.takeFoo() != 8
|
||||
|
||||
var x: FooRef[string]
|
||||
|
||||
g(x)
|
||||
Loading…
Add table
Add a link
Reference in a new issue