Skip to content

Error about a missing using clause incorrectly suggests use of -rewrite to fix.  #19872

Closed
@reid-spencer

Description

@reid-spencer

Compiler version

3.4.0

Minimized example

A code example is not highly relevant to this issue, but you can find one here:

Output Error/Warning message

[error] 60 |    parseRule[Root](input, root(_), withVerboseFailures) {
[error]    |                           ^^^^
[error]    |                           Context bounds will map to context parameters.
[error]    |                           A `using` clause is needed to pass explicit arguments to them.
[error]    |                           This code can be rewritten automatically under -rewrite -source 3.4-migration.
>print scalacOptions
* -deprecation
* -feature
* -new-syntax
* -explain-types
* -Werror
* -pagewidth:120
* -rewrite
* -source
* 3.4-migration
* -explain

Why this Error/Warning was not helpful

The direction to use the -rewrite -source 3.4-migration option isn't applicable or helpful. As you can
see, both these options were provided to the compiler. It rewrote nothing. Furthermore, it is not clear
where this using clause should be placed.

Suggested improvements

A few ideas:

  • Drop the last line of the message since no attempt to rewrite the code is ever made.
  • If rewriting is an option, place the rewritten code in the error message
  • If rewriting is not an option, provide instructions on where/how to make the needed modifications

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