Skip to content

Commit b099f13

Browse files
authored
Merge pull request github#3514 from hvitved/csharp/remove-more-deprecated
C#: Remove more deprecated classes and predicates
2 parents e17b486 + 2519e8a commit b099f13

File tree

7 files changed

+0
-167
lines changed

7 files changed

+0
-167
lines changed

csharp/ql/src/csharp.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,5 @@ import semmle.code.csharp.dataflow.DataFlow
3535
import semmle.code.csharp.dataflow.TaintTracking
3636
import semmle.code.csharp.dataflow.SSA
3737

38-
/** DEPRECATED: Use `ControlFlow` instead. */
39-
deprecated module ControlFlowGraph {
40-
import semmle.code.csharp.controlflow.ControlFlowGraph
41-
import ControlFlow
42-
}
43-
4438
/** Whether the source was extracted without a build command. */
4539
predicate extractionIsStandalone() { exists(SourceFile f | f.extractedStandalone()) }

csharp/ql/src/semmle/code/csharp/Callable.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ class Callable extends DotNet::Callable, Parameterizable, ExprOrStmtParent, @cal
2525
/** Gets the annotated return type of this callable. */
2626
final AnnotatedType getAnnotatedReturnType() { result.appliesTo(this) }
2727

28-
/** DEPRECATED: Use `getAnnotatedReturnType().isRef()` instead. */
29-
deprecated predicate returnsRef() { this.getAnnotatedReturnType().isRef() }
30-
31-
/** DEPRECATED: Use `getAnnotatedReturnType().isReadonlyRef()` instead. */
32-
deprecated predicate returnsRefReadonly() { this.getAnnotatedReturnType().isReadonlyRef() }
33-
3428
override Callable getSourceDeclaration() { result = Parameterizable.super.getSourceDeclaration() }
3529

3630
/**

csharp/ql/src/semmle/code/csharp/Generics.qll

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -197,24 +197,6 @@ class TypeParameter extends DotNet::TypeParameter, Type, @type_parameter {
197197
* ```
198198
*/
199199
class TypeParameterConstraints extends Element, @type_parameter_constraints {
200-
/**
201-
* DEPRECATED: Use `getATypeConstraint()` instead.
202-
* Gets a specific interface constraint, if any.
203-
*/
204-
deprecated Interface getAnInterfaceConstraint() { result = getATypeConstraint() }
205-
206-
/**
207-
* DEPRECATED: Use `getATypeConstraint()` instead.
208-
* Gets a specific type parameter constraint, if any.
209-
*/
210-
deprecated TypeParameter getATypeParameterConstraint() { result = getATypeConstraint() }
211-
212-
/**
213-
* DEPRECATED: Use `getATypeConstraint()` instead.
214-
* Gets the specific class constraint, if any.
215-
*/
216-
deprecated Class getClassConstraint() { result = getATypeConstraint() }
217-
218200
/** Gets a specific type constraint, if any. */
219201
Type getATypeConstraint() { specific_type_parameter_constraints(this, getTypeRef(result)) }
220202

csharp/ql/src/semmle/code/csharp/Stmt.qll

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ class SwitchStmt extends SelectionStmt, Switch, @switch_stmt {
178178
/** Gets the default case of this `switch` statement, if any. */
179179
DefaultCase getDefaultCase() { result = this.getACase() }
180180

181-
/** Gets a type case of this `switch` statement, if any. */
182-
deprecated TypeCase getATypeCase() { result = this.getACase() }
183-
184181
override string toString() { result = "switch (...) {...}" }
185182

186183
/**
@@ -310,73 +307,6 @@ class ConstCase extends CaseStmt, LabeledStmt {
310307
override string toString() { result = CaseStmt.super.toString() }
311308
}
312309

313-
/**
314-
* A type matching case in a `switch` statement, for example `case int i:` on line 3 or
315-
* `case string s when s.Length > 0:` on line 4 in
316-
*
317-
* ```
318-
* switch(p)
319-
* {
320-
* case int i:
321-
* case string s when s.Length > 0:
322-
* break;
323-
* ...
324-
* }
325-
* ```
326-
*/
327-
deprecated class TypeCase extends CaseStmt {
328-
private TypeAccess ta;
329-
330-
TypeCase() { expr_parent(ta, 1, this) }
331-
332-
/**
333-
* Gets the local variable declaration of this type case, if any. For example,
334-
* the local variable declaration of the type case on line 3 is `string s` in
335-
*
336-
* ```
337-
* switch(p) {
338-
* case int i:
339-
* case string s when s.Length>0:
340-
* break;
341-
* case bool _:
342-
* break;
343-
* ...
344-
* }
345-
* ```
346-
*/
347-
LocalVariableDeclExpr getVariableDeclExpr() { result = this.getPattern() }
348-
349-
/**
350-
* Gets the type access of this case, for example access to `string` or
351-
* access to `int` in
352-
*
353-
* ```
354-
* switch(p) {
355-
* case int i:
356-
* case string s when s.Length>0:
357-
* break;
358-
* ...
359-
* }
360-
* ```
361-
*/
362-
TypeAccess getTypeAccess() { result = ta }
363-
364-
/**
365-
* Gets the type being checked by this case. For example, the type being checked
366-
* by the type case on line 3 is `string` in
367-
*
368-
* ```
369-
* switch(p) {
370-
* case int i:
371-
* case string s when s.Length>0:
372-
* break;
373-
* ...
374-
* }
375-
* ```
376-
*/
377-
Type getCheckedType() { result = this.getTypeAccess().getType() }
378-
}
379-
380310
/**
381311
* A default case of a `switch` statement, for example `default:` on
382312
* line 3 in

csharp/ql/src/semmle/code/csharp/Type.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -769,12 +769,6 @@ class DelegateType extends RefType, Parameterizable, @delegate_type {
769769

770770
/** Gets the annotated return type of this delegate. */
771771
AnnotatedType getAnnotatedReturnType() { result.appliesTo(this) }
772-
773-
/** Holds if this delegate returns a `ref`. */
774-
deprecated predicate returnsRef() { this.getAnnotatedReturnType().isRef() }
775-
776-
/** Holds if this delegate returns a `ref readonly`. */
777-
deprecated predicate returnsRefReadonly() { this.getAnnotatedReturnType().isReadonlyRef() }
778772
}
779773

780774
/**

csharp/ql/src/semmle/code/csharp/dataflow/flowsources/PublicCallableParameter.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/**
2-
* DEPRECATED.
3-
*
42
* Provides classes representing data flow sources for parameters of public callables.
53
*/
64

csharp/ql/src/semmle/code/csharp/exprs/Expr.qll

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -441,65 +441,6 @@ class IsExpr extends Expr, PatternMatch, @is_expr {
441441
override string toString() { result = "... is ..." }
442442
}
443443

444-
/** An `is` type expression, for example, `x is string` or `x is string s`. */
445-
deprecated class IsTypeExpr extends IsExpr {
446-
TypeAccess typeAccess;
447-
448-
IsTypeExpr() { typeAccess = this.getChild(1) }
449-
450-
/**
451-
* Gets the type being accessed in this `is` expression, for example `string`
452-
* in `x is string`.
453-
*/
454-
Type getCheckedType() { result = typeAccess.getTarget() }
455-
456-
/**
457-
* Gets the type access in this `is` expression, for example `string` in
458-
* `x is string`.
459-
*/
460-
TypeAccess getTypeAccess() { result = typeAccess }
461-
}
462-
463-
/** An `is` pattern expression, for example `x is string s`. */
464-
deprecated class IsPatternExpr extends IsExpr {
465-
LocalVariableDeclExpr typeDecl;
466-
467-
IsPatternExpr() { typeDecl = this.getChild(2) }
468-
469-
/**
470-
* Gets the local variable declaration in this `is` pattern expression.
471-
* For example `string s` in `x is string s`.
472-
*/
473-
LocalVariableDeclExpr getVariableDeclExpr() { result = typeDecl }
474-
475-
/**
476-
* Gets the type being accessed in this `is` expression, for example `string`
477-
* in `x is string`.
478-
*/
479-
Type getCheckedType() { result = getTypeAccess().getTarget() }
480-
481-
/**
482-
* Gets the type access in this `is` expression, for example `string` in
483-
* `x is string`.
484-
*/
485-
TypeAccess getTypeAccess() { result = this.getChild(1) }
486-
}
487-
488-
/**
489-
* An `is` constant expression, for example `x is 5`.
490-
*/
491-
deprecated class IsConstantExpr extends IsExpr {
492-
ConstantPatternExpr constant;
493-
494-
IsConstantExpr() { constant = this.getPattern() }
495-
496-
/** Gets the constant expression, for example `5` in `x is 5`. */
497-
Expr getConstant() { result = constant }
498-
499-
/** Gets the value of the constant, for example 5 in `x is 5`. */
500-
string getConstantValue() { result = constant.getValue() }
501-
}
502-
503444
/** A `switch` expression or statement. */
504445
class Switch extends ControlFlowElement, @switch {
505446
/** Gets the `i`th case of this `switch`. */

0 commit comments

Comments
 (0)