File tree Expand file tree Collapse file tree
swift/ql/lib/codeql/swift/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -431,16 +431,19 @@ private Element interpretElement0(
431431 matchesSignature ( method , signature ) and
432432 result = method
433433 |
434+ // member declared in the named type or a subtype of it (or an extension of any)
434435 subtypes = true and
435436 declWithMethod .getNominalTypeDecl ( ) = namedTypeDecl .getADerivedTypeDecl * ( )
436437 or
438+ // member declared in a type that's extended with a protocol that is the named type
437439 exists ( ExtensionDecl e |
438440 e .getExtendedTypeDecl ( ) .getADerivedTypeDecl * ( ) = declWithMethod .getNominalTypeDecl ( )
439441 |
440442 subtypes = true and
441443 e .getAProtocol ( ) = namedTypeDecl .getADerivedTypeDecl * ( )
442444 )
443445 or
446+ // member declared directly in the named type (or an extension of it)
444447 subtypes = false and
445448 declWithMethod .getNominalTypeDecl ( ) = namedTypeDecl
446449 )
@@ -453,16 +456,19 @@ private Element interpretElement0(
453456 namedTypeDecl .getFullName ( ) = type and
454457 result = field
455458 |
459+ // field declared in the named type or a subtype of it (or an extension of any)
456460 subtypes = true and
457461 declWithField .getNominalTypeDecl ( ) = namedTypeDecl .getADerivedTypeDecl * ( )
458462 or
463+ // field declared in a type that's extended with a protocol that is the named type
459464 exists ( ExtensionDecl e |
460465 e .getExtendedTypeDecl ( ) .getADerivedTypeDecl * ( ) = declWithField .getNominalTypeDecl ( )
461466 |
462467 subtypes = true and
463468 e .getAProtocol ( ) = namedTypeDecl .getADerivedTypeDecl * ( )
464469 )
465470 or
471+ // field declared directly in the named type (or an extension of it)
466472 subtypes = false and
467473 declWithField .getNominalTypeDecl ( ) = namedTypeDecl
468474 )
You can’t perform that action at this time.
0 commit comments