diff options
-rw-r--r-- | compiler/semexprs.nim | 1 | ||||
-rw-r--r-- | compiler/semmacrosanity.nim | 8 | ||||
-rw-r--r-- | compiler/semtypes.nim | 2 | ||||
-rw-r--r-- | todo.txt | 8 |
4 files changed, 10 insertions, 9 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 361608a5c..a2e3b9d33 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -447,6 +447,7 @@ proc changeType(n: PNode, newType: PType, check: bool) = of nkPar: let tup = newType.skipTypes({tyGenericInst}) if tup.kind != tyTuple: + if tup.kind == tyObject: return internalError(n.info, "changeType: no tuple type for constructor") elif sonsLen(n) > 0 and n.sons[0].kind == nkExprColonExpr: # named tuple? diff --git a/compiler/semmacrosanity.nim b/compiler/semmacrosanity.nim index 2ef7a54e7..bb9814a16 100644 --- a/compiler/semmacrosanity.nim +++ b/compiler/semmacrosanity.nim @@ -16,9 +16,9 @@ proc ithField(n: PNode, field: int): PSym = result = nil case n.kind of nkRecList: - for i in countup(0, sonsLen(n) - 1): + for i in countup(0, sonsLen(n) - 1): result = ithField(n.sons[i], field-i) - if result != nil: return + if result != nil: return of nkRecCase: if n.sons[0].kind != nkSym: internalError(n.info, "ithField") result = ithField(n.sons[0], field-1) @@ -34,7 +34,7 @@ proc ithField(n: PNode, field: int): PSym = else: discard proc annotateType*(n: PNode, t: PType) = - let x = t.skipTypes(abstractInst) + let x = t.skipTypes(abstractInst+{tyRange}) # Note: x can be unequal to t and we need to be careful to use 't' # to not to skip tyGenericInst case n.kind @@ -80,7 +80,7 @@ proc annotateType*(n: PNode, t: PType) = if x.kind in {tyString, tyCString}: n.typ = t else: - globalError(n.info, "string literal must be of some string type") + globalError(n.info, "string literal must be of some string type") of nkNilLit: if x.kind in NilableTypes: n.typ = t diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 304fe6d14..8c7bd7243 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -629,7 +629,7 @@ proc skipGenericInvocation(t: PType): PType {.inline.} = result = t if result.kind == tyGenericInvocation: result = result.sons[0] - if result.kind == tyGenericBody: + while result.kind in {tyGenericInst, tyGenericBody}: result = lastSon(result) proc addInheritedFields(c: PContext, check: var IntSet, pos: var int, diff --git a/todo.txt b/todo.txt index 12e82331f..1f6932c94 100644 --- a/todo.txt +++ b/todo.txt @@ -1,10 +1,6 @@ version 0.10.4 ============== -- make 'nil' work for 'add': - - resizeString - - incrSeq - - addChar version 0.10.6 (RC1?) @@ -15,6 +11,10 @@ version 0.10.6 (RC1?) - finish 'parallel' or mark as experimental - Deprecate ``immediate`` for templates and macros - special case varargs[untyped] and varargs[typed] +- make 'nil' work for 'add': + - resizeString + - incrSeq + - addChar version 1.0 |