summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorMatthew Baulch <baulch.matt@gmail.com>2016-08-11 21:11:06 +1000
committerMatthew Baulch <baulch.matt@gmail.com>2016-08-11 21:11:06 +1000
commit8ebce3ce2b4210125bc8bf16aba1323d719adaf7 (patch)
tree982de95acf1b7b9e27cdb7fd4a65cff764c450a3 /compiler
parent623e0763c2df1aa49a516775ba5e43fa4e258ba2 (diff)
downloadNim-8ebce3ce2b4210125bc8bf16aba1323d719adaf7.tar.gz
Distinct types derived from ordinal types are ordinal.
Diffstat (limited to 'compiler')
-rw-r--r--compiler/types.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/types.nim b/compiler/types.nim
index 442db8ec9..ff60730f0 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -151,7 +151,8 @@ proc isOrdinalType(t: PType): bool =
   const
     # caution: uint, uint64 are no ordinal types!
     baseKinds = {tyChar,tyInt..tyInt64,tyUInt8..tyUInt32,tyBool,tyEnum}
-    parentKinds = {tyRange, tyOrdinal, tyConst, tyMutable, tyGenericInst}
+    parentKinds = {tyRange, tyOrdinal, tyConst, tyMutable, tyGenericInst,
+                   tyDistinct}
   t.kind in baseKinds or (t.kind in parentKinds and isOrdinalType(t.sons[0]))
 
 proc enumHasHoles(t: PType): bool =