Skip to content

Commit 10f0941

Browse files
LinyxusWojciechMazur
authored andcommitted
Add test on missing original file
[Cherry-picked cc8b04a]
1 parent 31bf8c3 commit 10f0941

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

tests/neg/magic-offset-header-c_wrapper.check

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
bad option '-Xmagic-offset-header:SOURCE_CODE_START_MARKER' was ignored
2-
-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-c_wrapper.scala:8:18 --------------------------------------
3-
8 | val x: String = 0 // anypos-error
1+
-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-c.scala:3:18 ----------------------------------------------
2+
3 | val x: String = 0 // error
43
| ^
54
| Found: (0 : Int)
65
| Required: String

tests/neg/magic-offset-header-c_wrapper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//> using options -Xmagic-offset-header:SOURCE_CODE_START_MARKER
1+
//> using options -Ymagic-offset-header:SOURCE_CODE_START_MARKER
22

33
val generatedCode = 123
44

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
original source file not found: something_nonexist.scala
2+
-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-d_wrapper.scala:3:20 --------------------------------------
3+
3 |def test1: String = 0 // error
4+
| ^
5+
| Found: (0 : Int)
6+
| Required: String
7+
|
8+
| longer explanation available when compiling with `-explain`
9+
-- [E007] Type Mismatch Error: tests/neg/magic-offset-header-d_wrapper.scala:5:17 --------------------------------------
10+
5 |def test2: Int = "0" // error
11+
| ^^^
12+
| Found: ("0" : String)
13+
| Required: Int
14+
|
15+
| longer explanation available when compiling with `-explain`
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//> using options -Ymagic-offset-header:SOURCE_CODE_START_MARKER
2+
3+
def test1: String = 0 // error
4+
///SOURCE_CODE_START_MARKER:something_nonexist.scala
5+
def test2: Int = "0" // error

0 commit comments

Comments
 (0)