File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
compiler/src/dotty/tools/dotc/typer
tests/pos-special/fatal-warnings Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -905,16 +905,19 @@ object RefChecks {
905
905
owner.isDeprecated
906
906
|| isEnumOwner(owner)
907
907
908
+ def isDeprecatedOrSyntheticMethod (owner : Symbol ) = owner.isDeprecated || owner.isAllOf(Method & Synthetic )
909
+
908
910
/** Scan the chain of outer declaring scopes from the current context
909
911
* a deprecation warning will be skipped if one the following holds
910
912
* for a given declaring scope:
911
- * - the symbol associated with the scope is also deprecated.
913
+ * - the symbol associated with the scope is also deprecated or synthetic method .
912
914
* - if and only if `sym` is an enum case, the scope is either
913
915
* a module that declares `sym`, or the companion class of the
914
916
* module that declares `sym`.
915
917
*/
916
918
def skipWarning (using Context ) =
917
- ctx.owner.ownersIterator.exists(if sym.isEnumCase then isDeprecatedOrEnum else _.isDeprecated)
919
+ if sym.isEnum then ctx.owner.ownersIterator.exists(isDeprecatedOrEnum)
920
+ else ctx.owner.ownersIterator.exists(isDeprecatedOrSyntheticMethod)
918
921
919
922
for annot <- sym.getAnnotation(defn.DeprecatedAnnot ) do
920
923
if ! skipWarning then
Original file line number Diff line number Diff line change
1
+ @ deprecated(" no CaseClass" , " 0.1" ) case class CaseClass (rgb : Int )
You can’t perform that action at this time.
0 commit comments