Skip to content

A code using given does not compile with -source:3.0-migration option #15905

Open
@OndrejSpanel

Description

@OndrejSpanel

Compiler version

Tested 3.0.2 and 3.1.3, both with option -source:3.0-migration, see https://scastie.scala-lang.org/04ztVOx5QuqycanJXlZQkg

Minimized code

object EnumOf {
  inline given [E](using ct: scala.reflect.ClassTag[E]): AnyRef = ???
}

Note: the code is extracted from https://github.com/theiterators/kebs/blob/master/macro-utils/src/main/scala-3/pl/iterators/kebs/macros/enums/EnumEntryMacros.scala

Output

inline must be followed by an if or a match

Expectation

Valid Scala 3 code should still compile in migration mode, or if this is not intended, the documentation should be changed. The documentation says:

option makes the compiler forgiving on most of the dropped features

There is nothing about Scala 3 features not being supported.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions