testproject.nim 818 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. const
  10. C_A* = 0x7FF0000000000000'f64
  11. C_B* = 0o377'i8
  12. C_C* = 0o277'i8
  13. C_D* = 0o177777'i16
  14. template foo*(a, b: SomeType) =
  15. ## This does nothing
  16. ##
  17. discard
  18. proc bar*[T](a, b: T): T =
  19. result = a + b
  20. proc baz*[T](a, b: T): T {.deprecated.} =
  21. ## This is deprecated without message.
  22. result = a + b
  23. proc buzz*[T](a, b: T): T {.deprecated: "since v0.20".} =
  24. ## This is deprecated with a message.
  25. result = a + b
  26. import std/macros
  27. macro bar*(): untyped =
  28. result = newStmtList()
  29. var aVariable*: array[1, int]
  30. aEnum()
  31. bEnum()
  32. # bug #9432
  33. proc isValid*[T](x: T): bool = x.len > 0