File tree 3 files changed +12
-1
lines changed
src/dotty/tools/dotc/typer
3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -879,7 +879,9 @@ class RefChecks extends MiniPhase { thisPhase =>
879
879
}
880
880
881
881
override def transformNew (tree : New )(implicit ctx : Context ) = {
882
- currentLevel.enterReference(tree.tpe.typeSymbol, tree.pos)
882
+ val sym = tree.tpe.typeSymbol
883
+ checkUndesiredProperties(sym, tree.pos)
884
+ currentLevel.enterReference(sym, tree.pos)
883
885
tree
884
886
}
885
887
}
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ class CompilationTests extends ParallelTesting {
186
186
compileFile(" ../tests/neg-custom-args/xfatalWarnings.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
187
187
compileFile(" ../tests/neg-custom-args/pureStatement.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
188
188
compileFile(" ../tests/neg-custom-args/i3589-a.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
189
+ compileFile(" ../tests/neg-custom-args/i2333.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
189
190
compileFile(" ../tests/neg-custom-args/phantom-overload.scala" , allowDoubleBindings) +
190
191
compileFile(" ../tests/neg-custom-args/phantom-overload-2.scala" , allowDoubleBindings) +
191
192
compileFile(" ../tests/neg-custom-args/structural.scala" , defaultOptions.and(" -Xfatal-warnings" ))
Original file line number Diff line number Diff line change
1
+ @ deprecated(" bla" , " 2.11.0" ) class Foo {
2
+ def this (x : Int ) = this ()
3
+ }
4
+
5
+ object Test {
6
+ new Foo // error: deprecated
7
+ new Foo (1 ) // error: deprecated
8
+ }
You can’t perform that action at this time.
0 commit comments