Fix fixAbstractType for user defined typeclasses, fixes #19730 & #18409 (#19732)

This commit is contained in:
nc-x 2022-04-30 19:28:58 +05:30 • committed by GitHub
commit 4680ab61c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 58 additions and 1 deletions

20
tests/concepts/t19730.nim Normal file
View file

@ -0,0 +1,20 @@
discard """
output: '''1.01.01.01.0
1.01.01.01.0
'''
"""
type
Color = concept c
c.r is SomeFloat
c.g is SomeFloat
c.b is SomeFloat
c.a is SomeFloat
proc useColor(color: Color) =
echo(color.r, color.g, color.b, color.a)
let color = (r: 1.0, g: 1.0, b: 1.0, a: 1.0)
useColor(color)
useColor((r: 1.0, g: 1.0, b: 1.0, a: 1.0))