Created
April 20, 2020 16:27
-
-
Save kdeme/ec2d78191ab205fb1f731bc598f8bc38 to your computer and use it in GitHub Desktop.
Forward declare invalid raises behaviour
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type AnotherError = object of CatchableError | |
proc thisRaises() {.raises:[AnotherError].} # Works | |
#proc thisRaises() # Error: can raise an unlisted exception: Exception - at line 8 :( | |
proc anotherProc() {.raises:[AnotherError].} = | |
echo "Hoi" | |
thisRaises() | |
proc thisRaises() {.raises:[AnotherError].} = # Whatever is put here doesn't seem to matter, can even omit. | |
echo "Hi" | |
raise newException(AnotherError, "oh no") | |
anotherProc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment