mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
19 lines
490 B
Plaintext
19 lines
490 B
Plaintext
/**
|
|
* @name Test for anonymous object creations
|
|
*/
|
|
|
|
import csharp
|
|
|
|
from
|
|
Assignment assign, AnonymousObjectCreation o, Assignment a, AnonymousObjectCreation p,
|
|
Assignment b
|
|
where
|
|
assign.getLValue().(VariableAccess).getTarget().hasName("contacts2") and
|
|
o.getParent+() = assign and
|
|
o.getInitializer().getMemberInitializer(1) = a and
|
|
p.getParent+() = assign and
|
|
p.getInitializer().getMemberInitializer(1) = b and
|
|
o != p and
|
|
o.getObjectType() = p.getObjectType()
|
|
select o, p
|