Bug 324750 (MONO82076) - [PARSER] Does not parse cast to a generic nullable array
Summary: [PARSER] Does not parse cast to a generic nullable array
Status: RESOLVED FIXED
Alias: MONO82076
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.2
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-11 22:44 UTC by Patrick Perry
Modified: 2008-09-09 07:32 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:43:49 UTC


---- Reported by patperry@stanford.edu 2007-07-11 15:44:55 MST ----

Description of Problem:

gmcs fails to parse the explicit cast to (T?[]).


Steps to reproduce the problem:
1. Try compiling the code below:

using System;

public class NullableArrayParseBug
{
    
    public void Foo<T> ()
        where T : struct
    {
        object o = null;
        int?[] intArray;
        
        T?[] array1;              // this is ok
        Nullable<T>[] array2;     // so is this

        array1 = (Nullable<T>[]) o;  // this is ok
        intArray = (int?[]) o;       // so is this
        array1 = (T?[]) o;           // this is not ok
    }
    
}

 

Actual Results:

NullableArrayParseBug.cs(18,21): error CS1002: Expecting `;'
Compilation failed: 1 error(s), 0 warnings


Expected Results:

Should compile fine.

How often does this happen? 

On Thursdays.  Those are the days I compile the code above.

Additional Information:



---- Additional Comments From marek.safar@seznam.cz 2007-08-02 10:04:00 MST ----

This one will be tricky. It looks like `(T?[])' is not recognized as a
cast.


Unknown operating system other. Setting to default OS "Other".

Comment 2 Marek Safar 2008-09-09 07:32:28 UTC
Fixed in SVN.