t8794.nim 468 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. discard """
  2. cmd: "nim check $options $file"
  3. errormsg: ""
  4. nimout: '''
  5. t8794.nim(39, 27) Error: undeclared field: 'a3' for type m8794.Foo3 [type declared in m8794.nim(1, 6)]
  6. '''
  7. """
  8. ## line 20
  9. ## issue #8794
  10. import m8794
  11. when false: # pending https://github.com/nim-lang/Nim/pull/10091 add this
  12. type Foo = object
  13. a1: int
  14. discard Foo().a2
  15. type Foo3b = Foo3
  16. var x2: Foo3b
  17. proc getFun[T](): T =
  18. var a: T
  19. a
  20. discard getFun[type(x2)]().a3