mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-22 07:15:22 +00:00
fixes #6073
This commit is contained in:
@@ -1385,7 +1385,7 @@ proc typeRelImpl(c: var TCandidate, f, aOrig: PType,
|
||||
# XXX: This is very hacky. It should be moved back into liftTypeParam
|
||||
if x.kind in {tyGenericInst, tyArray} and
|
||||
c.calleeSym != nil and
|
||||
c.calleeSym.kind in {skProc, skFunc}:
|
||||
c.calleeSym.kind in {skProc, skFunc} and c.call != nil:
|
||||
let inst = prepareMetatypeForSigmatch(c.c, c.bindings, c.call.info, f)
|
||||
return typeRel(c, inst, a)
|
||||
|
||||
|
||||
13
tests/types/tyet_another_generic_regression.nim
Normal file
13
tests/types/tyet_another_generic_regression.nim
Normal file
@@ -0,0 +1,13 @@
|
||||
import system
|
||||
|
||||
type Bar[T] = ref object
|
||||
value: T
|
||||
|
||||
type types = int32|int64 # if I change this to just int32 or int64 it works (compiles)
|
||||
|
||||
# if I replace Bar everywhere with seq it also compiles fine
|
||||
proc Foo[T: Bar[types]](): T =
|
||||
when T is Bar: nil
|
||||
|
||||
discard Foo[Bar[int32]]()
|
||||
#bug #6073
|
||||
Reference in New Issue
Block a user