bugfix: 'T = ref T' is an illegal recursive type
This commit is contained in:
parent
62ccf13529
commit
279e897eab
5 changed files with 9 additions and 3 deletions
|
|
@ -367,6 +367,7 @@ proc isOpImpl(c: PContext, n: PNode): PNode =
|
||||||
result = newIntNode(nkIntLit, ord(t.kind == tyProc and
|
result = newIntNode(nkIntLit, ord(t.kind == tyProc and
|
||||||
t.callConv == ccClosure and
|
t.callConv == ccClosure and
|
||||||
tfIterator notin t.flags))
|
tfIterator notin t.flags))
|
||||||
|
else: discard
|
||||||
else:
|
else:
|
||||||
var t2 = n[2].typ.skipTypes({tyTypeDesc})
|
var t2 = n[2].typ.skipTypes({tyTypeDesc})
|
||||||
maybeLiftType(t2, c, n.info)
|
maybeLiftType(t2, c, n.info)
|
||||||
|
|
|
||||||
|
|
@ -255,6 +255,7 @@ proc evalIs(n, a: PNode): PNode =
|
||||||
result = newIntNode(nkIntLit, ord(t.kind == tyProc and
|
result = newIntNode(nkIntLit, ord(t.kind == tyProc and
|
||||||
t.callConv == ccClosure and
|
t.callConv == ccClosure and
|
||||||
tfIterator in t.flags))
|
tfIterator in t.flags))
|
||||||
|
else: discard
|
||||||
else:
|
else:
|
||||||
# XXX semexprs.isOpImpl is slightly different and requires a context. yay.
|
# XXX semexprs.isOpImpl is slightly different and requires a context. yay.
|
||||||
let t2 = n[2].typ
|
let t2 = n[2].typ
|
||||||
|
|
|
||||||
|
|
@ -1208,8 +1208,9 @@ proc computeSizeAux(typ: PType, a: var BiggestInt): BiggestInt =
|
||||||
else: result = ptrSize
|
else: result = ptrSize
|
||||||
a = ptrSize
|
a = ptrSize
|
||||||
of tyNil, tyCString, tyString, tySequence, tyPtr, tyRef, tyVar, tyOpenArray,
|
of tyNil, tyCString, tyString, tySequence, tyPtr, tyRef, tyVar, tyOpenArray,
|
||||||
tyBigNum:
|
tyBigNum:
|
||||||
result = ptrSize
|
if typ.lastSon == typ: result = szIllegalRecursion
|
||||||
|
else: result = ptrSize
|
||||||
a = result
|
a = result
|
||||||
of tyArray, tyArrayConstr:
|
of tyArray, tyArrayConstr:
|
||||||
let elemSize = computeSizeAux(typ.sons[1], a)
|
let elemSize = computeSizeAux(typ.sons[1], a)
|
||||||
|
|
|
||||||
4
todo.txt
4
todo.txt
|
|
@ -2,7 +2,10 @@ version 0.10
|
||||||
============
|
============
|
||||||
|
|
||||||
- Test nimfix on various babel packages
|
- Test nimfix on various babel packages
|
||||||
|
|
||||||
|
- bug: 'type T = ref T' not recognized as illegal recursion
|
||||||
- deprecate recursive tuples; tuple needs laxer type checking
|
- deprecate recursive tuples; tuple needs laxer type checking
|
||||||
|
|
||||||
- VM: Pegs do not work at compile-time
|
- VM: Pegs do not work at compile-time
|
||||||
- VM: ptr/ref T cannot work in general
|
- VM: ptr/ref T cannot work in general
|
||||||
|
|
||||||
|
|
@ -44,7 +47,6 @@ Bugs
|
||||||
====
|
====
|
||||||
|
|
||||||
- scopes are still broken for generic instantiation!
|
- scopes are still broken for generic instantiation!
|
||||||
- bug: 'type T = ref T' not recognized as illegal recursion
|
|
||||||
- bug: type conversions concerning proc types are weird
|
- bug: type conversions concerning proc types are weird
|
||||||
- compilation of niminst takes way too long. looks like a regression
|
- compilation of niminst takes way too long. looks like a regression
|
||||||
- docgen: sometimes effects are listed twice
|
- docgen: sometimes effects are listed twice
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ News
|
||||||
be used instead.
|
be used instead.
|
||||||
- String case (or any non-ordinal case) statements
|
- String case (or any non-ordinal case) statements
|
||||||
without 'else' are deprecated.
|
without 'else' are deprecated.
|
||||||
|
- Recursive tuple types are deprecated. Use ``object`` instead.
|
||||||
|
|
||||||
|
|
||||||
Language Additions
|
Language Additions
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue