fixes #4084
This commit is contained in:
parent
c870e831c8
commit
e04f319540
4 changed files with 38 additions and 10 deletions
|
|
@ -1505,3 +1505,12 @@ proc skipHiddenSubConv*(n: PNode): PNode =
|
|||
result.typ = dest
|
||||
else:
|
||||
result = n
|
||||
|
||||
proc typeMismatch*(n: PNode, formal, actual: PType) =
|
||||
if formal.kind != tyError and actual.kind != tyError:
|
||||
let named = typeToString(formal)
|
||||
let desc = typeToString(formal, preferDesc)
|
||||
let x = if named == desc: named else: named & " = " & desc
|
||||
localError(n.info, errGenerated, msgKindToString(errTypeMismatch) &
|
||||
typeToString(actual) & ") " &
|
||||
`%`(msgKindToString(errButExpectedX), [x]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue