| Summary: | Generated Java errors when implicitly or explicitly cast Number function parameter | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Kathy Carroll <carrollk> | ||||||
| Component: | EDT | Assignee: | Project Inbox <edt.javagen-inbox> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P1 | CC: | jeffdouglas, jqian | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 204544 [details]
miniTest library
I think this is related library miniTest2 function testLiterals() recieverINOUT( 1 as number); recieverIN( 2 as number ); end function testVariables() var number = 23.234; var = 1 as number; recieverINOUT(var); var = 2 as number; recieverIN(var); end function recieverINOUT(incoming number inOut); end function recieverIN(incoming number inOut); end end Created attachment 204594 [details]
Project Archive File
More variations for number to decimal
fixed with build 201110241434. This still give java compile errors:
library miniTest2
function testLiterals()
recieverINOUT( 1 as number);
recieverIN( 2 as number );
end
function testVariables()
var number = 23.234;
var = 1 as number;
recieverINOUT(var);
var = 2 as number;
recieverIN(var);
end
function recieverINOUT(incoming number inOut);
end
function recieverIN(incoming number inOut);
end
end
fixed tried with 20111031_20101. I still have a failure on this variation. I do get the result I desire with JavaScript.
program driver type BasicProgram {}
function main()
pass number = 123.45;
received decimal(5,2) = 123.45;
answer decimal(5,2) = convertNumberToSpecificDecimalHack(pass);
if (received == answer)
syslib.writestdout("works");
else
syslib.writestdout("fails");
syslib.writestdout(answer);
end
end
function convertNumberToSpecificDecimalHack(incoming number in) returns (decimal(5,2))
result decimal(5,2) = 234.34;
try
// LogResult.logStdOut("number conversion issue 359899 ");
result = (incoming as any ) as decimal(5,2);
onException(oops AnyException)
stuff string = "runtime error " + oops. message;
syslib.writestdout("number conversion issue 359899 (runtime error)");
syslib.writestdout(stuff);
end
return (result);
end
end
fixed verfied with 20111111_0901 and closed |
The first two functions produce this java compile message: The method asInt(Short) in the type EInt is not applicable for the arguments (ENumber and The method asSmallint(Short) in the type ESmallint is not applicable for the arguments (ENumber) function switchOnInOutNumberParameter(localLen number inOut) substep int = localLen as Int; converted smallInt = localLen as smallInt; end function switchOnInNumberParameter(localLen number in) substep int = localLen; converted smallInt = localLen as smallInt; end function switchOnInOutAnyParameter(localLen any inOut) substep int = localLen; converted smallInt = localLen as smallInt; end function switchOnInAnyParameter(localLen any in) substep int = localLen; converted smallInt = localLen as smallInt; end function numberInlineTest() local number = 3; substep int = local as Int; converted smallInt = local as smallInt; end function anyInlineTest() local any = 3; substep int = local as Int; converted smallInt = local as smallInt; end