mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
Distinct types derived from ordinal types are ordinal.
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user