diff --git a/midas/checker/dispatcher.py b/midas/checker/dispatcher.py index fef6b04..77e1f45 100644 --- a/midas/checker/dispatcher.py +++ b/midas/checker/dispatcher.py @@ -258,6 +258,12 @@ class CallDispatcher(Generic[E]): """ valid: bool = True for arg in arguments: + if arg.parameter.unsupported: + # Always report error + self.reporter.error( + arg.arg_expr.location, f"Unsupported argument {arg.parameter.name}" + ) + if not self.types.is_subtype(arg.arg_type, arg.parameter.type): if report_errors: self.reporter.error( diff --git a/midas/checker/types.py b/midas/checker/types.py index f1b38f4..5b043bc 100644 --- a/midas/checker/types.py +++ b/midas/checker/types.py @@ -69,10 +69,14 @@ class Function: name: str type: Type required: bool + unsupported: bool = False def __str__(self) -> str: opt: str = "" if self.required else "?" - return f"{self.name}: {self.type}{opt}" + param: str = f"{self.name}: {self.type}{opt}" + if self.unsupported: + param = f"({param})" + return param @dataclass(frozen=True, kw_only=True)