You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get lint error IncorrectNumberOfArgumentsInExpression "Incorrect number of expressions within match Expression: expected an even number, but 5 was found." in this code:
enum class Type(@ColorInt val color: Int) {
RED(Color.RED),
GREEN(Color.GREEN),
BLUE(Color.BLUE);
}
fun Expression.ExpressionBuilder.getColor(type: Type) {
stop {
literal(type.name)
color(type.color)
}
}
...
// there is IncorrectNumberOfArgumentsInExpression
lineColor(
match {
get("type")
getColor(Type.RED)
getColor(Type.GREEN)
getColor(Type.BLUE)
color(Color.BLACK)
}
)
Environment
Observed behavior and steps to reproduce
I get lint error IncorrectNumberOfArgumentsInExpression "Incorrect number of expressions within match Expression: expected an even number, but 5 was found." in this code:
This code does not have an error:
Expected behavior
No lint error IncorrectNumberOfArgumentsInExpression
Notes / preliminary analysis
Additional links and references
example code https://github.com/Copatych/MapboxBugs/blob/IncorrectNumberOfArgumentsInExpression_bug/app/src/main/java/com/example/mapboxbugs/MainActivity.kt
The text was updated successfully, but these errors were encountered: