Warnings are not reflected in trees #23586
              
                Unanswered
              
          
                  
                    
                      som-snytt
                    
                  
                
                  asked this question in
                Compiler internals Q&A
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
"Errors" may be emitted, as a side effect, but correspond to a tree that
isErroneous.My code editor correlates the diagnostic with a source position, and that is where the red squiggle appears.
But warnings do not have a corresponding tree state. They are only positioned diagnostics (where the yellow squiggle appears).
I can test if
tree.isErroneousbut nottree.isDubious. Why is that? Are warnings fundamentally second-class annotations?I just had a minor case where I might have tested
isDubiousto avoid warning twice.Trees may be deemed in error internally, but not reported because other strategies are tried (other implicits, etc). There is no such mechanism for warnings.
Beta Was this translation helpful? Give feedback.
All reactions