Restore the Nim's 0.14 proper handling of generic aliases

A more efficient implementation is possible by restoring the old
lifting ot tyGenericInvocation to tyGenericInst in liftTypeParam,
but this fix will suffice for now.

fixes #5087
fixes #5602
fixes #5641
fixes #5570
This commit is contained in:
Zahary Karadjov 2017-04-07 23:18:14 +03:00
commit e9a3ffbc3d
12 changed files with 236 additions and 55 deletions

View file

@ -1177,7 +1177,8 @@ proc semOverride(c: PContext, s: PSym, n: PNode) =
var objB = t.sons[2]
while true:
if objB.kind == tyGenericBody: objB = objB.lastSon
elif objB.kind == tyGenericInvocation: objB = objB.sons[0]
elif objB.kind in {tyGenericInvocation, tyGenericInst}:
objB = objB.sons[0]
else: break
if obj.kind in {tyObject, tyDistinct} and sameType(obj, objB):
if obj.assignment.isNil: