Compiler version
main
Minimized code
import language.experimental.captureChecking
trait IO
def foo[X <: IO^](x: X): IO^ = x
 
Output
-- [E007] Type Mismatch Error: issues/cc-typeapp.scala:4:31 ------------------------------------------------------------------------------------------------------------------------------------------------------------
4 |def foo[X <: IO^](x: X): IO^ = x
  |                               ^
  |                               Found:    (x : X)
  |                               Required: IO^
  |
  | longer explanation available when compiling with `-explain`
 
Expectation
It should work.