diff options
author | cooldome <cdome@bk.ru> | 2020-04-08 13:16:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-08 13:16:25 +0100 |
commit | b4e9f8e814373fc38741736197d88475663ce758 (patch) | |
tree | 52b84d6894d0e0a0ddd3a9c578a23e056576c1c2 /compiler/semexprs.nim | |
parent | f86fc5316af480336a2dcd899b3f7288819914e7 (diff) | |
download | Nim-b4e9f8e814373fc38741736197d88475663ce758.tar.gz |
fix ICE in isUnresolvedSym (#13925)
Co-authored-by: cooldome <ariabushenko@bk.ru>
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 5f82eb1e7..826cf51ba 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -622,11 +622,12 @@ proc isAssignable(c: PContext, n: PNode; isUnsafeAddr=false): TAssignableResult result = parampatterns.isAssignable(c.p.owner, n, isUnsafeAddr) proc isUnresolvedSym(s: PSym): bool = - return s.kind == skGenericParam or - tfInferrableStatic in s.typ.flags or - (s.kind == skParam and s.typ.isMetaType) or - (s.kind == skType and - s.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} != {}) + result = s.kind == skGenericParam + if not result and s.typ != nil: + result = tfInferrableStatic in s.typ.flags or + (s.kind == skParam and s.typ.isMetaType) or + (s.kind == skType and + s.typ.flags * {tfGenericTypeParam, tfImplicitTypeParam} != {}) proc hasUnresolvedArgs(c: PContext, n: PNode): bool = # Checks whether an expression depends on generic parameters that |