Skip to content

Commit

Permalink
C#: Only attempt to generate models for properties that does not both…
Browse files Browse the repository at this point in the history
… have a get and a set accessor.
  • Loading branch information
michaelnebel committed Apr 4, 2024
1 parent 127bca5 commit bbf62db
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ private predicate isHigherOrder(CS::Callable api) {
)
}

private predicate irrelevantAccessor(CS::Accessor a) {
exists(CS::Property p | p = a.getDeclaration() | exists(p.getSetter()) and exists(p.getGetter()))
}

/**
* Holds if it is relevant to generate models for `api`.
*/
Expand All @@ -40,7 +44,10 @@ private predicate isRelevantForModels(CS::Callable api) {
not api.(CS::Constructor).isParameterless() and
// Disregard all APIs that have a manual model.
not api = any(FlowSummaryImpl::Public::SummarizedCallable sc | sc.applyManualModel()) and
not api = any(FlowSummaryImpl::Public::NeutralSummaryCallable sc | sc.hasManualModel())
not api = any(FlowSummaryImpl::Public::NeutralSummaryCallable sc | sc.hasManualModel()) and
// Disregard properties that have both a get and a set accessor,
// which implicitly means auto implemented properties.
not irrelevantAccessor(api)
}

/**
Expand Down

0 comments on commit bbf62db

Please sign in to comment.