Skip to content

Backport "doc: make TypeTest example compiling" to 3.3 LTS #378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

tgodzik
Copy link

@tgodzik tgodzik commented Apr 29, 2025

Backports scala#23009 to the 3.3.7.

PR submitted by the release tooling.
[skip ci]

Current example is not compiling:

```scala
import scala.reflect.{ClassTag, TypeTest}

val tt: TypeTest[Any, String] =
  new TypeTest[Any, String]:
    def unapply(s: Any): Option[s.type & String] = s match
      case s: String => Some(s) // compiler error Found: (s : String) Required: (s² : Any) & String
      case _ => None
```

https://scastie.scala-lang.org/road21/jq3j9XsUTdeshqbHxDXv3w
[Cherry-picked 6c021c6]
@tgodzik tgodzik closed this Apr 30, 2025
@tgodzik tgodzik deleted the backport-lts-3.3-23009 branch April 30, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants