model: Document base cases of `mdoc_or_fallback`
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Mon, 22 Aug 2016 20:36:19 +0000 (16:36 -0400)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Wed, 22 Mar 2017 18:57:10 +0000 (14:57 -0400)
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/model/model.nit

index bf3856a..cfb5778 100644 (file)
@@ -566,7 +566,12 @@ class MClass
        # Is `self` and abstract class?
        var is_abstract: Bool is lazy do return kind == abstract_kind
 
-       redef fun mdoc_or_fallback do return intro.mdoc
+       redef fun mdoc_or_fallback
+       do
+               # Don’t use `intro.mdoc_or_fallback` because it would create an infinite
+               # recursion.
+               return intro.mdoc
+       end
 end
 
 
@@ -2054,7 +2059,12 @@ abstract class MProperty
 
        redef var location
 
-       redef fun mdoc_or_fallback do return intro.mdoc
+       redef fun mdoc_or_fallback
+       do
+               # Don’t use `intro.mdoc_or_fallback` because it would create an infinite
+               # recursion.
+               return intro.mdoc
+       end
 
        # The canonical name of the property.
        #