Skip to content

Commit c19abee

Browse files
committed
Add regression test
1 parent 71a20e4 commit c19abee

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/pos/scala2-macro-compat-3.scala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
3+
object Macro1 {
4+
import scala.language.experimental.macros
5+
def lineNumber: Int = macro LineNumberMacro2.thisLineNumberImpl
6+
inline def lineNumber: Int = 4
7+
}
8+
9+
object Macro1Consume {
10+
val test = Macro1.lineNumber
11+
}
12+
13+
object LineNumberMacro2 {
14+
class Context: // Dummy scala.reflect.macros.Context
15+
type Expr[+T]
16+
17+
def thisLineNumberImpl(context: Context): context.Expr[Int] = {
18+
// val lineNumber = context.enclosingPosition.line
19+
// context.literal(lineNumber)
20+
???
21+
}
22+
}
23+

0 commit comments

Comments
 (0)