Details

    • Type: Improvement Improvement
    • Status: 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

      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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        336d 6h 54m 1 Jochen Theodorou 04/Mar/05 11:40
        Resolved Resolved Closed Closed
        936d 9h 1 Paul King 26/Sep/07 21:40
        Mark Thomas made changes -
        Workflow jira [ 12967950 ] Default workflow, editable Closed status [ 12975691 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12729509 ] Default workflow, editable Closed status [ 12741341 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jochen Theodorou made changes -
        Fix Version/s 1.0-JSR-1 [ 10964 ]
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Hide
        Jochen Theodorou 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
        Jochen Theodorou 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
        Jochen Theodorou made changes -
        Field Original Value New Value
        Assignee james strachan [ jstrachan ] Jochen Theodorou [ blackdrag ]
        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.
        John Wilson created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development