Bug 13059 - incorrect (?) code compiles
Summary: incorrect (?) code compiles
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-09 06:59 EDT by Adam Kiezun CLA
Modified: 2002-04-09 10:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-04-09 06:59:17 EDT
class L{
	String g= "f" + + + System.currentTimeMillis();
};

this compiles
but this fails:
class L{
	String g= "f" + + + new Long(System.currentTimeMillis());
};
Comment 1 Philipe Mulet CLA 2002-04-09 10:42:19 EDT
Actually, the first is ugly but correct code. 

int i = + + + 10;  <==> int i = + (+ (+ 10));

Therefore the first statement in your testcase is actually ok, since the 
operand of the unary '+' operator must be numeric.