| Summary: | Cannot cast from short/int to boolean | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | pf yu <pfyu> |
| Component: | EDT | Assignee: | Project Inbox <edt.compiler-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | jqian, pfyu, pharmon, svihovec |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
The problem is from this line of code.
LogResult.assertTrue("2", 2);
The function being called looks like this.
function assertTrue(failedReason String in, testCondition boolean in)
Notice that the argument is a smallint and the parameter is a boolean. In EDT, numeric types are incompatible with booleans. There should be a validation error on the function invocation.
Peng Fei, I think you should change the testcase.
Thanks Matt, It's error of test case itself, instead of a bug. I'll change the test case and close this defect. I'm reopening this bug, with the severity set back to Normal, because validation needs to mark that argument as invalid for the parameter. Validation is already flagging this as an error. It must have been fixed already. Verified in build 20111107. |
Build Identifier: 201109282102 The generated Java code is: public void runDateAndTime11() { Calendar ts = ETimestamp.defaultValue(); eze_Lib_org_eclipse_edt_eunit_runtime_LogResult().logStdOut("variation 11"); n = ETimestamp.dayOf(ts); boolean eze$Temp5; eze$Temp5 = (boolean)((short) 2); eze_Lib_org_eclipse_edt_eunit_runtime_LogResult().assertTrue("2", eze$Temp5); } Cannot cast from short to boolean Reproducible: Always Steps to Reproduce: 1. Check out project "org.eclipse.edt.eunit.test" from kan-cvs. 2. Add java generator to the project. 3. Clean the whole workspace. 4. The errors exist in the following java files: fvt.datatypes.TestDateAndTime04Lib