Skip to content

Wildcard types are not disallowed in type ascriptions #23684

@prolativ

Description

@prolativ

Compiler version

3.3.6, 3.72, 3.8.0-RC1-bin-20250731-fe6b7eb-NIGHTLY

Minimized code

object Test {
  val x = ??? : ?
}

Output

The snippets compiles successfully when using scala compiler directly or with scala-cli with --server=false; crashes the compiler with scala-cli otherwise

Expectation

This should raise a compilation error as it does in scala 2.13.16:

[error] /tmp/wildcard/Wildcard.scala:2:17
[error] unbound wildcard type
[error]   val x = ??? : ?
[error]                 ^

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