bugfix: fixed broken expr proc bodies
This commit is contained in:
parent
9bbf56bdbb
commit
8cadc60e08
2 changed files with 6 additions and 3 deletions
|
|
@ -903,9 +903,9 @@ proc semStaticStmt(c: PContext, n: PNode): PNode =
|
||||||
result.sons[0] = emptyNode
|
result.sons[0] = emptyNode
|
||||||
|
|
||||||
# special marker values that indicates that we are
|
# special marker values that indicates that we are
|
||||||
# 1) AnalyzingDestructor: currenlty analyzing the type for destructor
|
# 1) AnalyzingDestructor: currently analyzing the type for destructor
|
||||||
# generation (needed for recursive types)
|
# generation (needed for recursive types)
|
||||||
# 2) DestructorIsTrivial: completed the anlysis before and determined
|
# 2) DestructorIsTrivial: completed the analysis before and determined
|
||||||
# that the type has a trivial destructor
|
# that the type has a trivial destructor
|
||||||
var AnalyzingDestructor, DestructorIsTrivial: PSym
|
var AnalyzingDestructor, DestructorIsTrivial: PSym
|
||||||
new(AnalyzingDestructor)
|
new(AnalyzingDestructor)
|
||||||
|
|
@ -1131,6 +1131,10 @@ proc semStmtList(c: PContext, n: PNode): PNode =
|
||||||
of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: nil
|
of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: nil
|
||||||
else: localError(n.sons[j].info, errStmtInvalidAfterReturn)
|
else: localError(n.sons[j].info, errStmtInvalidAfterReturn)
|
||||||
else: nil
|
else: nil
|
||||||
|
|
||||||
|
# a statement list (s; e) has the type 'e':
|
||||||
|
if result.kind == nkStmtList and result.len > 0:
|
||||||
|
result.typ = lastSon(result).typ
|
||||||
|
|
||||||
proc SemStmt(c: PContext, n: PNode): PNode =
|
proc SemStmt(c: PContext, n: PNode): PNode =
|
||||||
# now: simply an alias:
|
# now: simply an alias:
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -6,7 +6,6 @@ version 0.9.2
|
||||||
- implement the compiler as a service
|
- implement the compiler as a service
|
||||||
- implement for loop transformation for first class iterators
|
- implement for loop transformation for first class iterators
|
||||||
- ``=`` should be overloadable; requires specialization for ``=``
|
- ``=`` should be overloadable; requires specialization for ``=``
|
||||||
- fix broken expr/stmt handling for proc bodies
|
|
||||||
- make 'bind' default for templates and introduce 'mixin'
|
- make 'bind' default for templates and introduce 'mixin'
|
||||||
- implicit deref for parameter matching; overloading based on 'var T'
|
- implicit deref for parameter matching; overloading based on 'var T'
|
||||||
- optimize genericAssign in the code generator
|
- optimize genericAssign in the code generator
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue