From: Jean-Christophe Beaupré Date: Fri, 2 Jun 2017 01:19:04 +0000 (-0400) Subject: typing: Make `TypeVisitor::anchor` non-nullable X-Git-Url: http://nitlanguage.org typing: Make `TypeVisitor::anchor` non-nullable Signed-off-by: Jean-Christophe Beaupré --- 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