nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
98620e2
)
typing: on type error, also indicate the resolved type
author
Jean Privat
<jean@pryen.org>
Sat, 4 Apr 2015 15:36:53 +0000
(22:36 +0700)
committer
Jean Privat
<jean@pryen.org>
Wed, 8 Apr 2015 00:52:01 +0000
(07:52 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>
src/semantize/typing.nit
patch
|
blob
|
history
diff --git
a/src/semantize/typing.nit
b/src/semantize/typing.nit
index
a1f1220
..
0634ee2
100644
(file)
--- a/
src/semantize/typing.nit
+++ b/
src/semantize/typing.nit
@@
-115,7
+115,12
@@
private class TypeVisitor
#node.debug("Unsafe typing: expected {sup}, got {sub}")
return sup
end
- self.modelbuilder.error(node, "Type error: expected {sup}, got {sub}")
+ if sub.need_anchor then
+ var u = anchor_to(sub)
+ self.modelbuilder.error(node, "Type error: expected {sup}, got {sub}: {u}")
+ else
+ self.modelbuilder.error(node, "Type error: expected {sup}, got {sub}")
+ end
return null
end