feat(checker): add unsupported parameter flag
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user