Created
May 22, 2019 15:37
-
-
Save stefantalpalaru/d07d51e2587510946162946352a611eb to your computer and use it in GitHub Desktop.
type_conversion.nim
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
import typetraits | |
type | |
Error1 = object of Exception | |
# changing the proc into a template avoids the type conversion | |
proc t1(error: ref Exception) = | |
echo type(error) | |
# this prints "ref Exception" instead of "ref Error1": | |
t1(newException(Error1, "foo")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment