C#: Add Ql docs to synthetic fields.

This commit is contained in:
Michael Nebel
2021-12-09 10:34:31 +01:00
parent 9f4b965202
commit 13347cd102
2 changed files with 4 additions and 0 deletions

View File

@@ -2040,9 +2040,11 @@ predicate allowParameterReturnInSelf(ParameterNode p) {
FlowSummaryImpl::Private::summaryAllowParameterReturnInSelf(p)
}
/** A synthetic field. */
abstract class SyntheticField extends string {
bindingset[this]
SyntheticField() { any() }
/** Gets the type of this synthetic field. */
Type getType() { result instanceof ObjectType }
}

View File

@@ -224,11 +224,13 @@ class FieldContent extends Content, TFieldContent {
deprecated override Gvn::GvnType getType() { result = Gvn::getGlobalValueNumber(f.getType()) }
}
/** A reference to a synthetic field. */
class SyntheticFieldContent extends Content, TSyntheticFieldContent {
private SyntheticField f;
SyntheticFieldContent() { this = TSyntheticFieldContent(f) }
/** Gets the underlying synthetic field. */
SyntheticField getField() { result = f }
override string toString() { result = "synthetic " + f.toString() }