# 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
mmodule, mclass_type, m_name )
if method == null then
- toolcontext.error(location, "Local method {m_name} not found.")
+ toolcontext.error(location, "Error: local method `{m_name}` not found.")
return
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
if mtype isa MNullableType then
- toolcontext.error(location, "Type {n_type.collect_text} is nullable and thus cannot be the receiver." )
+ toolcontext.error(location, "Error: type `{n_type.collect_text}` is nullable and thus cannot be the receiver." )
return
end
mmodule, mtype, m_name )
if method == null then
- toolcontext.error(location, "Method {m_name} not found in {n_type.collect_text}." )
+ toolcontext.error(location, "Error: method `{m_name}` not found in `{n_type.collect_text}`." )
return
end
if mtype == null then return
if not mtype isa MClassType then
- toolcontext.error(location, "Type {n_type.collect_text} is not a class and thus cannot be used to instanciate a new instance." )
+ toolcontext.error(location, "Error: type `{n_type.collect_text}` is not a class and thus cannot be used to instantiate a new instance." )
return
end
end
if meth == null then
- toolcontext.error(location, "Method {meth_name} not found in {n_type.collect_text}." )
+ toolcontext.error(location, "Error: 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