question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warn when a user defined error message references undefined names

See original GitHub issue

Currently dotty doesn’t warn when you reference an unknown type parameter, but silently accepts it. It might be friendlier towards the user to warn that he probably made a typo.

scala> @annotation.implicitNotFound("Bar[${B}] not found") trait Bar[A] 
// defined trait Bar
scala> implicitly[Bar[String]] 
1 |implicitly[Bar[String]]
  |                       ^
  |                       Bar[${B}] not found

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
YourPsychiatristcommented, Jul 20, 2020

Just for the reference, I want to also add the def case to this issue since its in the same domain:

class K[A] {
  def m[B](implicit c: C[List[A], B]) = 0
  def n[B](implicit @implicitNotFound("Specific message for C of list of ${A} and ${B}") c: C[List[A], B]) = 1
}

For the sake of completeness, I feel like this issue should also cover this case (more generally, for all DefDefs, including constructors)

0reactions
YourPsychiatristcommented, Jul 20, 2020

Ah! Thank you kindly, then I should be all set.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: reference to undefined property "x" - JavaScript
The JavaScript warning "reference to undefined property" occurs when a script attempted to access an object property which doesn't exist.
Read more >
c++ - What is an undefined reference/unresolved external ...
The error message from the compiler will often give you the full declaration of the variable or function that was declared but never...
Read more >
A Beginner's Guide to LaTeX - References
To use this, we first define a label at the section (or equation, table, etc.) ... the error message LaTeX Warning: There were...
Read more >
A Definitive Guide to Handling Errors in JavaScript
You might have forgotten to define a value for the variable before using it, or you might be trying to use an inaccessible...
Read more >
10 Handling PL/SQL Errors
You can use the pragma EXCEPTION_INIT to associate exception names with other Oracle error codes that you can anticipate. To handle unexpected Oracle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found