Status/Resolution/Reason: Closed/Fixed/Fixed
Reporter/Name(from Bugbase): Adam Cameron / Adam Cameron (Adam Cameron)
Created: 07/26/2015
Components: Language
Versions: 2016,11.0
Failure Type:
Found In Build/Fixed In Build: CF11_Final / 318001
Priority/Frequency: Normal / Some users will encounter
Locale/System: English / Platforms All
Vote Count: 0
Repro:
{code}
// safeRun.cfm
function safeRun(message="", task){
try {
writeOutput("#message#<br>");
task();
}catch (any e){
writeOutput("
Type: #e.type#<br>
Message: #e.message#<br>
");
} finally {
writeOutput("<hr>");
}
}
{code}
{code}
// Test.cfc
component {}
{code}
{code}
// NotTest.cfc
component {}
{code}
{code}
// arraysOfObjectsAsReturnType.cfm
include "safeRun.cfm";
Test[] function returnsArrayOfTests(size){
var baseArray = [];
baseArray.set(1, size, new Test());
return baseArray;
}
safeRun("Array of Tests", function(){
tests = returnsArrayOfTests(5);
writeDump(tests);
});
NotTest[] function returnsArrayOfNotTests(size){
var baseArray = [];
baseArray.set(1, size, new Test());
return baseArray;
}
safeRun("Array of NotTests", function(){
tests = returnsArrayOfNotTests(5);
writeDump(tests);
});
Test[] function returnsInvalidArrayOfTests(size){
var baseArray = [];
baseArray.set(1, size, new Test());
baseArray.append(new NotTest());
return baseArray;
}
safeRun("Invalid array of Tests", function(){
tests = returnsInvalidArrayOfTests(1);
writeDump(tests);
});
{code}
Expected:
for both second an third example to error as the return types are not correct.
Actual:
third one doesn't error, despite the array holding an illegal type.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 4026104
Reason: BugVerified
External Customer Info:
External Company:
External Customer Name: Adam
External Customer Email:
External Test Config: My Hardware and Environment details:
Attachments:
Comments: