Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions compiler/src/dotty/tools/dotc/transform/PostTyper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -667,15 +667,6 @@ class PostTyper extends MacroTransform with InfoTransformer { thisPhase =>
// case x: Tree[?]
// (which translates to)
// case x: (_: Tree[?])
case m @ MatchTypeTree(bounds, selector, cases) =>
// Analog to the case above for match types
def transformIgnoringBoundsCheck(x: CaseDef): CaseDef =
withMode(Mode.Pattern)(super.transform(x)).asInstanceOf[CaseDef]
cpy.MatchTypeTree(tree)(
super.transform(bounds),
super.transform(selector),
cases.mapConserve(transformIgnoringBoundsCheck)
)
case Block(_, Closure(_, _, tpt)) if ExpandSAMs.needsWrapperClass(tpt.tpe) =>
superAcc.withInvalidCurrentClass(super.transform(tree))
case tree: RefinedTypeTree =>
Expand Down
6 changes: 6 additions & 0 deletions tests/neg/i24313.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- [E057] Type Mismatch Error: tests/neg/i24313.scala:4:14 -------------------------------------------------------------
4 | case _ => S[String] // error
| ^
| Type argument String does not conform to upper bound Int
|
| longer explanation available when compiling with `-explain`
4 changes: 4 additions & 0 deletions tests/neg/i24313.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type S[N <: Int]

type Foo[Xs] = Xs match
case _ => S[String] // error
Loading