File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -257,8 +257,11 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
257257 case tree : MemberDef =>
258258 transformMemberDef(tree)
259259 super .transform(tree)
260- case tree : New if isCheckable(tree) =>
261- Checking .checkInstantiable(tree.tpe, tree.pos)
260+ case tree : New =>
261+ if (tree.tpe.classSymbol.hasAnnotation(defn.DeprecatedAnnot ))
262+ ctx.deprecationWarning(s " ${tree.tpe.typeSymbol} is deprecated " , tree.pos)
263+ if (isCheckable(tree))
264+ Checking .checkInstantiable(tree.tpe, tree.pos)
262265 super .transform(tree)
263266 case tree @ Annotated (annotated, annot) =>
264267 cpy.Annotated (tree)(transform(annotated), transformAnnot(annot))
Original file line number Diff line number Diff line change 1+ @ deprecated(" bla" , " 2.11.0" ) class Foo
2+
3+ object Test {
4+ new Foo // error
5+ }
You can’t perform that action at this time.
0 commit comments