Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357983

Summary: Type mismatch on myString = my2Dimension[2][2] when my2Dimension string[][] = [["State"],["Carolina","Duke"]];
Product: z_Archived Reporter: broy2
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas, mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description broy2 CLA 2011-09-16 15:12:58 EDT
20110916 build

Debug or run generated:

program javaError type BasicProgram {}    
    my2Dimension  string[][] = [["State"],["Carolina","Duke"]];
    myString string;    
    function main()
        myString = my2Dimension[2,2];
        sysLib.writeStdout(myString);
    end    
end

Get:
egl.lang.TypeCastException
Comment 1 Matt Heitz CLA 2011-09-16 15:21:29 EDT
Brenda, try changing my2Dimension[2,2] to my2Dimension[2][2] and see if it works.  I saw a similar bug go by, and Tim said we're only going to allow one subscript per set of square brackets.

I don't know if there's already a defect on validation not rejecting that expression.
Comment 2 broy2 CLA 2011-09-16 15:26:24 EDT
I changed it to my2Dimension[2][2] and got:

org.eclipse.edt.javart.AnyBoxedObject cannot be cast to egl.lang.EglList
Comment 3 broy2 CLA 2011-09-20 12:18:00 EDT
Now I get:

Type mismatch: cannot convert from EglList<EglAny> to EglList<EglList<String>>
Comment 4 Jeff Douglas CLA 2011-09-20 16:13:54 EDT
fixed
Comment 5 broy2 CLA 2011-09-21 10:37:57 EDT
Verified in 20110921 build.