Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jul 25, 2019
1 parent ec5ef44 commit cc86ce5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/magics/talias2.nim
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,23 @@ proc main() =
for ai in fun4a(): s.add ai
doAssert s == [10,3]

block: # works with generics
proc fun5[T](a: T): auto = a
fun5a := fun5
doAssert fun5a(3.2) == 3.2

proc main2() = # fixes #8935
# const myPrint = echo # Error: invalid type for const: proc
# let myPuts = system.echo # Error: invalid type: 'typed'
myPrint:=echo # works
myPrint (1,2)
when false:
const testForMe = assert
testForMe(1 + 1 == 2) # Error: VM problem: dest register is not set

testForMe:=assert
testForMe(1 + 1 == 2)
doAssertRaises(AssertionError): testForMe(1 + 1 == 3)

main()
main2()

0 comments on commit cc86ce5

Please sign in to comment.