Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318629 - Wrong parameters list for constructor is proposed when auto-completing object creation
Summary: Wrong parameters list for constructor is proposed when auto-completing object...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP Core CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-01 11:43 EDT by Ilya Sedlovsky CLA
Modified: 2020-05-14 11:17 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Sedlovsky CLA 2010-07-01 11:43:04 EDT
Build Identifier: 20100618-0524

If you have class C11 that extends class C1 that extends class C and class C has contructor (__construct method) with mandatory parameter and class C1 has constructor with all parameters are optional and class C11 has no constructor at all then auto-completed class for 'new' construction will produce placeholder for mandatory parameter of the class C.

Reproducible: Always

Steps to Reproduce:
1. Suppose we have PHP code:

class TestBase {
    public function __construct($name, $value = "") {
    }
}

class TestChild extends TestBase {
    public function __construct($name = "") {
    }
}

class TestChild2 extends TestChild {
}

$test = new TestChild2<here one press Ctrl+Space to auto-complete >

2. It will be auto-completed to:

$test = new TestChild2($name)

while it should be:

$test = new TestChild2()
Comment 1 Zhongwei Zhao CLA 2010-07-01 11:56:45 EDT
fixed in both head and branch
Comment 2 Ilya Sedlovsky CLA 2010-07-02 03:48:52 EDT
zhaozhongwei, how can I get the update to my Helios? I've tried to get updates but my version is up to date.
Comment 3 Zhongwei Zhao CLA 2010-07-02 04:55:50 EDT
I think this only works in the nightly build version:(
Comment 4 Gadi Goldbarg CLA 2010-08-25 10:09:19 EDT
Tested on 2.2.1 SR1
Verified - OK