mirror of
https://github.com/irmen/prog8.git
synced 2024-09-07 03:54:27 +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…
Reference in New Issue
Block a user