Skip to content

Commit

Permalink
fixes #11047
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jul 25, 2019
1 parent cc86ce5 commit 57e3a0c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/magics/talias2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ proc fun0(a: int): auto = $a
template fun3(a: int): untyped = $a
template fun3(a = 1.2): untyped = $a

proc main() =
proc main1() =
proc fun0(a: float): auto = $a
proc fun0(a: bool): auto = $a

Expand Down Expand Up @@ -108,5 +108,14 @@ proc main2() = # fixes #8935
testForMe(1 + 1 == 2)
doAssertRaises(AssertionError): testForMe(1 + 1 == 3)

main()
block:# somewhat related to #11047
proc foo(): int {.compileTime.} = 100
# var f {.compileTime.} = foo # would give: Undefined symbols error
# let f {.compileTime.} = foo # would give: Undefined symbols error
# const f = foo # this would work
f:=foo
doAssert f() == 100
static: doAssert f() == 100

main1()
main2()

0 comments on commit 57e3a0c

Please sign in to comment.