timports.nim 763 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. discard """
  2. output: '''
  3. 317
  4. TEST2
  5. 5 5 5
  6. false
  7. '''
  8. """
  9. import mbind_bracket, mclosed_sym, mdotlookup, mmodule_same_as_proc
  10. block tbind_bracket:
  11. # bug #2599
  12. # also test that `[]` can be passed now as a first class construct:
  13. template takeBracket(x, a, i: untyped) =
  14. echo x(a, i)
  15. var a: array[10, int]
  16. a[8] = 317
  17. takeBracket(`[]`, a, 8)
  18. let reg = newRegistry[UUIDObject]()
  19. reg.register(UUIDObject())
  20. block tclosed_sym:
  21. # bug #2664
  22. proc same(r:R, d:int) = echo "TEST1"
  23. doIt(Data[int](d:123), R())
  24. import strutils, unicode # ambiguous `strip`
  25. block tdotlookup:
  26. foo(7)
  27. # bug #1444
  28. fn(4)
  29. doAssert doStrip(123) == "123"
  30. block tmodule_same_as_proc:
  31. # bug #1965
  32. proc test[T](t: T) =
  33. mmodule_same_as_proc"a"
  34. test(0)