Merge: modelize: `missing-doc` on attributes
authorJean Privat <jean@pryen.org>
Wed, 1 Oct 2014 21:17:06 +0000 (17:17 -0400)
committerJean Privat <jean@pryen.org>
Wed, 1 Oct 2014 21:17:06 +0000 (17:17 -0400)
missing-doc only fires on public properties.
But attributes are always Private, so consider the getter method instead.

It make sense since the documentation on an attribute documents more the
getter than the attribute.

Pull-Request: #800
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

1  2 
src/modelize/modelize_property.nit

@@@ -289,6 -289,9 +289,6 @@@ en
  
  redef class AClassdef
        var build_properties_is_done: Bool = false
 -      # The list of super-constructor to call at the start of the free constructor
 -      # FIXME: this is needed to implement the crazy constructor thing of the of old compiler. We need to think what to do with since this cannot stay in the modelbuilder
 -      var super_inits: nullable Collection[MMethod] = null
  
        # The free init (implicitely constructed by the class if required)
        var mfree_init: nullable MMethodDef = null
@@@ -775,7 -778,6 +775,6 @@@ redef class AAttrPropde
                var mpropdef = new MAttributeDef(mclassdef, mprop, self.location)
                self.mpropdef = mpropdef
                modelbuilder.mpropdef2npropdef[mpropdef] = self
-               set_doc(mpropdef, modelbuilder)
  
                var readname = name
                var mreadprop = modelbuilder.try_get_mproperty_by_name(nid2, mclassdef, readname).as(nullable MMethod)
                var mreadpropdef = new MMethodDef(mclassdef, mreadprop, self.location)
                self.mreadpropdef = mreadpropdef
                modelbuilder.mpropdef2npropdef[mreadpropdef] = self
-               mreadpropdef.mdoc = mpropdef.mdoc
+               set_doc(mreadpropdef, modelbuilder)
+               mpropdef.mdoc = mreadpropdef.mdoc
  
                var atlazy = self.get_single_annotation("lazy", modelbuilder)
                if atlazy != null then