| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build | 
|---|---|---|---|---|---|---|
| JDK-8259413 | 17 | Jan Lahoda | P2 | Resolved | Fixed | b05 | 
| JDK-8260096 | 16.0.1 | Jan Lahoda | P2 | Resolved | Fixed | b03 | 
                    Consider this code:
---
public class B {
public void test(Object o) {
if (o instanceof @Deprecated String s) {}
}
}
---
This produces:
---
/tmp/B.java:3: error: annotation @Deprecated not applicable in this type context
if (o instanceof @Deprecated String s) {}
^
1 error
---
That is not correct, declaration annotations are currently allowed on the binding variables.
---
public class B {
public void test(Object o) {
if (o instanceof @Deprecated String s) {}
}
}
---
This produces:
---
/tmp/B.java:3: error: annotation @Deprecated not applicable in this type context
if (o instanceof @Deprecated String s) {}
^
1 error
---
That is not correct, declaration annotations are currently allowed on the binding variables.
- backported by
- 
                    JDK-8259413 Binding variables don't correctly support declaration annotations and the final modifier -           
- Resolved
 
-         
- 
                    JDK-8260096 Binding variables don't correctly support declaration annotations and the final modifier -           
- Resolved
 
-         
- csr for
- 
                    JDK-8257759 Binding variables don't correct support declaration annotations and the final modifier -           
- Closed
 
-         
             (1 links to)
        
     
        