Skip to content

2.13.1 regression, using higher kinds without language-level import no longer emits a compiler warning #11753

@oxbowlakes

Description

@oxbowlakes

In 2.13.0:

Welcome to Scala 2.13.0 (OpenJDK 64-Bit Server VM, Java 1.8.0_181).
Type in expressions for evaluation. Or try :help.

scala> def foo[M[_]]: Unit = ()
               ^
       warning: higher-kinded type should be enabled
       by making the implicit value scala.language.higherKinds visible.
       This can be achieved by adding the import clause 'import scala.language.higherKinds'
       or by setting the compiler option -language:higherKinds.
       See the Scaladoc for value scala.language.higherKinds for a discussion
       why the feature should be explicitly enabled.
foo: [M[_]]=> Unit

But in 2.13.1

Welcome to Scala 2.13.1 (OpenJDK 64-Bit Server VM, Java 1.8.0_181).
Type in expressions for evaluation. Or try :help.

scala> def foo[M[_]]: Unit
     |  = ()
foo: [M[_]]=> Unit

This doesn't sound too bad, but if you do have the import:

import scala.language.higherKinds

And you also use the compiler flags -Xfatal-warnings -Ywarn-unused then your code will no longer compile!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions