mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
Refactor metaclass logic a bit, ensure lambdas are excluded
This commit is contained in:
@@ -141,3 +141,10 @@ class SpecialMethodNames(object):
|
||||
|
||||
def __class_getitem__(cls):
|
||||
pass
|
||||
|
||||
from dataclasses import dataclass, field
|
||||
|
||||
@dataclass
|
||||
class A:
|
||||
# Lambdas used in initilisation aren't methods.
|
||||
x: int = field(default_factory = lambda: 2)
|
||||
@@ -14,7 +14,7 @@ module MethodArgTest implements TestSig {
|
||||
firstArgShouldBeNamedSelfAndIsnt(f) and
|
||||
tag = "shouldBeSelf"
|
||||
or
|
||||
firstArgShouldBeNamedClsAndIsnt(f) and
|
||||
firstArgShouldReferToClsAndDoesnt(f) and
|
||||
tag = "shouldBeCls"
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user