Merge pull request #11308 from tamasvajk/kotlin-non-serializable-field

Kotlin: Exclude .kt files from non serializable field query
This commit is contained in:
Chris Smowton
2022-11-17 10:10:05 +00:00
committed by GitHub
4 changed files with 6 additions and 1 deletions

View File

@@ -90,7 +90,7 @@ predicate exceptions(Class c, Field f) {
from Class c, Field f, string reason from Class c, Field f, string reason
where where
c.fromSource() and c.getFile().isJavaSourceFile() and
c.getAStrictAncestor() instanceof TypeSerializable and c.getAStrictAncestor() instanceof TypeSerializable and
f.getDeclaringType() = c and f.getDeclaringType() = c and
not exceptions(c, f) and not exceptions(c, f) and

View File

@@ -0,0 +1 @@
Likely Bugs/Serialization/NonSerializableField.ql

View File

@@ -0,0 +1,4 @@
class Foo {
fun f(i: Int) {}
fun g(i: Int) { (this::f)(i) }
}