Skip to content
Merged
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
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/cc/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class Setup extends PreRecheck, SymTransformer, SetupAPI:

case tree @ SeqLiteral(elems, tpt: TypeTree) =>
traverse(elems)
transformTT(tpt, boxed = true, exact = false)
tpt.rememberType(box(transformInferredType(tpt.tpe)))

case _ =>
traverseChildren(tree)
Expand Down
7 changes: 7 additions & 0 deletions tests/neg/i19470.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- [E007] Type Mismatch Error: tests/neg/i19470.scala:9:12 -------------------------------------------------------------
9 | List(foo(f())) // error
| ^^^^^^^^
| Found: Inv[? >: IO <: box IO^{f}]
| Required: box Inv[box IO^?]^?
|
| longer explanation available when compiling with `-explain`
9 changes: 9 additions & 0 deletions tests/neg/i19470.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import language.experimental.captureChecking
trait IO
case class Inv[X](x: X)

def foo(x: IO^): Inv[IO^{x}] = Inv(x)

def main(io: IO^): Unit =
def test(f: () => IO^) =
List(foo(f())) // error