t8794.nim 453 B

123456789101112131415161718192021222324
  1. discard """
  2. cmd: "nim check $options $file"
  3. """
  4. ## issue #8794
  5. import m8794
  6. type Foo = object
  7. a1: int
  8. discard Foo().a2 #[tt.Error
  9. ^ undeclared field: 'a2' for type t8794.Foo [type declared in t8794.nim(9, 6)]]#
  10. type Foo3b = Foo3
  11. var x2: Foo3b
  12. proc getFun[T](): T =
  13. var a: T
  14. a
  15. discard getFun[type(x2)]().a3 #[tt.Error
  16. ^ undeclared field: 'a3' for type m8794.Foo3 [type declared in m8794.nim(1, 6)]]#