From 5bf0d5bd5ea04fa3e9d9474503a438220c21c5fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Christophe=20Beaupr=C3=A9?= Date: Thu, 1 Jun 2017 21:19:04 -0400 Subject: [PATCH] typing: Make `TypeVisitor::anchor` non-nullable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jean-Christophe Beaupré --- src/metrics/detect_covariance.nit | 1 - src/semantize/typing.nit | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/metrics/detect_covariance.nit b/src/metrics/detect_covariance.nit index 25463ad..643679a 100644 --- a/src/metrics/detect_covariance.nit +++ b/src/metrics/detect_covariance.nit @@ -350,7 +350,6 @@ redef class TypeVisitor if dcp.is_disabled then return res var anchor = self.anchor - assert anchor != null var supx = sup var subx = sub var p = node.parent.as(not null) diff --git a/src/semantize/typing.nit b/src/semantize/typing.nit index 41b5eeb..1555050 100644 --- a/src/semantize/typing.nit +++ b/src/semantize/typing.nit @@ -40,7 +40,7 @@ private class TypeVisitor # The static type of the receiver # Mainly used for type tests and type resolutions - var anchor: nullable MClassType = null + var anchor: MClassType is noinit # The analyzed mclassdef var mclassdef: MClassDef is noinit @@ -2138,7 +2138,6 @@ redef class ASuperExpr redef fun accept_typing(v) do var anchor = v.anchor - assert anchor != null var recvtype = v.get_variable(self, v.selfvariable) assert recvtype != null var mproperty = v.mpropdef.mproperty @@ -2177,7 +2176,6 @@ redef class ASuperExpr private fun process_superinit(v: TypeVisitor) do var anchor = v.anchor - assert anchor != null var recvtype = v.get_variable(self, v.selfvariable) assert recvtype != null var mpropdef = v.mpropdef -- 1.7.9.5