Skip to content

C#: Remove more deprecated classes and predicates#3514

Merged
calumgrant merged 1 commit intogithub:masterfrom
hvitved:csharp/remove-more-deprecated
Jun 2, 2020
Merged

C#: Remove more deprecated classes and predicates#3514
calumgrant merged 1 commit intogithub:masterfrom
hvitved:csharp/remove-more-deprecated

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented May 19, 2020

No description provided.

@hvitved hvitved added the C# label May 19, 2020
@hvitved hvitved requested a review from a team as a code owner May 19, 2020 13:40
Copy link
Contributor

@calumgrant calumgrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM. Hard to tell how long these predicates have been deprecated for just from the diff. Also, do we bother with change notes for such things?

Copy link
Contributor Author

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All removed predicates will have been deprecated at least a year when the next release is made (see comments).

import semmle.code.csharp.controlflow.ControlFlowGraph
import ControlFlow
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/** DEPRECATED: Use `getAnnotatedReturnType().isReadonlyRef()` instead. */
deprecated predicate returnsRefReadonly() { this.getAnnotatedReturnType().isReadonlyRef() }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* Gets the specific class constraint, if any.
*/
deprecated Class getClassConstraint() { result = getATypeConstraint() }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


/** Gets a type case of this `switch` statement, if any. */
deprecated TypeCase getATypeCase() { result = this.getACase() }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/
Type getCheckedType() { result = this.getTypeAccess().getType() }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

/** An `is` type expression, for example, `x is string` or `x is string s`. */
deprecated class IsTypeExpr extends IsExpr {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

/** An `is` pattern expression, for example `x is string s`. */
deprecated class IsPatternExpr extends IsExpr {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/**
* An `is` constant expression, for example `x is 5`.
*/
deprecated class IsConstantExpr extends IsExpr {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated predicate returnsRef() { this.getAnnotatedReturnType().isRef() }

/** Holds if this delegate returns a `ref readonly`. */
deprecated predicate returnsRefReadonly() { this.getAnnotatedReturnType().isReadonlyRef() }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@calumgrant calumgrant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for digging up that information @hvitved, it makes the review much easier.

@calumgrant calumgrant merged commit b099f13 into github:master Jun 2, 2020
@hvitved hvitved deleted the csharp/remove-more-deprecated branch June 2, 2020 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants