feat(checker): add unsupported parameter flag

This commit is contained in:
2026-07-07 11:24:23 +02:00
parent 5051e155c0
commit f48ebd49d1
2 changed files with 11 additions and 1 deletions

View File

@@ -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(

View File

@@ -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)