From: Jean Privat Date: Wed, 16 Apr 2014 20:15:52 +0000 (-0400) Subject: typing: remove `raw_arguments` as a cache X-Git-Tag: v0.6.6~101^2~2 X-Git-Url: http://nitlanguage.org typing: remove `raw_arguments` as a cache Because of transform and other potential optimization using astbuilder, the typing phase cannot stores the raw_arguments and expect it is still valid after subsequent phases. The simplest way is to make `raw_arguments` a method that recollect the correct nodes. Alternative using some kind of cache invalidation seems to complex for not a real gain. Signed-off-by: Jean Privat --- diff --git a/src/astbuilder.nit b/src/astbuilder.nit index 96948ea..d55d51c 100644 --- a/src/astbuilder.nit +++ b/src/astbuilder.nit @@ -248,7 +248,6 @@ redef class ACallExpr do self._n_expr = recv recv.parent = self - self.raw_arguments = args or else new Array[AExpr] _n_args = new AListExprs _n_id = new TId if args != null then diff --git a/src/typing.nit b/src/typing.nit index fbd3f36..9cae36f 100644 --- a/src/typing.nit +++ b/src/typing.nit @@ -1221,7 +1221,6 @@ redef class ASendExpr var msignature = callsite.msignature var args = compute_raw_arguments - self.raw_arguments = args callsite.check_signature(v, args) @@ -1245,7 +1244,7 @@ redef class ASendExpr private fun property_name: String is abstract # An array of all arguments (excluding self) - var raw_arguments: nullable Array[AExpr] + fun raw_arguments: Array[AExpr] do return compute_raw_arguments private fun compute_raw_arguments: Array[AExpr] is abstract end @@ -1382,7 +1381,6 @@ redef class ASendReassignFormExpr self.callsite = callsite var args = compute_raw_arguments - self.raw_arguments = args callsite.check_signature(v, args)