Having problem mapping over a tuple in Scala 3

having trouble doing tuple mapping in scala 3:

type Inner[F] = F match
  case Option[x] => x

val t1 = (1, 'a', true)
val t2 = t1.map[Option]([t] => (x: t) => Some(x)) // this is fine
assertEquals(t2, (Some(1), Some('a'), Some(true)))
val t3 = t2.map[Inner]([t] => (x: t) => x.asInstanceOf[Option[?]].get) // this fails with a match type error
assertEquals(t1, t3)

the match type error is the following:

[error]    |    Note: a match type could not be fully reduced:
[error]    |
[error]    |      trying to reduce  TupleSuite.this.Inner[t]
[error]    |      failed since selector  t
[error]    |      matches none of the cases
[error]    |
[error]    |        case Option[x] => x
[error] one error found

the first map works, but the second one does not compile. any pointer/suggestion is welcome!

Just in case it makes any difference, I’m using scala 3.01

Haven’t used Match Types at all so far, so this is just uninformed guesswork, but I’d suspect that you really need to go through the matching process as shown in the doc example:

def mapOpt[X](x: X): Inner[X] =
  x match
    case o: Option[t] => o.get
val t3 = t2.map[Inner]([t] => (x: t) => mapOpt[t](x))

Having a runtime exception sitting somewhere in the middle of this type level stuff feels quite weird, though. I’d rather expect something like this:

type Inner[F] = F match
  case Some[x] => x
  case None.type => Unit

def mapOpt[X](x: X): Inner[X] =
  x match
    case s: Some[t] => s.get
    case n: None.type => ()
val t3 = t2.map[Inner]([t] => (x: t) => mapOpt[t](x))

i think i finally got what disjointed meant, thanks!!