See create_attribute_from_property
for more information.
# Creation of a new attribute (AST and model representation) with the given name.
# See `create_attribute_from_property` for more information.
fun create_attribute_from_name(name: String, mclassdef: MClassDef, mtype: MType, visibility: nullable MVisibility): AAttrPropdef do
if visibility == null then visibility = public_visibility
var mattribute = try_get_mproperty_by_name(null, mclassdef, name)
if mattribute == null then mattribute = new MAttribute(mclassdef, name, mclassdef.location, visibility)
return create_attribute_from_property(mattribute.as(MAttribute), mclassdef, mtype)
end
src/astbuilder.nit:1086,2--1093,4