Bugzilla – Bug 315800
[PATCH] mcs crashes when array initializer is used for non-array type
Last modified: 2007-09-15 21:24:23 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".