Skip to content

Better error message for contextual bounds on type aliases #22660

Open
@hamzaremmal

Description

@hamzaremmal

Compiler version

93af7b8

Minimized example

trait Equatable[T]
type Foo[T: Equatable]

Output Error/Warning message

-- [E040] Syntax Error: test.scala:3:10 ----------------------------------------
3 |type Foo[T: Equatable]
  |          ^
  |          ']' expected, but ':' found
1 error found

Why this Error/Warning was not helpful

An error message mentioning that context bounds are not allowed is much useful.

Suggested improvement

See above

Metadata

Metadata

Assignees

Labels

SpreeSuitable for a future Spreearea:parserarea:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions