Add support for class Foo = Bar;

This commit is contained in:
Taus
2021-05-27 13:08:30 +00:00
committed by GitHub
parent 59c4e170a8
commit 359b7d6b39

View File

@@ -212,6 +212,8 @@ class Type extends TType, AstNode {
result = super.getParent()
or
result.(InlineCast).getType() = this
or
result.(Class).getAliasType() = this
}
}
@@ -317,6 +319,11 @@ class Class extends TClass, AstNode, ModuleMember {
* That is: a type after the `extends` keyword.
*/
Type getASuperType() { toGenerated(result) = cls.getChild(_) }
/** Gets the type that this class is defined to be an alias of. */
Type getAliasType() {
toGenerated(result) = cls.getChild(_).(Generated::TypeAliasBody).getChild()
}
}
/**