parent
c5f64f101b
commit
08159733cd
2 changed files with 32 additions and 2 deletions
|
|
@ -67,6 +67,9 @@ ho
|
|||
king
|
||||
live long; long live
|
||||
king
|
||||
hi
|
||||
try
|
||||
bye
|
||||
'''
|
||||
"""
|
||||
|
||||
|
|
@ -494,3 +497,30 @@ proc weirdScopes =
|
|||
echo king
|
||||
|
||||
weirdScopes()
|
||||
|
||||
|
||||
# bug #14985
|
||||
proc getScope(): string =
|
||||
if true:
|
||||
return "hi"
|
||||
else:
|
||||
"else"
|
||||
|
||||
echo getScope()
|
||||
|
||||
proc getScope3(): string =
|
||||
try:
|
||||
"try"
|
||||
except:
|
||||
return "except"
|
||||
|
||||
echo getScope3()
|
||||
|
||||
proc getScope2(): string =
|
||||
case true
|
||||
of true:
|
||||
return "bye"
|
||||
else:
|
||||
"else"
|
||||
|
||||
echo getScope2()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue