From 7d46fcb17542a149556fa101090e6d2bbc2adb93 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Wed, 16 Apr 2014 16:15:52 -0400 Subject: [PATCH] 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 --- src/astbuilder.nit | 1 - src/typing.nit | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) 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) -- 1.7.9.5