From 7011275f1341b463de07902f6c6909bc841a53d4 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 5 Jul 2015 13:28:34 +0200 Subject: fixes #3062 --- compiler/semtypes.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index b82c51c07..144a41ff0 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -130,6 +130,7 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType = let isCall = ord(n.kind in nkCallKinds) let n = if n[0].kind == nkBracket: n[0] else: n checkMinSonsLen(n, 1) + var base = semTypeNode(c, n.lastSon, nil) result = newOrPrevType(kind, prev, c) # check every except the last is an object: for i in isCall .. n.len-2: @@ -137,7 +138,6 @@ proc semAnyRef(c: PContext; n: PNode; kind: TTypeKind; prev: PType): PType = if region.skipTypes({tyGenericInst}).kind notin {tyError, tyObject}: message n[i].info, errGenerated, "region needs to be an object type" addSonSkipIntLit(result, region) - var base = semTypeNode(c, n.lastSon, nil) addSonSkipIntLit(result, base) proc semVarType(c: PContext, n: PNode, prev: PType): PType = -- cgit 1.4.1-2-gfad0