Property definitions

nitc :: modelize_property $ APropdef :: check_redef_keyword
	private fun check_redef_keyword(modelbuilder: ModelBuilder, mclassdef: MClassDef, kwredef: nullable Token, need_redef: Bool, mprop: MProperty): Bool
	do
		if mclassdef.mprop2npropdef.has_key(mprop) then
			modelbuilder.error(self, "Error: a property `{mprop}` is already defined in class `{mclassdef.mclass}` at line {mclassdef.mprop2npropdef[mprop].location.line_start}.")
			return false
		end
		if mprop isa MMethod and mprop.is_root_init then return true
		if kwredef == null then
			if need_redef then
				modelbuilder.error(self, "Redef Error: `{mclassdef.mclass}::{mprop.name}` is an inherited property. To redefine it, add the `redef` keyword.")
				return false
			end

			# Check for full-name conflicts in the package.
			# A public property should have a unique qualified name `package::class::prop`.
			if mprop.intro_mclassdef.mmodule.mgroup != null and mprop.visibility >= protected_visibility then
				var others = modelbuilder.model.get_mproperties_by_name(mprop.name)
				if others != null then for other in others do
					if other != mprop and other.intro_mclassdef.mmodule.mgroup != null and other.intro_mclassdef.mmodule.mgroup.mpackage == mprop.intro_mclassdef.mmodule.mgroup.mpackage and other.intro_mclassdef.mclass.name == mprop.intro_mclassdef.mclass.name and other.visibility >= protected_visibility then
						modelbuilder.advice(self, "full-name-conflict", "Warning: A property named `{other.full_name}` is already defined in module `{other.intro_mclassdef.mmodule}` for the class `{other.intro_mclassdef.mclass.name}`.")
						break
					end
				end
			end
		else
			if not need_redef then
				modelbuilder.error(self, "Error: no property `{mclassdef.mclass}::{mprop.name}` is inherited. Remove the `redef` keyword to define a new property.")
				return false
			end
		end
		return true
	end
src/modelize/modelize_property.nit:645,2--676,4