feat(checker): add unsupported parameter flag
This commit is contained in:
@@ -258,6 +258,12 @@ class CallDispatcher(Generic[E]):
|
|||||||
"""
|
"""
|
||||||
valid: bool = True
|
valid: bool = True
|
||||||
for arg in arguments:
|
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 not self.types.is_subtype(arg.arg_type, arg.parameter.type):
|
||||||
if report_errors:
|
if report_errors:
|
||||||
self.reporter.error(
|
self.reporter.error(
|
||||||
|
|||||||
@@ -69,10 +69,14 @@ class Function:
|
|||||||
name: str
|
name: str
|
||||||
type: Type
|
type: Type
|
||||||
required: bool
|
required: bool
|
||||||
|
unsupported: bool = False
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
opt: str = "" if self.required else "?"
|
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)
|
@dataclass(frozen=True, kw_only=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user