Skip to content

Commit aec8413

Browse files
committed
PY: mention newtype constructors in API graph label classes
1 parent ef51b46 commit aec8413

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

python/ql/lib/semmle/python/ApiGraphs.qll

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ module API {
779779
MkLabelAwait()
780780

781781
/** A label for a module. */
782-
class LabelModule extends ApiLabel {
782+
class LabelModule extends ApiLabel, MkLabelModule {
783783
string mod;
784784

785785
LabelModule() { this = MkLabelModule(mod) }
@@ -791,7 +791,7 @@ module API {
791791
}
792792

793793
/** A label for the member named `prop`. */
794-
class LabelMember extends ApiLabel {
794+
class LabelMember extends ApiLabel, MkLabelMember {
795795
string member;
796796

797797
LabelMember() { this = MkLabelMember(member) }
@@ -803,14 +803,12 @@ module API {
803803
}
804804

805805
/** A label for a member with an unknown name. */
806-
class LabelUnknownMember extends ApiLabel {
807-
LabelUnknownMember() { this = MkLabelUnknownMember() }
808-
806+
class LabelUnknownMember extends ApiLabel, MkLabelUnknownMember {
809807
override string toString() { result = "getUnknownMember()" }
810808
}
811809

812810
/** A label for parameter `i`. */
813-
class LabelParameter extends ApiLabel {
811+
class LabelParameter extends ApiLabel, MkLabelParameter {
814812
int i;
815813

816814
LabelParameter() { this = MkLabelParameter(i) }
@@ -822,7 +820,7 @@ module API {
822820
}
823821

824822
/** A label for a keyword parameter `name`. */
825-
class LabelKeywordParameter extends ApiLabel {
823+
class LabelKeywordParameter extends ApiLabel, MkLabelKeywordParameter {
826824
string name;
827825

828826
LabelKeywordParameter() { this = MkLabelKeywordParameter(name) }
@@ -834,23 +832,17 @@ module API {
834832
}
835833

836834
/** A label that gets the return value of a function. */
837-
class LabelReturn extends ApiLabel {
838-
LabelReturn() { this = MkLabelReturn() }
839-
835+
class LabelReturn extends ApiLabel, MkLabelReturn {
840836
override string toString() { result = "getReturn()" }
841837
}
842838

843839
/** A label that gets the subclass of a class. */
844-
class LabelSubclass extends ApiLabel {
845-
LabelSubclass() { this = MkLabelSubclass() }
846-
840+
class LabelSubclass extends ApiLabel, MkLabelSubclass {
847841
override string toString() { result = "getASubclass()" }
848842
}
849843

850844
/** A label for awaited values. */
851-
class LabelAwait extends ApiLabel {
852-
LabelAwait() { this = MkLabelAwait() }
853-
845+
class LabelAwait extends ApiLabel, MkLabelAwait {
854846
override string toString() { result = "getAwaited()" }
855847
}
856848
}

0 commit comments

Comments
 (0)