tundeclared_routine.nim 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. discard """
  2. cmd: '''nim check --hints:off $file'''
  3. action: reject
  4. nimout: '''
  5. tundeclared_routine.nim(24, 17) Error: attempting to call routine: 'myiter'
  6. found tundeclared_routine.myiter(a: string) [iterator declared in tundeclared_routine.nim(22, 12)]
  7. found tundeclared_routine.myiter() [iterator declared in tundeclared_routine.nim(23, 12)]
  8. tundeclared_routine.nim(29, 28) Error: invalid pragma: myPragma
  9. tundeclared_routine.nim(36, 13) Error: undeclared field: 'bar3' for type tundeclared_routine.Foo [type declared in tundeclared_routine.nim(33, 8)]
  10. found tundeclared_routine.bar3() [iterator declared in tundeclared_routine.nim(35, 12)]
  11. tundeclared_routine.nim(41, 13) Error: undeclared field: 'bar4' for type tundeclared_routine.Foo [type declared in tundeclared_routine.nim(39, 8)]
  12. tundeclared_routine.nim(44, 15) Error: attempting to call routine: 'bad5'
  13. '''
  14. """
  15. # line 20
  16. block:
  17. iterator myiter(a:string): int = discard
  18. iterator myiter(): int = discard
  19. let a = myiter(1)
  20. block:
  21. proc myPragma():int=discard
  22. iterator myPragma():int=discard
  23. proc myfun(a:int): int {.myPragma.} = 1
  24. let a = myfun(1)
  25. block:
  26. type Foo = object
  27. var a = Foo()
  28. iterator bar3():int=discard
  29. let a2 = a.bar3
  30. block:
  31. type Foo = object
  32. var a = Foo()
  33. let a2 = a.bar4
  34. block:
  35. let a = bad5(1)