Skip to content

Commit 5c96f5d

Browse files
committed
Test for more deprecations suppressing deprecations
1 parent 98972e5 commit 5c96f5d

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

test/files/neg/t12648.check

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
LogConfig_2.scala:7: warning: value MESSAGE_FORMAT_VERSION_CONFIG in class TopicConfig_1 is deprecated
2+
val MessageFormatVersionPropX = TopicConfig_1.MESSAGE_FORMAT_VERSION_CONFIG
3+
^
4+
LogConfig_2.scala:10: warning: Specify both message and version: @deprecated("message", since = "1.0")
5+
@deprecated("3.0")
6+
^
7+
LogConfig_2.scala:12: warning: Specify both message and version: @deprecated("message", since = "1.0")
8+
@deprecated("3.0") @nowarn("cat=deprecation")
9+
^
10+
LogConfig_2.scala:12: warning: @nowarn annotation does not suppress any warnings
11+
@deprecated("3.0") @nowarn("cat=deprecation")
12+
^
13+
error: No warnings can be incurred under -Werror.
14+
4 warnings
15+
1 error
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
// scalac: -Werror -Xlint -Xsource:3
3+
4+
import annotation.*
5+
6+
class LogConfig {
7+
val MessageFormatVersionPropX = TopicConfig_1.MESSAGE_FORMAT_VERSION_CONFIG
8+
@nowarn("cat=deprecation")
9+
val MessageFormatVersionPropY = TopicConfig_1.MESSAGE_FORMAT_VERSION_CONFIG
10+
@deprecated("3.0")
11+
val MessageFormatVersionPropZ = TopicConfig_1.MESSAGE_FORMAT_VERSION_CONFIG
12+
@deprecated("3.0") @nowarn("cat=deprecation")
13+
val MessageFormatVersionProp = TopicConfig_1.MESSAGE_FORMAT_VERSION_CONFIG
14+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
public class TopicConfig_1 {
3+
@Deprecated public static final String MESSAGE_FORMAT_VERSION_CONFIG = "message.format.version";
4+
}

0 commit comments

Comments
 (0)