From 8ebce3ce2b4210125bc8bf16aba1323d719adaf7 Mon Sep 17 00:00:00 2001 From: Matthew Baulch Date: Thu, 11 Aug 2016 21:11:06 +1000 Subject: [PATCH] Distinct types derived from ordinal types are ordinal. --- compiler/types.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/types.nim b/compiler/types.nim index 442db8ec94..ff60730f0b 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 =