Bug 264057

Summary: kdevelop-php-1.1.90: problem indication for const values
Product: [Applications] kdevelop Reporter: Andreas Cord-Landwehr <cordlandwehr>
Component: Language Support: PHPAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: 4.2.0   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: File to reproduce my problem
And here how the wrong underlines + error look like.

Description Andreas Cord-Landwehr 2011-01-23 11:53:07 UTC
Version:           unspecified (using KDE 4.5.3) 
OS:                Linux

I declared a class ist a const value "const kFOOBAA = 1;" in line N. Next I added a new line before this const definition, such that the const-line moved (this is new line N and const moves to line N+1). 
Next, all my const-definitions are underlined in red and an error is stated for the const definition that it cannot be redeclared since it was already declared in line N.

Reproducible: Always




OS: Linux (i686) release 2.6.32-5-686
Compiler: cc
Comment 1 Milian Wolff 2011-01-23 18:35:57 UTC
please attach a real test file instead of letting me guess-interpreting your statements. I cannot reproduce anything with this code:

<?php
class Test
{
    const B = 2; // insert newline before/after this line
    const I = 1;
}
Comment 2 Andreas Cord-Landwehr 2011-01-23 19:44:49 UTC
Created attachment 56354 [details]
File to reproduce my problem

Sorry, assumed it was easier to reproduce. With the attached file I get the wrong underlines if adding a new line 39 by pressing "ENTER" at end of line 38 and further writing "//" into the new line.
Comment 3 Andreas Cord-Landwehr 2011-01-23 19:45:40 UTC
Created attachment 56355 [details]
And here how the wrong underlines + error look like.
Comment 4 Milian Wolff 2011-01-23 20:19:30 UTC
Git commit 7af440fcb87b9781bfe38d6d45b2caaf6be92ca3 by Milian Wolff.
Pushed by mwolff into branch '1.2'.

only take encountered declarations into account when checking for redeclarations

BUG: 264057

M  +5    -5    duchain/builders/declarationbuilder.cpp     

http://commits.kde.org/41973b7c/7af440fcb87b9781bfe38d6d45b2caaf6be92ca3