-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map over
ImportType
s in inliner tree type map
The inliner replaces references to parameters by their corresponding proxys, including in singleton types. It did not, however, handle the mapping over import types, the symbols of which way have depended on parameters. Mapping imports correctly was necessary for i19493 since the `summonInline` resolves post inlining to a given imported within the inline definition. Fix #19493 [Cherry-picked 413d7b4]
- Loading branch information
1 parent
6e76dbe
commit ddfc83d
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
import scala.compiletime.{summonAll, summonInline} | ||
import deriving.Mirror | ||
|
||
type Sc[X] = X | ||
case class Row[T[_]](name: T[String]) | ||
|
||
class DialectTypeMappers: | ||
given String = ??? | ||
|
||
inline def metadata(dialect: DialectTypeMappers)(using m: Mirror.Of[Row[Sc]]): m.MirroredElemTypes = | ||
import dialect.given | ||
summonAll[m.MirroredElemTypes] | ||
|
||
def f = metadata(???) | ||
|
||
|
||
object Minimization: | ||
|
||
class GivesString: | ||
given aString: String = ??? | ||
|
||
inline def foo(x: GivesString): Unit = | ||
import x.aString | ||
summon[String] | ||
summonInline[String] // was error | ||
|
||
foo(???) | ||
end Minimization |