diff options
author | Araq <rumpf_a@web.de> | 2012-10-12 18:40:24 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-10-12 18:40:24 +0200 |
commit | 8cadc60e08d3664ee28615e4cb80bd3fea968dc7 (patch) | |
tree | 36ac77135c8c7f1ddb7ad9860043619d4cc34e93 /compiler | |
parent | 9bbf56bdbbaeac269a94ece1dbd611e1eb57dda8 (diff) | |
download | Nim-8cadc60e08d3664ee28615e4cb80bd3fea968dc7.tar.gz |
bugfix: fixed broken expr proc bodies
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/semstmts.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 0a2275229..5c0060e20 100755 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -903,9 +903,9 @@ proc semStaticStmt(c: PContext, n: PNode): PNode = result.sons[0] = emptyNode # 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) -# 2) DestructorIsTrivial: completed the anlysis before and determined +# 2) DestructorIsTrivial: completed the analysis before and determined # that the type has a trivial destructor var AnalyzingDestructor, DestructorIsTrivial: PSym new(AnalyzingDestructor) @@ -1131,6 +1131,10 @@ proc semStmtList(c: PContext, n: PNode): PNode = of nkPragma, nkCommentStmt, nkNilLit, nkEmpty: nil else: localError(n.sons[j].info, errStmtInvalidAfterReturn) 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 = # now: simply an alias: |