Skip to content

Commit c0f477e

Browse files
committed
Swift: reorder generic type param children in nominal types
1 parent 66e6c7b commit c0f477e

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

swift/codegen/schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ ExtensionDecl:
7272

7373
NominalTypeDecl:
7474
_extends:
75-
- IterableDeclContext
7675
- GenericTypeDecl
76+
- IterableDeclContext
7777
type: Type
7878

7979
AstNode:

swift/ql/lib/codeql/swift/generated/ParentChild.qll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4650,21 +4650,21 @@ private module Impl {
46504650
private Element getImmediateChildOfNominalTypeDecl(
46514651
NominalTypeDecl e, int index, string partialPredicateCall
46524652
) {
4653-
exists(int b, int bIterableDeclContext, int bGenericTypeDecl, int n |
4653+
exists(int b, int bGenericTypeDecl, int bIterableDeclContext, int n |
46544654
b = 0 and
4655-
bIterableDeclContext =
4656-
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfIterableDeclContext(e, i, _)) | i) and
46574655
bGenericTypeDecl =
4658-
bIterableDeclContext + 1 +
4659-
max(int i | i = -1 or exists(getImmediateChildOfGenericTypeDecl(e, i, _)) | i) and
4660-
n = bGenericTypeDecl and
4656+
b + 1 + max(int i | i = -1 or exists(getImmediateChildOfGenericTypeDecl(e, i, _)) | i) and
4657+
bIterableDeclContext =
4658+
bGenericTypeDecl + 1 +
4659+
max(int i | i = -1 or exists(getImmediateChildOfIterableDeclContext(e, i, _)) | i) and
4660+
n = bIterableDeclContext and
46614661
(
46624662
none()
46634663
or
4664-
result = getImmediateChildOfIterableDeclContext(e, index - b, partialPredicateCall)
4664+
result = getImmediateChildOfGenericTypeDecl(e, index - b, partialPredicateCall)
46654665
or
46664666
result =
4667-
getImmediateChildOfGenericTypeDecl(e, index - bIterableDeclContext, partialPredicateCall)
4667+
getImmediateChildOfIterableDeclContext(e, index - bGenericTypeDecl, partialPredicateCall)
46684668
)
46694669
)
46704670
}

swift/ql/lib/codeql/swift/generated/Raw.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ module Raw {
14801480
string getStringValue() { integer_literal_exprs(this, result) }
14811481
}
14821482

1483-
class NominalTypeDecl extends @nominal_type_decl, IterableDeclContext, GenericTypeDecl {
1483+
class NominalTypeDecl extends @nominal_type_decl, GenericTypeDecl, IterableDeclContext {
14841484
Type getType() { nominal_type_decls(this, result) }
14851485
}
14861486

swift/ql/lib/codeql/swift/generated/decl/NominalTypeDecl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import codeql.swift.elements.decl.GenericTypeDecl
55
import codeql.swift.elements.decl.IterableDeclContext
66
import codeql.swift.elements.type.Type
77

8-
class NominalTypeDeclBase extends Synth::TNominalTypeDecl, IterableDeclContext, GenericTypeDecl {
8+
class NominalTypeDeclBase extends Synth::TNominalTypeDecl, GenericTypeDecl, IterableDeclContext {
99
Type getImmediateType() {
1010
result =
1111
Synth::convertTypeFromRaw(Synth::convertNominalTypeDeclToRaw(this)

0 commit comments

Comments
 (0)