Skip to content

Commit f791837

Browse files
committed
Add a test that is still broken after #23438
1 parent 2c896f1 commit f791837

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
File renamed without changes.

tests/pos/i22593b/Main.scala

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import scala.quoted.*
2+
3+
package jam {
4+
trait JamCoreDsl {
5+
implicit inline def defaultJamConfig: this.JamConfig =
6+
new JamConfig(brewRecRegex = ".*")
7+
class JamConfig(val brewRecRegex: String)
8+
inline def brew(implicit inline config: JamConfig): Unit = ${ brewImpl() }
9+
}
10+
private object internal extends JamCoreDsl
11+
export internal._
12+
13+
def brewImpl(using q: Quotes)(): Expr[Unit] = {
14+
findSelf
15+
'{()}
16+
}
17+
18+
private def findSelf(using q: Quotes): Unit = {
19+
import q.reflect.*
20+
def rec(s: Symbol): Option[Symbol] = s.maybeOwner match {
21+
case o if o.isNoSymbol => None
22+
case o if o.isClassDef => Option(o)
23+
case o => rec(o)
24+
}
25+
rec(Symbol.spliceOwner)
26+
}
27+
}

tests/pos/i22593b/Test.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
object CoreSpec {
2+
jam.brew
3+
}

0 commit comments

Comments
 (0)