Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call serialisation schema is broken #941

Closed
mark-koch opened this issue Apr 16, 2024 · 1 comment
Closed

Call serialisation schema is broken #941

mark-koch opened this issue Apr 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mark-koch
Copy link
Contributor

Following #906, the Call op is now defined as

pub struct Call {
/// Signature of function being called
func_sig: PolyFuncType,
type_args: Vec<TypeArg>,
instantiation: FunctionType, // Cache, so we can fail in try_new() not in signature()
}

However, the corresponding pydantic model doesn't match up:

class Call(DataflowOp):
"""
Call a function directly.
The first port is connected to the def/declare of the function being called
directly, with a `ConstE<Graph>` edge. The signature of the remaining ports matches
the function being called.
"""
op: Literal["Call"] = "Call"
signature: FunctionType = Field(default_factory=FunctionType.empty)
def insert_port_types(self, in_types: TypeRow, out_types: TypeRow) -> None:
# The constE edge comes after the value inputs
fun_ty = in_types[-1]
assert isinstance(fun_ty, PolyFuncType)
poly_func = cast(PolyFuncType, fun_ty)
assert len(poly_func.params) == 0
self.signature = poly_func.body

Also, the assert isinstance(fun_ty, PolyFuncType) will always fail since fun_ty is a Type, which can never contain a PolyFuncType.

@mark-koch mark-koch added the bug Something isn't working label Apr 16, 2024
@mark-koch mark-koch changed the title Call serialisation is broken Call serialisation schema is broken Apr 17, 2024
@mark-koch
Copy link
Contributor Author

Fixed by #982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant