# return type
var rmt = mpropdef.msignature.return_mtype
if rmt != null then
- if rmt isa MParameterType or rmt isa MVirtualType then
+ if rmt isa MFormalType then
var mclass_type = mpropdef.mclassdef.bound_mtype
rmt = rmt.anchor_to(mmodule, mclass_type)
end
# params
for p in mpropdef.msignature.mparameters do
var mtype = p.mtype.resolve_for(recv_type, recv_type, mmodule, true)
- if mtype isa MParameterType or mtype isa MVirtualType then
+ if mtype isa MFormalType then
var mclass_type = mpropdef.mclassdef.bound_mtype
mtype = mtype.anchor_to(mmodule, mclass_type)
end
if mtype == null then return
- if mtype isa MParameterType or mtype isa MVirtualType then
+ if mtype isa MFormalType then
mtype = mtype.anchor_to(mmodule, mclass_type)
end
return
end
- var meth_name = "init"
+ var meth_name = "new"
var meth = toolcontext.modelbuilder.try_get_mproperty_by_name2( self,
mmodule, mtype, meth_name )
if meth == null then
+ meth_name = "init"
+ meth = toolcontext.modelbuilder.try_get_mproperty_by_name2( self,
+ mmodule, mtype, meth_name )
+ end
+
+ if meth == null then
toolcontext.error(location, "Method {meth_name} not found in {n_type.collect_text}." )
return
end
redef fun from_mtype do return n_type.mtype.as_nullable
redef fun to_mtype do
var mtype = n_type.mtype.as(not null)
- mtype = mtype.as_notnullable
+ mtype = mtype.undecorate
return mtype
end