This repository has been archived by the owner on May 30, 2023. It is now read-only.
Undocumented(?) always available given: T => T #36
Labels
intent:add-knowledge
You have learnt something while working on the Dotty compiler and you want to preserve this info
Hello,
I have discovered that the type
T => T
(for allT
) is given, the following example compiles and run (scalaVersion := 3.0.2):(doesn't compile if
T => T
is replaced byT
)This was unexpected, and I did not find any mention of it in the docs, for example there's no mention of it here:
https://docs.scala-lang.org/scala3/reference/contextual/givens.html
(I know as a rule you should wrap types in something to avoid unexpected givens like that, but for prototyping purposes I wasn't doing it)
The problem is not necessarily this unexpected behavior, rather that even having read documentation, it was still unexpected
Thank you for your time, hope this helps
The text was updated successfully, but these errors were encountered: