mirror of
https://github.com/github/codeql.git
synced 2026-02-08 19:21:07 +01:00
Support class unions
This commit is contained in:
@@ -218,6 +218,8 @@ class Type extends TType, AstNode {
|
||||
result.(InlineCast).getType() = this
|
||||
or
|
||||
result.(Class).getAliasType() = this
|
||||
or
|
||||
result.(Class).getUnionMember() = this
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,6 +330,11 @@ class Class extends TClass, AstNode, ModuleMember {
|
||||
Type getAliasType() {
|
||||
toGenerated(result) = cls.getChild(_).(Generated::TypeAliasBody).getChild()
|
||||
}
|
||||
|
||||
/** Gets the type of one of the members that this class is defined to be a union of. */
|
||||
Type getUnionMember() {
|
||||
toGenerated(result) = cls.getChild(_).(Generated::TypeUnionBody).getChild(_)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user