C#: Make a store step from explicit parameter nodes on primary constructors to the property of the same name for record types.

This commit is contained in:
Michael Nebel
2024-02-19 16:40:56 +01:00
parent 132b8baa57
commit b76a27bba2

View File

@@ -2074,7 +2074,13 @@ predicate storeStep(Node node1, ContentSet c, Node node2) {
exists(Parameter p |
node1 = TExplicitParameterNode(p) and
node2 = TPrimaryConstructorThisAccessNode(p, true) and
c.(PrimaryConstructorParameterContent).getParameter() = p
exists(Type t | t = p.getCallable().getDeclaringType() |
not t instanceof RecordType and
c.(PrimaryConstructorParameterContent).getParameter() = p
or
t instanceof RecordType and
c.(PropertyContent).getProperty().getName() = p.getName()
)
)
or
FlowSummaryImpl::Private::Steps::summaryStoreStep(node1.(FlowSummaryNode).getSummaryNode(), c,