Distinct types derived from ordinal types are ordinal.
This commit is contained in:
parent
623e0763c2
commit
8ebce3ce2b
1 changed files with 2 additions and 1 deletions
|
|
@ -151,7 +151,8 @@ proc isOrdinalType(t: PType): bool =
|
||||||
const
|
const
|
||||||
# caution: uint, uint64 are no ordinal types!
|
# caution: uint, uint64 are no ordinal types!
|
||||||
baseKinds = {tyChar,tyInt..tyInt64,tyUInt8..tyUInt32,tyBool,tyEnum}
|
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]))
|
t.kind in baseKinds or (t.kind in parentKinds and isOrdinalType(t.sons[0]))
|
||||||
|
|
||||||
proc enumHasHoles(t: PType): bool =
|
proc enumHasHoles(t: PType): bool =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue