nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
jwrapper: accept interfaces
[nit.git]
/
src
/
astbuilder.nit
diff --git
a/src/astbuilder.nit
b/src/astbuilder.nit
index
fd2e22e
..
8aa0295
100644
(file)
--- a/
src/astbuilder.nit
+++ b/
src/astbuilder.nit
@@
-134,11
+134,13
@@
redef class AExpr
# To create the new node `n`, we need to attach the child to it.
# But, to put `n` where `c` was in `p`, the place has to be remembered.
#
# To create the new node `n`, we need to attach the child to it.
# But, to put `n` where `c` was in `p`, the place has to be remembered.
#
- # var p: AExpr
- # var c = p.c
- # var h = c.detach_with_placeholder
- # var n = astbuilder.make_XXX(c)
- # h.replace_with(n)
+ # ~~~nitish
+ # var p: AExpr
+ # var c = p.c
+ # var h = c.detach_with_placeholder
+ # var n = astbuilder.make_XXX(c)
+ # h.replace_with(n)
+ # ~~~
fun detach_with_placeholder: AExpr
do
var h = new APlaceholderExpr.make
fun detach_with_placeholder: AExpr
do
var h = new APlaceholderExpr.make
@@
-275,7
+277,12
@@
redef class ANewExpr
n_args.n_exprs.add_all(args)
end
self.callsite = callsite
n_args.n_exprs.add_all(args)
end
self.callsite = callsite
- self.mtype = callsite.recv
+ self.recvtype = callsite.recv.as(MClassType)
+ if callsite.mproperty.is_new then
+ self.mtype = callsite.msignature.return_mtype
+ else
+ self.mtype = callsite.recv
+ end
self.is_typed = true
end
end
self.is_typed = true
end
end
@@
-289,7
+296,6
@@
redef class ACallExpr
if args != null then
self.n_args.n_exprs.add_all(args)
end
if args != null then
self.n_args.n_exprs.add_all(args)
end
- var mtype = recv.mtype.as(not null)
self.callsite = callsite
self.mtype = callsite.msignature.return_mtype
self.is_typed = true
self.callsite = callsite
self.mtype = callsite.msignature.return_mtype
self.is_typed = true