ensure that the existence of non-synthetic constructor is checked correctly

This commit is contained in:
Erik Krogh Kristensen
2019-10-02 14:49:33 +02:00
parent a66e33ea5e
commit 22aac8e723

View File

@@ -37,7 +37,10 @@ where
( // Assume that a "new" method is intentional if the class has an explicit constructor.
name = "new" and
container instanceof ClassDefinition and
not container.getMember("constructor").(ConstructorDeclaration).isSynthetic()
exists(ConstructorDeclaration constructor |
container.getMember("constructor") = constructor and
not constructor.isSynthetic()
)
)
or
( // Explicitly declared static methods are fine.