Skip to content

Type can be applied only once to type arguments. #6729

Open
@scabug

Description

@scabug

The EBNF of SimpleType and TypeArgs in the current (2.9) version of the scala language specification is:

SimpleType ::= SimpleType TypeArgs
             | SimpleType#’ id
             | StableId
             | Path ‘.’ ‘type| ‘(’ Types ’)’

TypeArgs ::= ‘[’ Types ‘]’

This would allow currying of type args, i.e. Foo[A][B]...[N]. However, as there cannot be more than one TypeParamClause for any type, class or trait, the syntax makes no sense and should be invalid.

For the same reason (A, B)[C] should also be invalid syntax, since that would be an alias for scala.Tuple2[A,B][C].

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions