From c96fa574dfa72b93818f74bbfa9c60a23ee53e53 Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Tue, 6 Oct 2015 16:17:18 -0400 Subject: [PATCH] typing: make `CallSite` a `MEntity` so that `is_broken` can be used Signed-off-by: Jean Privat --- src/compiler/abstract_compiler.nit | 5 +++++ src/semantize/typing.nit | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/compiler/abstract_compiler.nit b/src/compiler/abstract_compiler.nit index 3d6d939..101ff83 100644 --- a/src/compiler/abstract_compiler.nit +++ b/src/compiler/abstract_compiler.nit @@ -1147,6 +1147,7 @@ abstract class AbstractCompilerVisitor fun compile_callsite(callsite: CallSite, arguments: Array[RuntimeVariable]): nullable RuntimeVariable do + if callsite.is_broken then return null var initializers = callsite.mpropdef.initializers if not initializers.is_empty then var recv = arguments.first @@ -3650,6 +3651,7 @@ redef class ASendExpr do var recv = v.expr(self.n_expr, null) var callsite = self.callsite.as(not null) + if callsite.is_broken then return null var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, self.raw_arguments) return v.compile_callsite(callsite, args) end @@ -3660,6 +3662,7 @@ redef class ASendReassignFormExpr do var recv = v.expr(self.n_expr, null) var callsite = self.callsite.as(not null) + if callsite.is_broken then return var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, self.raw_arguments) var value = v.expr(self.n_value, null) @@ -3682,6 +3685,7 @@ redef class ASuperExpr var callsite = self.callsite if callsite != null then + if callsite.is_broken then return null var args if self.n_args.n_exprs.is_empty then @@ -3731,6 +3735,7 @@ redef class ANewExpr var callsite = self.callsite if callsite == null then return recv + if callsite.is_broken then return null var args = v.varargize(callsite.mpropdef, callsite.signaturemap, recv, self.n_args.n_exprs) var res2 = v.compile_callsite(callsite, args) diff --git a/src/semantize/typing.nit b/src/semantize/typing.nit index 27c5cab..66b47db 100644 --- a/src/semantize/typing.nit +++ b/src/semantize/typing.nit @@ -621,6 +621,8 @@ end # A specific method call site with its associated informations. class CallSite + super MEntity + # The associated node for location var node: ANode @@ -659,6 +661,7 @@ class CallSite do var map = v.check_signature(self.node, args, self.mproperty, self.msignature) signaturemap = map + if map == null then is_broken = true return map == null end end -- 1.7.9.5