diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/pos/constant-warning.check | 4 | ||||
-rw-r--r-- | test/files/pos/constant-warning.flags | 1 | ||||
-rw-r--r-- | test/files/pos/constant-warning.scala | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/test/files/pos/constant-warning.check b/test/files/pos/constant-warning.check new file mode 100644 index 0000000000..f7df2165d1 --- /dev/null +++ b/test/files/pos/constant-warning.check @@ -0,0 +1,4 @@ +constant-warning.scala:2: warning: Evaluation of a constant expression results in an arithmetic error: / by zero + val fails = 1 + 2 / (3 - 2 - 1) + ^ +one warning found diff --git a/test/files/pos/constant-warning.flags b/test/files/pos/constant-warning.flags new file mode 100644 index 0000000000..d00cbbe77b --- /dev/null +++ b/test/files/pos/constant-warning.flags @@ -0,0 +1 @@ +-Xlint:constant diff --git a/test/files/pos/constant-warning.scala b/test/files/pos/constant-warning.scala new file mode 100644 index 0000000000..c8ca8823e7 --- /dev/null +++ b/test/files/pos/constant-warning.scala @@ -0,0 +1,3 @@ +object Test { + val fails = 1 + 2 / (3 - 2 - 1) +} |