abstract_compiler: can inline methods with `constant_value` (defined with -D)
authorJean Privat <jean@pryen.org>
Wed, 28 Oct 2015 19:58:56 +0000 (15:58 -0400)
committerJean Privat <jean@pryen.org>
Wed, 28 Oct 2015 19:58:56 +0000 (15:58 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/abstract_compiler.nit

index c6cdb26..9584179 100644 (file)
@@ -2022,6 +2022,7 @@ redef class MMethodDef
        fun can_inline(v: VISITOR): Bool
        do
                if is_abstract then return true
+               if constant_value != null then return true
                var modelbuilder = v.compiler.modelbuilder
                var node = modelbuilder.mpropdef2node(self)
                if node isa APropdef then