tsug_typedecl.nim 864 B

123456789101112131415161718192021222324252627
  1. # suggestions for type declarations
  2. from system import string, int, bool
  3. type
  4. super = int
  5. someType = bool
  6. let str = "hello"
  7. proc main() =
  8. let a: s#[!]#
  9. # This output show seq, even though that's not imported. This is due to the
  10. # entire symbol table, regardless of import visibility is currently being
  11. # scanned. This is hardly ideal, but changing it with the current level of test
  12. # coverage is unwise as it might break more than it fixes.
  13. discard """
  14. $nimsuggest --tester $file
  15. >sug $1
  16. sug;;skType;;tsug_typedecl.someType;;someType;;*nimsuggest/tests/tsug_typedecl.nim;;7;;2;;"";;100;;Prefix
  17. sug;;skType;;tsug_typedecl.super;;super;;*nimsuggest/tests/tsug_typedecl.nim;;6;;2;;"";;100;;Prefix
  18. sug;;skType;;system.string;;string;;*lib/system/basic_types.nim;;*;;*;;*;;100;;Prefix
  19. sug;;skType;;system.seq;;seq;;*lib/system.nim;;*;;*;;*;;100;;Prefix
  20. """