This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version = NetBeans IDE 8.2 RC (Build 201609140952) Operating System = Linux version 4.4.0-36-generic running on amd64 Java; VM; Vendor = 1.8.0_60 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.60-b23 Capacidade de Reprodução: Acontece toda vez que STEPS: * In any PHP file create an anonymous function as this one $a = 1; $func = function (bool $v) use ($a) : bool { return $v || $a > 1; }; var_dump($func(false)); ACTUAL: Editor displays the second line as an error EXPECTED: Do no display an error
Thanks for catching that, possible patch cancidate.
Adding Junichi to CC, maybe he could be interested. Thanks.
I assume the problem lies in ASTPHP5Parser.cup, where the varsList for LambdaFunctionDeclaration is defined *after* the optional return type (wrong way around). I tried to fix it myself, but I kinda fail at re-generating the parser.
Same problem by the way in the LabdaFunctionsDeclaration.java file, where it's also switched in the toString() method.
I'll try to look at it. Thanks.
I'll fix it. Thanks.
Created attachment 162400 [details] screenshot
Fixed. http://hg.netbeans.org/web-main/rev/11b9bf4dfa91 Thanks.
Guys, in order to be part of the patch for NB 8.2, could you please verify that this issue is fixed now? Just wait for a message that will appear here saying in which daily build this change will be available. Junichi, great job as always! Thanks!
Integrated into 'main-silver', will be available in build *201610150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/11b9bf4dfa91 User: Junichi Yamamoto <junichi11@netbeans.org> Log: #268071 - Anonymous functions with return type are marked as errors when use keyword is used
Looks fixed for me.
(In reply to dasprid from comment #11) > Looks fixed for me. Thanks for your verification!
Thanks a lot!
Transplanted to the releases repo branch release82: http://hg.netbeans.org/releases/rev/fecc28540000 Thanks.
82patch1-verified