diff options
author | Araq <rumpf_a@web.de> | 2015-08-02 02:54:43 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-08-02 02:56:02 +0200 |
commit | 1b4116702b411c82ccec4b558768689b2a1a0964 (patch) | |
tree | 8403fdbd4dfb248647a3ffb7a2bb03de15206c97 /compiler | |
parent | f9750781c04cf0f2f278ef4ce8734ba9bc3e859c (diff) | |
download | Nim-1b4116702b411c82ccec4b558768689b2a1a0964.tar.gz |
fixes #3052
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semtypes.nim | 3 |
1 files changed, 3 insertions, 0 deletions
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 |