Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 30, 2018
1 parent e17d156 commit b3827d5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
result = nil
if typ == nil: return
if containsOrIncl(marker, typ.id): return
var t = skipTypes(typ, abstractInst-{tyTypeDesc})
var t = skipTypes(typ, abstractInst+{tyStatic}-{tyTypeDesc})
case t.kind
of tyVar, tyLent:
if kind in {skProc, skFunc, skConst}: return t
Expand All @@ -1197,7 +1197,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
of tyTypeDesc:
# XXX: This is still a horrible idea...
result = nil
of tyExpr, tyStmt, tyStatic:
of tyExpr, tyStmt:
if kind notin {skParam, skResult}: result = t
of tyVoid:
if taField notin flags: result = t
Expand Down Expand Up @@ -1260,6 +1260,7 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
# prevent cascading errors:
result = nil
of tyOptAsRef: result = t
of tyStatic: assert(false)

proc typeAllowed*(t: PType, kind: TSymKind; flags: TTypeAllowedFlags = {}): PType =
# returns 'nil' on success and otherwise the part of the type that is
Expand Down

0 comments on commit b3827d5

Please sign in to comment.