Skip to content

Commit 81e7a87

Browse files
committed
Test: warn for deprecated C on C.apply also if it's not rewritten
1 parent 69c1219 commit 81e7a87

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

test/files/neg/t13006.check

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ t13006.scala:23: warning: constructor D in class D is deprecated
1919
t13006.scala:24: warning: constructor D in class D is deprecated
2020
def u4 = new D(10) // warn
2121
^
22+
t13006.scala:34: warning: class C in object oho is deprecated
23+
def t1 = oho.C(10) // warn
24+
^
25+
t13006.scala:35: warning: constructor D in class D is deprecated
26+
def t2 = oho.D(10) // warn
27+
^
2228
error: No warnings can be incurred under -Werror.
23-
7 warnings
29+
9 warnings
2430
1 error

test/files/neg/t13006.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,13 @@ class T {
2424
def u4 = new D(10) // warn
2525
def u5(d: D) = 10 // no warn
2626
}
27+
28+
object oho {
29+
@deprecated case class C private[oho] (x: Int)
30+
case class D @deprecated() private[oho] (x: Int)
31+
}
32+
33+
class T1 {
34+
def t1 = oho.C(10) // warn
35+
def t2 = oho.D(10) // warn
36+
}

0 commit comments

Comments
 (0)