diff options
author | Matthew Baulch <baulch.matt@gmail.com> | 2016-08-11 21:11:06 +1000 |
---|---|---|
committer | Matthew Baulch <baulch.matt@gmail.com> | 2016-08-11 21:11:06 +1000 |
commit | 8ebce3ce2b4210125bc8bf16aba1323d719adaf7 (patch) | |
tree | 982de95acf1b7b9e27cdb7fd4a65cff764c450a3 /compiler | |
parent | 623e0763c2df1aa49a516775ba5e43fa4e258ba2 (diff) | |
download | Nim-8ebce3ce2b4210125bc8bf16aba1323d719adaf7.tar.gz |
Distinct types derived from ordinal types are ordinal.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/types.nim | 3 |
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 = |