From beaf8e3bf50e320afacb97c6ec459b6bb0ff4917 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Christophe=20Beaupr=C3=A9?= Date: Thu, 1 Jun 2017 17:37:14 -0400 Subject: [PATCH] typing: Make `TypeVisitor::mmodule` implicit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-Christophe Beaupré --- src/semantize/typing.nit | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/semantize/typing.nit b/src/semantize/typing.nit index 1555050..37a1494 100644 --- a/src/semantize/typing.nit +++ b/src/semantize/typing.nit @@ -36,7 +36,7 @@ private class TypeVisitor # The module of the analysis # Used to correctly query the model - var mmodule: MModule + var mmodule: MModule is noinit # The static type of the receiver # Mainly used for type tests and type resolutions @@ -60,6 +60,7 @@ private class TypeVisitor do var mpropdef = self.mpropdef var mclassdef = mpropdef.mclassdef + mmodule = mclassdef.mmodule self.mclassdef = mclassdef self.anchor = mclassdef.bound_mtype @@ -860,7 +861,7 @@ redef class AMethPropdef var mpropdef = self.mpropdef if mpropdef == null then return # skip error - var v = new TypeVisitor(modelbuilder, mpropdef.mclassdef.mmodule, mpropdef) + var v = new TypeVisitor(modelbuilder, mpropdef) self.selfvariable = v.selfvariable var mmethoddef = self.mpropdef.as(not null) @@ -927,7 +928,7 @@ redef class AAttrPropdef var mpropdef = self.mreadpropdef if mpropdef == null or mpropdef.msignature == null then return # skip error - var v = new TypeVisitor(modelbuilder, mpropdef.mclassdef.mmodule, mpropdef) + var v = new TypeVisitor(modelbuilder, mpropdef) self.selfvariable = v.selfvariable var nexpr = self.n_expr -- 1.7.9.5