Skip to content

Commit

Permalink
Update check-files and remove i18488.scala
Browse files Browse the repository at this point in the history
i18488.scala was only passing because of the bug in the MatchReducer,
as we can see in the subtyping trace:
```
==> isSubType TableQuery[BaseCrudRepository.this.EntityTable] <:< Query[BaseCrudRepository.this.EntityTable, E[Option]]?
  ==> isSubType Query[BaseCrudRepository.this.EntityTable, Extract[BaseCrudRepository.this.EntityTable]] <:<
                Query[BaseCrudRepository.this.EntityTable, E[Option]] (left is approximated)?
    ==> isSubType E[Option] <:< Extract[BaseCrudRepository.this.EntityTable]?
      ==> isSubType [T[_$1]] =>> Any <:< Extract?
        ==> isSubType Any <:< Extract[T]?
          ==> isSubType Any <:< T match { case AbstractTable[t] => t } <: t (right is approximated)?
            ==> isSubType Any <:< <error Match type reduction failed since selector T
                                   matches none of the cases
                                   case AbstractTable[t] => t> (right is approximated)?
            <== isSubType Any <:< <error Match type reduction failed since selector T
                                   matches none of the cases
                                   case AbstractTable[t] => t> (right is approximated) = true
          <== isSubType Any <:< T match { case AbstractTable[t] => t } <: t (right is approximated) = true
        <== isSubType Any <:< Extract[T] = true
      <== isSubType [T[_$1]] =>> Any <:< Extract = true
      ...
    <== isSubType Extract[BaseCrudRepository.this.EntityTable] <:< E[Option] = true
  <== isSubType Query[BaseCrudRepository.this.EntityTable, Extract[BaseCrudRepository.this.EntityTable]] <:<
                Query[BaseCrudRepository.this.EntityTable, E[Option]] (left is approximated) = true
<== isSubType TableQuery[BaseCrudRepository.this.EntityTable] <:< Query[BaseCrudRepository.this.EntityTable, E[Option]] = true
```
  • Loading branch information
EugeneFlesselle committed Mar 17, 2024
1 parent b2c544a commit ed5ddfe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
4 changes: 2 additions & 2 deletions tests/neg/i12049.check
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-- Error: tests/neg/i12049.scala:14:23 ---------------------------------------------------------------------------------
14 |val y3: String = ??? : Last[Int *: Int *: Boolean *: String *: EmptyTuple] // error
| ^
| Match type reduction failed since selector EmptyTuple.type
| Match type reduction failed since selector EmptyTuple
| matches none of the cases
|
| case _ *: _ *: t => Last[t]
Expand Down Expand Up @@ -48,7 +48,7 @@
-- Error: tests/neg/i12049.scala:25:26 ---------------------------------------------------------------------------------
25 |val _ = summon[String =:= Last[Int *: Int *: Boolean *: String *: EmptyTuple]] // error
| ^
| Match type reduction failed since selector EmptyTuple.type
| Match type reduction failed since selector EmptyTuple
| matches none of the cases
|
| case _ *: _ *: t => Last[t]
Expand Down
4 changes: 2 additions & 2 deletions tests/neg/i13757-match-type-anykind.scala
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
object Test:
type AnyKindMatchType1[X <: AnyKind] = X match // error: the scrutinee of a match type cannot be higher-kinded // error
type AnyKindMatchType1[X <: AnyKind] = X match // error: the scrutinee of a match type cannot be higher-kinded
case Option[a] => Int

type AnyKindMatchType2[X <: AnyKind] = X match // error: the scrutinee of a match type cannot be higher-kinded
case Option => Int // error: Missing type parameter for Option

type AnyKindMatchType3[X <: AnyKind] = X match // error: the scrutinee of a match type cannot be higher-kinded // error
type AnyKindMatchType3[X <: AnyKind] = X match // error: the scrutinee of a match type cannot be higher-kinded
case _ => Int

type AnyKindMatchType4[X <: Option] = X match // error // error: the scrutinee of a match type cannot be higher-kinded // error
Expand Down
15 changes: 0 additions & 15 deletions tests/pos/i18488.scala

This file was deleted.

0 comments on commit ed5ddfe

Please sign in to comment.