-
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.
Make
isMatch
false for applied MatchAlias
es
It is true only for `MatchType`s and higher-kinded abstraction of them. As a result, code using `isMatch` to choose between a `TypeAlias` and `MatchAlias` will now use a `TypeAlias` when aliasing a `MatchAlias`. Which in turn allows for better de-aliasing, since `dealias` only de-aliases standard type aliases. The logic for this distinction has also been extracted to the common `AliasingBounds` supertype. `tryNormalize` on `AppliedType` should only attempt reduction if there is an underlying match type. This could previously be identified by a `MatchAlias` tycon. We now need a recursive check.
- Loading branch information
1 parent
20d95b0
commit 93c3563
Showing
10 changed files
with
68 additions
and
36 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
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import scala.quoted._ | ||
import scala.deriving._ | ||
|
||
def blah2[P <: Product, MEL <: Tuple: Type, MET <: Tuple: Type](m: Mirror.ProductOf[P] { type MirroredElemLabels = MEL; type MirroredElemTypes = MET})(using Quotes) = { | ||
def blah[P <: Product] | ||
(m: Mirror.ProductOf[P]) | ||
(using Quotes, Type[m.MirroredElemLabels], Type[m.MirroredElemTypes]) = { | ||
type z = Tuple.Zip[m.MirroredElemLabels, m.MirroredElemTypes] | ||
Type.of[z] // error | ||
() | ||
} | ||
|
||
def blah2[P <: Product, MEL <: Tuple: Type, MET <: Tuple: Type] | ||
(m: Mirror.ProductOf[P] { type MirroredElemLabels = MEL; type MirroredElemTypes = MET}) | ||
(using Quotes) = { | ||
Type.of[Tuple.Zip[MEL, MET]] | ||
() | ||
} |
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,26 @@ | ||
|
||
object Test: | ||
|
||
trait T: | ||
type S | ||
type F = T.F[S] | ||
|
||
def foo: F | ||
def bar: T.F[S] | ||
|
||
object T: | ||
type F[X] = X match | ||
case String => Option[Int] | ||
|
||
type G[X] = X match | ||
case Option[x] => Int | ||
|
||
val t: T {type S = String} = ??? | ||
|
||
val b = t.bar | ||
val m1: T.G[b.type] = ??? | ||
val _: Int = m1 // Ok | ||
|
||
val f = t.foo | ||
val m: T.G[f.type] = ??? | ||
val _: Int = m // Error before changes |