Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,23 @@ module ModelValidation {
)
}

string getIncorrectConstructorSummaryOutput() {
exists(string namespace, string type, string name, string output |
summaryModel(namespace, type, _, name, _, _, _, output, _, _, _) and
type = name and
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work for generics. As opposed to Java, C# doesn't used "erased" types in MaD. This means that a type could be C<T1,T2>, but the constructor name is only C. For types you need to remove everything after (and including) the first < in type before comparing to name.

Copy link
Copy Markdown
Contributor Author

@owen-mc owen-mc Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! I've added a commit to address this (in a different way than you suggested, which shows that I didn't even read your whole comment 😬 ). Again, I tested it by modifying an existing model (a constructor of a generic type this time) to have the problem and checking that it was found by the test.

output.matches("ReturnValue%") and
result =
"Constructor model for " + namespace + "." + type +
" should use `Argument[this]` in the output, not `ReturnValue`."
)
}

/** Holds if some row in a MaD flow model appears to contain typos. */
query predicate invalidModelRow(string msg) {
msg =
[
getInvalidModelSignature(), getInvalidModelInput(), getInvalidModelOutput(),
KindVal::getInvalidModelKind()
getIncorrectConstructorSummaryOutput(), KindVal::getInvalidModelKind()
Comment on lines 255 to +260
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The doc comment for invalidModelRow says it detects rows that "appear to contain typos", but this predicate now also reports semantic validation issues (for example, incorrect constructor summary outputs and invalid kind values). Please update the comment to reflect the broader scope (e.g., invalid/suspicious model rows) so it stays accurate.

Copilot uses AI. Check for mistakes.
]
}
}
Expand Down