fun anchor_to(mtype: MType): MType
do
- var anchor = anchor
- if anchor == null then
- assert not mtype.need_anchor
- return mtype
- end
return mtype.anchor_to(mmodule, anchor)
end
return mtypes.first
else
var res = merge_types(node,mtypes)
- if res == null then res = variable.declared_type
+ if res == null then
+ res = variable.declared_type
+ # Try to fallback to a non-null version
+ if res != null and can_be_null(res) then do
+ for t in mtypes do
+ if t != null and can_be_null(t) then break label
+ end
+ res = res.as_notnull
+ end label
+ end
return res
end
end
fun dump_info(v: ASTDump): String do
return "{recv}.{mpropdef}{msignature}"
end
+
+ redef fun mdoc_or_fallback do return mproperty.intro.mdoc
end
redef class Variable