Bug 2103 - CS0826 implicitly typed array on expression trees
Summary: CS0826 implicitly typed array on expression trees
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2011-11-20 15:39 UTC by Giacomo Tesio
Modified: 2011-11-22 11:44 UTC (History)
1 user (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
A test that reproduce such compilation error. (1.16 KB, text/x-csharp)
2011-11-20 15:39 UTC, Giacomo Tesio
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Giacomo Tesio 2011-11-20 15:39:25 UTC
Created attachment 915 [details]
A test that reproduce such compilation error.

building the attached file (a modified version from the master branch) I got this compilation error:


$ gmcs --stacktrace gtest-etree-27.cs 

gtest-etree-27.cs(51,38): error CS0826: The type of an implicitly typed array cannot be inferred from the initializer. Try specifying array type explicitly
	in ConsoleReportPrinter.Print (Mono.CSharp.AbstractMessage)
	in Report.Error (System.Int32, Mono.CSharp.Location, System.String)
	in ImplicitlyTypedArrayCreation.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in Argument.Resolve (Mono.CSharp.ResolveContext)
	in Arguments.Resolve (Mono.CSharp.ResolveContext, System.Boolean&)
	in Invocation.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in Argument.Resolve (Mono.CSharp.ResolveContext)
	in Arguments.Resolve (Mono.CSharp.ResolveContext, System.Boolean&)
	in Invocation.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in Convert.ImplicitConversionStandard (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location, System.Boolean)
	in Convert.ImplicitConversionStandard (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Convert.ImplicitConversion (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Convert.ImplicitConversionRequired (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Assign.ResolveConversions (Mono.CSharp.ResolveContext)
	in Assign.DoResolve (Mono.CSharp.ResolveContext)
	in SimpleAssign.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext)
	in StatementExpression.Resolve (Mono.CSharp.BlockContext)
	in Block.Resolve (Mono.CSharp.BlockContext)
	in ParametersBlock.Resolve (Mono.CSharp.FlowBranching, Mono.CSharp.BlockContext, Mono.CSharp.IMethodData)
	in MethodData.Emit (Mono.CSharp.DeclSpace)
	in MethodOrOperator.Emit ()
	in Method.Emit ()
	in TypeContainer.EmitType ()
	in ModuleContainer.Emit ()
	in AssemblyDefinition.Emit ()
	in AssemblyDefinitionStatic.Emit ()
	in Driver.Compile ()
	in Driver.Main (System.String[])

gtest-etree-27.cs(51,27): error CS1502: The best overloaded method match for `System.Linq.Expressions.Expression.MemberInit(System.Linq.Expressions.NewExpression, params System.Linq.Expressions.MemberBinding[])' has some invalid arguments
/opt/mono/lib/mono/2.0/System.Core.dll (Location of the symbol related to previous error)
	in ConsoleReportPrinter.Print (Mono.CSharp.AbstractMessage)
	in Report.Error (System.Int32, Mono.CSharp.Location, System.String)
	in Report.Error (System.Int32, Mono.CSharp.Location, System.String, System.String)
	in OverloadResolver.ReportArgumentMismatch (Mono.CSharp.ResolveContext, System.Int32, Mono.CSharp.MemberSpec, Mono.CSharp.Argument, Mono.CSharp.AParametersCollection, Mono.CSharp.TypeSpec)
	in OverloadResolver.VerifyArguments (Mono.CSharp.ResolveContext, Mono.CSharp.Arguments&, Mono.CSharp.MemberSpec, Mono.CSharp.IParametersMember, System.Boolean)
	in OverloadResolver.ReportOverloadError (Mono.CSharp.ResolveContext, Mono.CSharp.MemberSpec, Mono.CSharp.IParametersMember, Mono.CSharp.Arguments, System.Boolean)
	in OverloadResolver.ResolveMember (Mono.CSharp.ResolveContext, Mono.CSharp.Arguments&)
	in MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext, Mono.CSharp.Arguments&, Mono.CSharp.OverloadResolver+IErrorHandler, Mono.CSharp.OverloadResolver+Restrictions)
	in Invocation.DoResolveOverload (Mono.CSharp.ResolveContext)
	in Invocation.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in Argument.Resolve (Mono.CSharp.ResolveContext)
	in Arguments.Resolve (Mono.CSharp.ResolveContext, System.Boolean&)
	in Invocation.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in Convert.ImplicitConversionStandard (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location, System.Boolean)
	in Convert.ImplicitConversionStandard (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Convert.ImplicitConversion (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Convert.ImplicitConversionRequired (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Assign.ResolveConversions (Mono.CSharp.ResolveContext)
	in Assign.DoResolve (Mono.CSharp.ResolveContext)
	in SimpleAssign.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext)
	in StatementExpression.Resolve (Mono.CSharp.BlockContext)
	in Block.Resolve (Mono.CSharp.BlockContext)
	in ParametersBlock.Resolve (Mono.CSharp.FlowBranching, Mono.CSharp.BlockContext, Mono.CSharp.IMethodData)
	in MethodData.Emit (Mono.CSharp.DeclSpace)
	in MethodOrOperator.Emit ()
	in Method.Emit ()
	in TypeContainer.EmitType ()
	in ModuleContainer.Emit ()
	in AssemblyDefinition.Emit ()
	in AssemblyDefinitionStatic.Emit ()
	in Driver.Compile ()
	in Driver.Main (System.String[])

gtest-etree-27.cs(51,21): error CS1502: The best overloaded method match for `System.Linq.Expressions.Expression.Lambda<System.Func<Node>>(System.Linq.Expressions.Expression, params System.Linq.Expressions.ParameterExpression[])' has some invalid arguments
/opt/mono/lib/mono/2.0/System.Core.dll (Location of the symbol related to previous error)
	in ConsoleReportPrinter.Print (Mono.CSharp.AbstractMessage)
	in Report.Error (System.Int32, Mono.CSharp.Location, System.String)
	in Report.Error (System.Int32, Mono.CSharp.Location, System.String, System.String)
	in OverloadResolver.ReportArgumentMismatch (Mono.CSharp.ResolveContext, System.Int32, Mono.CSharp.MemberSpec, Mono.CSharp.Argument, Mono.CSharp.AParametersCollection, Mono.CSharp.TypeSpec)
	in OverloadResolver.VerifyArguments (Mono.CSharp.ResolveContext, Mono.CSharp.Arguments&, Mono.CSharp.MemberSpec, Mono.CSharp.IParametersMember, System.Boolean)
	in OverloadResolver.ReportOverloadError (Mono.CSharp.ResolveContext, Mono.CSharp.MemberSpec, Mono.CSharp.IParametersMember, Mono.CSharp.Arguments, System.Boolean)
	in OverloadResolver.ResolveMember (Mono.CSharp.ResolveContext, Mono.CSharp.Arguments&)
	in MethodGroupExpr.OverloadResolve (Mono.CSharp.ResolveContext, Mono.CSharp.Arguments&, Mono.CSharp.OverloadResolver+IErrorHandler, Mono.CSharp.OverloadResolver+Restrictions)
	in Invocation.DoResolveOverload (Mono.CSharp.ResolveContext)
	in Invocation.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in Convert.ImplicitConversionStandard (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location, System.Boolean)
	in Convert.ImplicitConversionStandard (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Convert.ImplicitConversion (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Convert.ImplicitConversionRequired (Mono.CSharp.ResolveContext, Mono.CSharp.Expression, Mono.CSharp.TypeSpec, Mono.CSharp.Location)
	in Assign.ResolveConversions (Mono.CSharp.ResolveContext)
	in Assign.DoResolve (Mono.CSharp.ResolveContext)
	in SimpleAssign.DoResolve (Mono.CSharp.ResolveContext)
	in Expression.Resolve (Mono.CSharp.ResolveContext, Mono.CSharp.ResolveFlags)
	in Expression.Resolve (Mono.CSharp.ResolveContext)
	in ExpressionStatement.ResolveStatement (Mono.CSharp.BlockContext)
	in StatementExpression.Resolve (Mono.CSharp.BlockContext)
	in Block.Resolve (Mono.CSharp.BlockContext)
	in ParametersBlock.Resolve (Mono.CSharp.FlowBranching, Mono.CSharp.BlockContext, Mono.CSharp.IMethodData)
	in MethodData.Emit (Mono.CSharp.DeclSpace)
	in MethodOrOperator.Emit ()
	in Method.Emit ()
	in TypeContainer.EmitType ()
	in ModuleContainer.Emit ()
	in AssemblyDefinition.Emit ()
	in AssemblyDefinitionStatic.Emit ()
	in Driver.Compile ()
	in Driver.Main (System.String[])
Comment 1 Marek Safar 2011-11-22 11:44:36 UTC
Fixed in master