You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// file: package.scala// If both lines below are commented, then either form of the implicit/extension compiles OK.// If both lines are uncommented, then the implicit variant fails to compile.packageorg.lunatechlabs.dottypackageobjectsudoku {}
// file: ToplevelDefinitions.scalapackageorg.lunatechlabs.dotty.sudokufinalcaseclassSudokuField(sudoku: Int)
// This form compiles only when package.scala is commented.// This form compiles with error when package.scala is uncommented.implicitclassSudokuFieldOps(valsudokuField:SudokuField) extendsAnyVal {
deffoo:Int=???
}
// This form compiles OK regardless of whether package.scala is commented or not.//extension on (sudokuField: SudokuField) {// def foo: Int = ???//}##Output
```scala
[error] -- [E083] TypeError:/opt/local/github.dotty/scala2-to-scala3-course.bug/exercises/src/main/scala/org/lunatechlabs/dotty/sudoku/ToplevelDefinitions.scala:7:0
[error] 7|implicitclassSudokuFieldOps(valsudokuField:SudokuField) extendsAnyVal {
[error] |^
[error] |org.lunatechlabs.dotty.sudoku.SudokuFieldOps.type is not a valid singleton type, since it is not an immutable path
[error] one error found