testproject.nim 721 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import subdir / subdir_b / utils
  2. ## This is the top level module.
  3. runnableExamples:
  4. import subdir / subdir_b / utils
  5. doAssert bar(3, 4) == 7
  6. foo(enumValueA, enumValueB)
  7. # bug #11078
  8. for x in "xx": discard
  9. template foo*(a, b: SomeType) =
  10. ## This does nothing
  11. ##
  12. discard
  13. proc bar*[T](a, b: T): T =
  14. result = a + b
  15. proc baz*[T](a, b: T): T {.deprecated.} =
  16. ## This is deprecated without message.
  17. result = a + b
  18. proc buzz*[T](a, b: T): T {.deprecated: "since v0.20".} =
  19. ## This is deprecated with a message.
  20. result = a + b
  21. import std/macros
  22. macro bar*(): untyped =
  23. result = newStmtList()
  24. var aVariable*: array[1,int]
  25. aEnum()
  26. bEnum()
  27. # bug #9432
  28. proc isValid*[T](x: T): bool = x.len > 0