-
Notifications
You must be signed in to change notification settings - Fork 451
/
Copy patherrors.kt
78 lines (69 loc) · 2.35 KB
/
errors.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package arrow.optics.plugin.internals
val String.otherClassTypeErrorMessage
get() =
"""
|$this cannot be annotated with @optics
| ^
|Only data, sealed, and value classes can be annotated with @optics
""".trimMargin()
val String.typeParametersErrorMessage
get() =
"""
|$this cannot be annotated with @optics
| ^
|Only classes with no type parameters can be annotated with @optics
""".trimMargin()
val String.lensErrorMessage
get() =
"""
|Cannot generate arrow.optics.Lens for $this
| ^
|arrow.optics.OpticsTarget.LENS is an invalid @optics argument for $this.
|It is only valid for data classes.
""".trimMargin()
val String.optionalErrorMessage
get() =
"""
|Cannot generate arrow.optics.Optional for $this
| ^
|arrow.optics.OpticsTarget.OPTIONAL is an invalid @optics argument for $this.
|It is only valid for data classes.
""".trimMargin()
val String.prismErrorMessage
get() =
"""
|Cannot generate arrow.optics.Prism for $this
| ^
|arrow.optics.OpticsTarget.PRISM is an invalid @optics argument for $this.
|It is only valid for sealed classes.
""".trimMargin()
val String.isoErrorMessage
get() =
"""
|Cannot generate arrow.optics.Iso for $this
| ^
|arrow.optics.OpticsTarget.ISO is an invalid @optics argument for $this.
|It is only valid for data and value classes.
""".trimMargin()
val String.isoTooBigErrorMessage
get() =
"""
|Cannot generate arrow.optics.Iso for $this
| ^
|Iso generation is supported for data classes with up to 22 constructor parameters.
""".trimMargin()
val String.dslErrorMessage
get() =
"""
|Cannot generate DSL (arrow.optics.BoundSetter) for $this
| ^
|arrow.optics.OpticsTarget.DSL is an invalid @optics argument for $this.
|It is only valid for data classes and sealed classes.
""".trimMargin()
val String.noCompanion
get() =
"""
|$this must declare a companion object
| ^
|A companion object is required for the generated optics
""".trimMargin()