Skip to content

close #12704 by adding a test (tuple codegen error) #13592

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

Merged
merged 2 commits into from
Mar 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions tests/metatype/ttypedesc2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,23 @@ type Point[T] = tuple[x, y: T]
proc origin(T: typedesc): Point[T] = discard
discard origin(int)

block: # issue #12704
const a = $("a", "b")
proc fun() =
const str = $int
let b = $(str, "asdf")
fun()

# https://github.com/nim-lang/Nim/issues/7516
import typetraits

block: #issue #12704
const a = $("a", "b")
proc fun() =
const str = name(int)
let b = $(str, "asdf")
fun()

proc hasDefault1(T: type = int): auto = return T.name
doAssert hasDefault1(int) == "int"
doAssert hasDefault1(string) == "string"
Expand Down