t19730.nim 349 B

123456789101112131415161718192021
  1. discard """
  2. output: '''1.01.01.01.0
  3. 1.01.01.01.0
  4. '''
  5. """
  6. type
  7. Color = concept c
  8. c.r is SomeFloat
  9. c.g is SomeFloat
  10. c.b is SomeFloat
  11. c.a is SomeFloat
  12. proc useColor(color: Color) =
  13. echo(color.r, color.g, color.b, color.a)
  14. let color = (r: 1.0, g: 1.0, b: 1.0, a: 1.0)
  15. useColor(color)
  16. useColor((r: 1.0, g: 1.0, b: 1.0, a: 1.0))