-
-
Save barcharcraz/4543b539411eebdeb841 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| import macros | |
| type thingone = object | |
| value: int | |
| macro echoType(t: typedesc) : expr = | |
| result = newStrLitNode(t.name & "name") | |
| proc genericone[T]() = | |
| echo echoType(T) | |
| when isMainModule: | |
| genericOne[int]() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
outputs typedescname