modelize_property: Remove an unreachable case
authorJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Wed, 14 Jun 2017 03:48:23 +0000 (23:48 -0400)
committerJean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Wed, 14 Jun 2017 21:15:38 +0000 (17:15 -0400)
Exploit the De Morgan’s law.

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

src/modelize/modelize_property.nit

index bdcbbe4..e805d4e 100644 (file)
@@ -775,17 +775,15 @@ redef class AMethPropdef
                var amethodid = self.n_methid
                var name_node: ANode
                if amethodid == null then
-                       if not is_init then
-                               name = "main"
-                               name_node = self
-                       else if n_kwinit != null then
+                       if n_kwinit != null then
                                name = "init"
                                name_node = n_kwinit
                        else if n_kwnew != null then
                                name = "new"
                                name_node = n_kwnew
                        else
-                               abort
+                               name = "main"
+                               name_node = self
                        end
                else if amethodid isa AIdMethid then
                        name = amethodid.n_id.text