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.
Created attachment 127394 [details] Screenshot of autocomplete suggestion If a new object is created in a call to a setter that implements a fluent interface, the autocomplete suggestions for the next call will be for the wrong object. e.g. class MyClass { public function setFoo($foo) { $this->foo = $foo; return this; } public function setBar($bar) { ... } } $class = new MyClass(); $class->setFoo(newDateTime)-> // autocomplete now displays the interface for DateTime
You have 2 mistakes in your code, but it's reproducible in this code: <?php class MyClass1 { public function setFoo($foo) { $this->foo = $foo; return $this; } public function setBar($bar) { } } $class = new MyClass1(); $class->setFoo(new DateTime())-> ?>
It doesn't work in 7.2 either.
(In reply to comment #1) > You have 2 mistakes in your code, but it's reproducible in this code: > > <?php > > class MyClass1 > { > public function setFoo($foo) > { > $this->foo = $foo; > return $this; > } > > public function setBar($bar) > { > > } > } > > $class = new MyClass1(); > $class->setFoo(new DateTime())-> > > ?> Sorry, typed too fast. The attachment shows it actually happening without the typos.
Fixed in web-main #823d4423f8d1
Integrated into 'main-golden', will be available in build *201211130001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/823d4423f8d1 User: Ondrej Brejla <obrejla@netbeans.org> Log: #221725 - Adding a new object declaration in a fluent method call gives the wrong suggestions