| Summary: | Value types passed to function parameter reference types are illegal | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Jeff Douglas <jeffdouglas> |
| Component: | EDT | Assignee: | Project Inbox <edt.compiler-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P1 | CC: | carrollk, pharmon |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
I have added validation to prevent passing a value type to an INOUT or OUT reference type on a function invocation. For posterity, here is a list of all the language/validation changes that went into the product for this bug:
1) The "+" and ":?" operators and their corresponding assignment operators ("+=" and "?:=") are not longer considered to be concatenation operators for EGL arrays. The only concatenation operator that is valid for adding entries into an array is the "::" operator (and the corresponding assignment "::=").
2) The validation warning that was produced when comparing an ANY type with a value type has been removed. The java runtime code has been updated to allow numeric values to be compared (using == and !=) with values that are "boxed" in an ANY object. Most of the comparisons already worked for JavaScript. I have opened a bug for the few scenerios that javascript was failing for.
3) It is now invalid to pass a value type argument to a reference type function parameter that is defined as INOUT or OUT. The boxing and unboxing required to accomplish this for all cases is not possible. I doubt that there is any samples that rely on this functionality, so this should just break test variations that are designed to test this scenerio.
4) Passing a reference type arg to a value type parm defined as INOUT or OUT is no longer allowed. (The previous change was to prevent value types from being passed to reference types). The best way to think of this is that value types and reference types are NOT reference compatible
5) Literals are no longer allowed to be passed to INOUT function parms. This was supported in RBD because of VAGen.
6) Only expressions that are valid on the left hand side of an assignment statement are valid to be passed to an INOUT or OUT function parameter. Some of the things that RBD allows to be passed to an INOUT parm, for instance are: AS expressions, New expressions, unary expressions (such as -myInt). Valid expressions are things like simple name, qualified name, array access and dynamic access.
7)Constants are no longer allowed to be passed to INOUT function parameters.
Verified |
Paul, we need to validate this out, for out and inout parms: a decimal(5,2); b timestamp("yyyyMM"); myfunc1(a); myfunc2(b); myfunc1(x decimal inout) myfunc2(x timestamp inout)