Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nimscript doesn't execute 'finally' after 'except' returns/breaks #10925

Open
Wh1teDuke opened this issue Mar 29, 2019 · 1 comment
Open

Nimscript doesn't execute 'finally' after 'except' returns/breaks #10925

Wh1teDuke opened this issue Mar 29, 2019 · 1 comment
Labels
Medium Priority VM see also `const` label

Comments

@Wh1teDuke
Copy link
Contributor

Test

# Nimscript file
var i = 0

proc testInc =
  try:      doAssert false
  except:   return
  finally:  inc(i)
    
testInc()
doAssert i == 1

Result

stack trace: (most recent call last)
Test.nims(9, 11)
[...]/Nim/lib/system/assertions.nim(27, 20) failedAssertImpl
[...]/Nim/lib/system/assertions.nim(20, 11) raiseAssert
[...]/Nim/lib/system/fatal.nim(37, 5) sysFatal
[...]/Nim/lib/system/fatal.nim(37, 5) Error: unhandled exception: [...]/Test.nims(9, 10) `i == 1`

Same behavior with a try inside a block and break inside except.


Nim Compiler Version 0.19.9 [Linux: i386]
Compiled at 2019-03-28
git hash: e904b3f952011ad9531b0923c2000398373af687
active boot switches: -d:release
@Araq Araq added VM see also `const` label Medium Priority and removed Nimscript labels Mar 29, 2019
@Araq
Copy link
Member

Araq commented Sep 19, 2019

Still an issue after our exception handling bugfixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Priority VM see also `const` label
Projects
None yet
Development

No branches or pull requests

3 participants