From 1b4116702b411c82ccec4b558768689b2a1a0964 Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 2 Aug 2015 02:54:43 +0200 Subject: [PATCH] fixes #3052 --- compiler/semtypes.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index b518f0fb9..3bb1284fc 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -23,6 +23,9 @@ proc newConstraint(c: PContext, k: TTypeKind): PType = proc semEnum(c: PContext, n: PNode, prev: PType): PType = if n.sonsLen == 0: return newConstraint(c, tyEnum) + elif n.sonsLen == 1: + # don't create an empty tyEnum; fixes #3052 + return errorType(c) var counter, x: BiggestInt e: PSym