Skip to content

Commit

Permalink
Merge pull request #13748 from dotty-staging/fix-#i13422
Browse files Browse the repository at this point in the history
Widen qualifier skolems
  • Loading branch information
anatoliykmetyuk committed Oct 20, 2021
2 parents e858d29 + efeb1a3 commit afaac17
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1777,7 +1777,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler

given NamedTypeMethods: NamedTypeMethods with
extension (self: NamedType)
def qualifier: TypeRepr = self.prefix
def qualifier: TypeRepr = self.prefix.widenSkolem
def name: String = self.name.toString
end extension
end NamedTypeMethods
Expand Down
9 changes: 9 additions & 0 deletions tests/pos-macros/i13422/Macro_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import scala.quoted._

inline def rule(inline r: Any): Unit = ${ ruleImpl('r) }

def ruleImpl(r: Expr[Any])(using Quotes): Expr[Unit] = {
import quotes.reflect.*
r.asTerm.show
'{}
}
12 changes: 12 additions & 0 deletions tests/pos-macros/i13422/Test_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def test = rule {
foo(bar(baz))
}

def foo[I](r: I): Nothing = ???

def bar(i: Baz): i.Out = ???

sealed trait Baz:
type Out = Nothing match { case Nothing => Nothing }

def baz: Baz = ???

0 comments on commit afaac17

Please sign in to comment.