Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid caret position for missing given argument error messages #15630

Open
som-snytt opened this issue Jul 9, 2022 · 3 comments
Open

Invalid caret position for missing given argument error messages #15630

som-snytt opened this issue Jul 9, 2022 · 3 comments
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement

Comments

@som-snytt
Copy link
Contributor

Compiler version

Welcome to Scala 3.2.1-RC1-bin-SNAPSHOT-git-baf21dd (18.0.1.1, Java OpenJDK 64-Bit Server VM).

Minimized code

scala> def f = summon[Int]
-- Error: --------------------------------------------------------------------------------------------------------------
1 |def f = summon[Int]
  |                   ^
  |                   No given instance of type Int was found for parameter x of method summon in object Predef
1 error found

Output

The caret doesn't seem to be aligned.

Expectation

The caret should be aligned with the guilty text.

@som-snytt som-snytt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 9, 2022
@griggt
Copy link
Contributor

griggt commented Jul 9, 2022

It seems that the caret is pointing to the missing given argument. This may be by design, IDK.

@som-snytt
Copy link
Contributor Author

som-snytt commented Jul 9, 2022

@griggt Clever! So the caret is really a pen, and the compiler can't think of anything to write.

I did something with f(42) where def f needed a given; was the caret on the f or the paren? 🤔

@rochala rochala changed the title Bad caret at bad summon in REPL Invalid caret position for missing given argument error messages Jul 11, 2022
@rochala rochala added itype:enhancement area:reporting Error reporting including formatting, implicit suggestions, etc and removed itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc itype:enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants