From e7d709791942480cc60afc5e34ec75ec26402b9e Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 22 Mar 2015 10:47:07 +0100 Subject: [PATCH] fixes #1787 --- compiler/types.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/types.nim b/compiler/types.nim index 0d91d1327d..f4ac4daea0 100644 --- a/compiler/types.nim +++ b/compiler/types.nim @@ -1092,9 +1092,11 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind, if result != nil: break if result.isNil and t.sons[0] != nil: result = typeAllowedAux(marker, t.sons[0], skResult, flags) - of tyExpr, tyStmt, tyTypeDesc, tyStatic: + of tyTypeDesc: + # XXX: This is still a horrible idea... result = nil - # XXX er ... no? these should not be allowed! + of tyExpr, tyStmt, tyStatic: + if kind notin {skParam, skResult}: result = t of tyEmpty: if taField notin flags: result = t of tyTypeClasses: