@@ -25,7 +25,7 @@ class AnnotationsTests extends munit.FunSuite:
25
25
val res = Show .derived[Pet ].show(Dog (" Alex" , 10 , likesMeat = true ))
26
26
assertEquals(
27
27
res,
28
- " {MyTypeAnnotation(2),MyTypeAnnotation(1)}Dog{MyTypeAnnotation(2),MyTypeAnnotation(1)}(name{MyAnnotation(1)}=Alex,age{MyAnnotation(2)}=10,likesMeat{MyAnnotation(3)}=true)"
28
+ " {MyTypeAnnotation(2),MyTypeAnnotation(1)}Dog{MyTypeAnnotation(2),MyTypeAnnotation(1)}(name{[i] MyAnnotation(1)}=Alex,age{[i] MyAnnotation(2)}=10,likesMeat{MyAnnotation(3)}=true)"
29
29
)
30
30
}
31
31
@@ -35,13 +35,13 @@ class AnnotationsTests extends munit.FunSuite:
35
35
.show(Hamster (" Alex" , 10 , likesNuts = true , likesVeggies = true ))
36
36
assertEquals(
37
37
res,
38
- " {MyTypeAnnotation(1)}Hamster{MyTypeAnnotation(1)}(name{MyAnnotation(1)}=Alex,age{MyAnnotation(2)}=10,likesNuts{MyAnnotation(3)}=true,likesVeggies{MyAnnotation(4)}=true)"
38
+ " {MyTypeAnnotation(1)}Hamster{MyTypeAnnotation(1)}(name{[i] MyAnnotation(1)}=Alex,age{MyAnnotation(6),[i]MyAnnotation( 2)}=10,likesNuts{[i] MyAnnotation(3)}=true,likesVeggies{MyAnnotation(4)}=true)"
39
39
)
40
40
}
41
41
42
42
test(" inherit annotations from base class constructor parameters" ) {
43
43
val res = Show .derived[Foo ].show(Foo (" foo" ))
44
- assertEquals(res, " Foo(foo{MyAnnotation(2),MyAnnotation(1)}=foo)" )
44
+ assertEquals(res, " Foo(foo{MyAnnotation(2),[i] MyAnnotation(1)}=foo)" )
45
45
}
46
46
47
47
test(
@@ -50,7 +50,7 @@ class AnnotationsTests extends munit.FunSuite:
50
50
val res = Show .derived[Bar ].show(Bar (" foo" , " bar" ))
51
51
assertEquals(
52
52
res,
53
- " Bar(foo{MyAnnotation(2),MyAnnotation(1)}=foo,bar{MyAnnotation(2),MyAnnotation(1)}=bar)"
53
+ " Bar(foo{MyAnnotation(2),[i] MyAnnotation(1)}=foo,bar{MyAnnotation(2),[i] MyAnnotation(1)}=bar)"
54
54
)
55
55
}
56
56
@@ -156,6 +156,7 @@ object AnnotationsTests:
156
156
157
157
case class Hamster (
158
158
name : String ,
159
+ @ MyAnnotation (6 )
159
160
age : Int ,
160
161
likesNuts : Boolean ,
161
162
@ MyAnnotation (4 ) likesVeggies : Boolean
0 commit comments