Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-beta-4
    • Fix Version/s: 1.0-JSR-1
    • Component/s: ast builder
    • Labels:
      None
    • Number of attachments :
      0

      Description

      Object[] a = [1]

      this currently throws an exception at run time.

      It would be convenient if it caused toArray to be called on the List

        Activity

        Hide
        Stepan Koltsov added a comment -

        I think this is bad, if you need Object[] you should do something like

        Object[] a = new Object[]

        { 1, 2, 3 }

        People rarely use arrays.

        Show
        Stepan Koltsov added a comment - I think this is bad, if you need Object[] you should do something like Object[] a = new Object[] { 1, 2, 3 } People rarely use arrays.
        Hide
        blackdrag blackdrag added a comment -

        we decided to make this possible for the new parser. So legal methods of declaring arrays are:

        a = [1,2,3] as Object[]

        or

        Object[] a = [1,2,3]

        of course, the last one allows the "as array" syntax too

        Show
        blackdrag blackdrag added a comment - we decided to make this possible for the new parser. So legal methods of declaring arrays are: a = [1,2,3] as Object[] or Object[] a = [1,2,3] of course, the last one allows the "as array" syntax too

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            John Wilson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: