<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div>
<blockquote type="cite" class="">
<div class="">On Oct 11, 2022, at 12:17 PM, Chris Povirk <<a href="mailto:cpovirk@google.com" class="">cpovirk@google.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="">I didn't find a clear statement either way in my browsing of the JLS. On the one hand, JLS 9.7.4 specifically forbids using type-use annotations with var only for local variables:</div>
<div class=""><br class="">
</div>
<div class="">"If the annotation appears before a void method declaration or a local variable declaration that uses var (§14.4), then there is no closest type."<br class="">
<br class="">
On the other hand, I don't think any of the JLS rules for finding the "closest type" would apply in the case of a var lambda parameter.</div>
</div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Thanks for noticing this, I've filed a bug to fix the spec:</div>
<div><a href="https://bugs.openjdk.org/browse/JDK-8295807" class="">https://bugs.openjdk.org/browse/JDK-8295807</a></div>
<div><br class="">
</div>
<div>I've CC'ed Srikanth who can pursue a bug fix for javac.</div>
</div>
</body>
</html>