Summary
Multi-output submodel calls ((a, b) ~ sub(x = x)) must have the number of LHS outputs
equal to the number of missing (un-named) interfaces. When they differ, the path falls
through to MethodError: no method matching make_node!(...) with no indication of the real
problem. The single-output path already validates this and raises a clear error
(src/graph_engine.jl:1858-1873); the multi-output path (1875-1886) does not.
Root cause
prepare_interfaces_multi (src/graph_engine.jl:1881-1886) builds a NamedTuple from
missing interfaces + LHS, without checking length(missing) == length(lhs). A mismatch
leaks a MethodError.
Repro / existing test
test/multi_and_zero_output_tests.jl:76 currently pins the confusing behaviour:
@test_throws "no method matching make_node!" create_model(main_mismatch()) do model, ctx ... end
Suggested fix
Add an explicit check in prepare_interfaces (Tuple-LHS) with a clear message:
if length(missing) != n_lhs
error("Submodel '$fform' expects $(length(missing)) output interface(s) but $(n_lhs) were provided on the LHS.")
end
Update the test to assert the readable message.
Summary
Multi-output submodel calls (
(a, b) ~ sub(x = x)) must have the number of LHS outputsequal to the number of missing (un-named) interfaces. When they differ, the path falls
through to
MethodError: no method matching make_node!(...)with no indication of the realproblem. The single-output path already validates this and raises a clear error
(
src/graph_engine.jl:1858-1873); the multi-output path (1875-1886) does not.Root cause
prepare_interfaces_multi(src/graph_engine.jl:1881-1886) builds aNamedTuplefrommissinginterfaces + LHS, without checkinglength(missing) == length(lhs). A mismatchleaks a
MethodError.Repro / existing test
test/multi_and_zero_output_tests.jl:76currently pins the confusing behaviour:Suggested fix
Add an explicit check in
prepare_interfaces(Tuple-LHS) with a clear message:Update the test to assert the readable message.