tneedsdiscard_in_for.nim 406 B

1234567891011121314151617181920212223
  1. discard """
  2. errormsg: '''expression 'premultiply(app.gradient[i])' is of type 'Rgba8' and has to be used (or discarded)'''
  3. line: 22
  4. """
  5. # bug #9076
  6. type
  7. Rgba8 = object
  8. proc premultiply*(c: var Rgba8): var Rgba8 =
  9. return c
  10. type
  11. App = ref object
  12. gradient: seq[Rgba8]
  13. method onDraw(app: App) {.base.} =
  14. var
  15. width = 100'f64
  16. for i in 0..<width.int:
  17. app.gradient[i].premultiply()