Bug 315800 (MONO63141) - [PATCH] mcs crashes when array initializer is used for non-array type
Summary: [PATCH] mcs crashes when array initializer is used for non-array type
Status: RESOLVED FIXED
Alias: MONO63141
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-16 15:28 UTC by Colin JN Breame
Modified: 2007-09-15 21:24 UTC (History)
0 users

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


Attachments
patch (782 bytes, patch)
2004-08-29 21:43 UTC, Thomas Wiest
Details | Diff

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


---- Reported by colin@breame.com 2004-08-16 08:28:26 MST ----

using 1.0.1:

public class A {
    A test = {
        new A()
    };
}

Produces:
$ mcs test.cs
Unhandled Exception: System.NotSupportedException: Operation is not supported.
in <0x00024> System.Type:GetArrayRank ()
in <0x00182> Mono.CSharp.ArrayCreation:LookupType (Mono.CSharp.EmitContext)
in <0x0005e> Mono.CSharp.ArrayCreation:DoResolve (Mono.CSharp.EmitContext)
in <0x000d5> Mono.CSharp.FieldBase:GetInitializerExpression
(Mono.CSharp.EmitContext)
in <0x00115> Mono.CSharp.TypeContainer:EmitFieldInitializers
(Mono.CSharp.EmitContext)
in <0x00388> Mono.CSharp.Constructor:Emit (Mono.CSharp.TypeContainer)
in <0x00427> Mono.CSharp.TypeContainer:Emit ()
in <0x00896> Mono.CSharp.RootContext:EmitCode ()
in <0x00c35> Mono.CSharp.Driver:MainDriver (string[])
in <0x00012> Mono.CSharp.Driver:Main (string[])



---- Additional Comments From bmaurer@users.sf.net 2004-08-29 14:43:42 MST ----

Created an attachment (id=166652)
patch




---- Additional Comments From bmaurer@users.sf.net 2004-08-29 14:44:12 MST ----

If the type does not resolve to an array, give an error.



---- Additional Comments From bmaurer@users.sf.net 2004-08-29 15:27:45 MST ----

Fixed in 1.0 and HEAD

Imported an attachment (id=166652)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Gentoo</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".