range/case fixes (#11264)

This commit is contained in:
Jasper Jenkins 2019-05-16 07:36:40 -07:00 • committed by Andreas Rumpf
commit 90ed904c4d
4 changed files with 28 additions and 6 deletions

View file

@ -1255,7 +1255,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
result = typeAllowedAux(marker, lastSon(t), kind, flags)
of tyRange:
if skipTypes(t.sons[0], abstractInst-{tyTypeDesc}).kind notin
{tyChar, tyEnum, tyInt..tyFloat128, tyUInt8..tyUInt32}: result = t
{tyChar, tyEnum, tyInt..tyFloat128, tyUInt8..tyUInt32}: result = t
of tyOpenArray, tyVarargs, tySink:
if kind != skParam:
result = t