mirror of
https://github.com/irmen/prog8.git
synced 2025-01-12 19:29:50 +00:00
fix error message for type mismatch on builtin-function parameter
This commit is contained in:
parent
b909facfe5
commit
84dafda0e4
@ -83,8 +83,13 @@ class VerifyFunctionArgTypes(val program: Program) : IAstVisitor {
|
|||||||
val anyCompatible = pair.second.any { argTypeCompatible(pair.first, it) }
|
val anyCompatible = pair.second.any { argTypeCompatible(pair.first, it) }
|
||||||
if (!anyCompatible) {
|
if (!anyCompatible) {
|
||||||
val actual = pair.first.toString()
|
val actual = pair.first.toString()
|
||||||
val expected = pair.second.toString()
|
return if(pair.second.size==1) {
|
||||||
return "argument ${index + 1} type mismatch, was: $actual expected: $expected"
|
val expected = pair.second[0].toString()
|
||||||
|
"argument ${index + 1} type mismatch, was: $actual expected: $expected"
|
||||||
|
} else {
|
||||||
|
val expected = pair.second.toList().toString()
|
||||||
|
"argument ${index + 1} type mismatch, was: $actual expected one of: $expected"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user