summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-11 10:34:10 +0530
committerNeelesh Chandola <neelesh.chandola@outlook.com>2018-12-11 10:34:10 +0530
commit47c38cb98e6cde435fd38565cd374050955610eb (patch)
treecc23c23312301d33dea259434a1f0a792f207f22
parente44641b6cb025b689298584418e91844b1ac5a4a (diff)
downloadNim-47c38cb98e6cde435fd38565cd374050955610eb.tar.gz
Better fix
-rw-r--r--compiler/semtypes.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 4cc759e52..eed82adeb 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -100,9 +100,9 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
       of tyString, tyCString:
         strVal = v
         x = counter
-      of tyFloat..tyFloat128:
-        localError(c.config, v.info, errOrdinalTypeExpected)
       else:
+        if not isOrdinalType(v.typ):
+          localError(c.config, v.info, errOrdinalTypeExpected)
         x = getOrdValue(v)
       if i != 1:
         if x != counter: incl(result.flags, tfEnumHasHoles)