CPP: Deprecate Expr.getKind() and Stmt.getKind().

This commit is contained in:
Geoffrey White
2019-06-27 16:10:39 +01:00
parent d2f8029625
commit 65bf778b3a
2 changed files with 9 additions and 5 deletions

View File

@@ -76,10 +76,10 @@ class Expr extends StmtParent, @expr {
/**
* Gets an integer indicating the type of expression that this represents.
*
* Consider using subclasses of `Expr` rather than relying on this predicate.
*
* DEPRECATED: use the subclasses of `Expr` rather than relying on this predicate.
*/
int getKind() { exprs(underlyingElement(this),result,_) }
deprecated int getKind() { exprs(underlyingElement(this),result,_) }
/** Gets a textual representation of this expression. */
override string toString() { none() }

View File

@@ -57,8 +57,12 @@ class Stmt extends StmtParent, @stmt {
override Location getLocation() { stmts(underlyingElement(this),_,result) }
/** Gets an int indicating the type of statement that this represents. */
int getKind() { stmts(underlyingElement(this),result,_) }
/**
* Gets an int indicating the type of statement that this represents.
*
* DEPRECATED: use the subclasses of `Stmt` rather than relying on this predicate.
*/
deprecated int getKind() { stmts(underlyingElement(this),result,_) }
override string toString() { none() }