File tree 2 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/transform 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
257
257
case tree : MemberDef =>
258
258
transformMemberDef(tree)
259
259
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)
262
265
super .transform(tree)
263
266
case tree @ Annotated (annotated, annot) =>
264
267
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