tforeign_package.nim 800 B

1234567891011121314151617181920212223242526
  1. discard """
  2. matrix: "--errorMax:0 --styleCheck:error"
  3. action: compile
  4. """
  5. import foreign_package/foreign_package
  6. # This call tests that:
  7. # - an instantiation of a generic in a foreign package doesn't raise errors
  8. # when the generic body contains:
  9. # - definition and usage violations
  10. # - builtin pragma usage violations
  11. # - user pragma usage violations
  12. # - definition violations in foreign packages are ignored
  13. # - usage violations in foreign packages are ignored
  14. generic_proc[int]()
  15. # issue #24269, stdlib:
  16. proc c(_: openArray[int]) = discard
  17. static:
  18. doAssert compiles(generic_proc[int]())
  19. doAssert not compiles(genericProc[int]())
  20. doAssert not (compiles do:
  21. proc c(_: openarray[int]) = discard)
  22. doAssert (compiles do:
  23. proc d(_: openArray[int]) = discard)