File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 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 =>
879879 }
880880
881881 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)
883885 tree
884886 }
885887}
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ class CompilationTests extends ParallelTesting {
186186 compileFile(" ../tests/neg-custom-args/xfatalWarnings.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
187187 compileFile(" ../tests/neg-custom-args/pureStatement.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
188188 compileFile(" ../tests/neg-custom-args/i3589-a.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
189+ compileFile(" ../tests/neg-custom-args/i2333.scala" , defaultOptions.and(" -Xfatal-warnings" )) +
189190 compileFile(" ../tests/neg-custom-args/phantom-overload.scala" , allowDoubleBindings) +
190191 compileFile(" ../tests/neg-custom-args/phantom-overload-2.scala" , allowDoubleBindings) +
191192 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