M: Broaden substitution suggestions
Some checks failed
Backend CI / build (3.12) (push) Has been cancelled
Frontend CI / build (22.x) (push) Has been cancelled

Allow constituents with no links to other constituents
This commit is contained in:
Ivan 2024-11-15 20:45:21 +03:00
parent bc956e0af2
commit d637def7a1

View File

@ -125,11 +125,11 @@ export class SubstitutionValidator {
if (this.originals.has(cst.id)) {
continue;
}
if (cst.cst_class === CstClass.BASIC) {
if (cst.cst_class === CstClass.BASIC || cst.definition_formal.length === 0) {
continue;
}
const inputs = schema.graph.at(cst.id)!.inputs;
if (inputs.length === 0 || inputs.some(id => !this.constituents.has(id))) {
if (inputs.some(id => !this.constituents.has(id))) {
continue;
}
if (inputs.some(id => this.originals.has(id))) {