[Mono-bugs] [Bug 349034] New: gmcs generates NotImplementedException when compiling lamba expression with null coalescing operator
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Dec 14 20:48:31 EST 2007
https://bugzilla.novell.com/show_bug.cgi?id=349034
Summary: gmcs generates NotImplementedException when compiling
lamba expression with null coalescing operator
Product: Mono: Compilers
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at ximian.com
ReportedBy: jpryor at novell.com
QAContact: mono-bugs at ximian.com
Found By: ---
gmcs generates NotImplementedException when compiling lamba expression with
null coalescing operator.
Compiling the following code:
// from wilco` on ##csharp at freenode.net
// license: The
"act-like-you-invented-it-and-feel-free-to-patent-it-like-youve-never-heard-of-me"-license
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
class Test {
private static void TestNaturalSort()
{
var files = new List<FileInfo>() {
new FileInfo ( "photo1.png" ),
new FileInfo ( "photo11.png" ),
new FileInfo ( "photo1.png" ),
new FileInfo ( "photo2.png" ),
new FileInfo ( "photo13.png" ),
new FileInfo ( "1photo.png" ),
new FileInfo ( "1photo.png" ),
new FileInfo ( "" ),
new FileInfo ( null )
};
Comparison<string> naturalSortComparer = (left, right) => {
return Regex.Replace(left ?? "", @"([\d]+)|([^\d]+)", m =>
(m.Value.Length > 0 && char.IsDigit(m.Value[0])) ?
m.Value.PadLeft(Math.Max((left ?? "").Length, (right ?? "").Length)) :
m.Value).CompareTo(Regex.Replace(right ?? "", @"([\d]+)|([^\d]+)", m =>
(m.Value.Length > 0 && char.IsDigit(m.Value[0])) ?
m.Value.PadLeft(Math.Max((left ?? "").Length, (right ?? "").Length)) :
m.Value));
};
var sortedFiles = files.OrderBy(file => file.FileName, new
ComparisonComparer<string>(naturalSortComparer));
foreach (var file in sortedFiles) {
Console.WriteLine(file.FileName);
}
}
public static void Main ()
{
TestNaturalSort ();
}
}
Compile as: gmcs -langversion:linq ns2.cs
Generates the error:
Unhandled Exception: System.NotImplementedException: CloneTo not implemented
for expression Mono.CSharp.Nullable+NullCoalescingOperator
at Mono.CSharp.Expression.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Expression target) [0x00000]
at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.MemberAccess.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Expression t) [0x00000]
at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Argument.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Invocation.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Expression t) [0x00000]
at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Argument.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Invocation.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Expression t) [0x00000]
at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Conditional.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Expression t) [0x00000]
at Mono.CSharp.Expression.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Return.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Statement t) [0x00000]
at Mono.CSharp.Statement.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Block.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Statement t) [0x00000]
at Mono.CSharp.ExplicitBlock.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Statement t) [0x00000]
at Mono.CSharp.ToplevelBlock.CloneTo (Mono.CSharp.CloneContext clonectx,
Mono.CSharp.Statement t) [0x00000]
at Mono.CSharp.Statement.Clone (Mono.CSharp.CloneContext clonectx) [0x00000]
at Mono.CSharp.Statement.PerformClone () [0x00000]
at Mono.CSharp.LambdaExpression.ResolveMethod (Mono.CSharp.EmitContext ec,
Mono.CSharp.Parameters parameters, System.Type returnType, System.Type
delegateType) [0x00000]
at Mono.CSharp.AnonymousMethodExpression.Compatible (Mono.CSharp.EmitContext
ec, System.Type delegate_type) [0x00000]
at Mono.CSharp.LambdaExpression.ImplicitStandardConversionExists (System.Type
delegate_type) [0x00000]
at Mono.CSharp.Convert.ImplicitStandardConversionExists
(Mono.CSharp.Expression expr, System.Type target_type) [0x00000]
at Mono.CSharp.Convert.ImplicitConversionExists (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type) [0x00000]
at Mono.CSharp.Invocation.IsApplicable (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList arguments, Int32 arg_count,
System.Reflection.MethodBase candidate) [0x00000]
at Mono.CSharp.Invocation.IsApplicable (Mono.CSharp.EmitContext ec,
Mono.CSharp.MethodGroupExpr me, System.Collections.ArrayList arguments, Int32
arg_count, System.Reflection.MethodBase& method) [0x00000]
at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList Arguments, Boolean may_fail, Location loc)
[0x00000]
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression right_side) [0x00000]
at Mono.CSharp.MemberAccess.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Return.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Return.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000]
at Mono.CSharp.AnonymousContainer.ResolveNoDefine (Mono.CSharp.EmitContext
ec) [0x00000]
at Mono.CSharp.AnonymousMethod.ResolveNoDefine (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.AnonymousContainer.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.AnonymousMethod.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.LambdaExpression.ResolveMethod (Mono.CSharp.EmitContext ec,
Mono.CSharp.Parameters parameters, System.Type returnType, System.Type
delegateType) [0x00000]
at Mono.CSharp.AnonymousMethodExpression.Compatible (Mono.CSharp.EmitContext
ec, System.Type delegate_type) [0x00000]
at Mono.CSharp.Convert.ImplicitConversionStandard (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression expr, System.Type target_type, Location loc)
[0x00000]
at Mono.CSharp.Convert.ImplicitConversion (Mono.CSharp.EmitContext ec,
Mono.CSharp.Expression expr, System.Type target_type, Location loc) [0x00000]
at Mono.CSharp.Convert.ImplicitConversionRequired (Mono.CSharp.EmitContext
ec, Mono.CSharp.Expression source, System.Type target_type, Location loc)
[0x00000]
at Mono.CSharp.Assign.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext
ec) [0x00000]
at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000]
at Mono.CSharp.EmitContext.EmitTopBlock (IMethodData md,
Mono.CSharp.ToplevelBlock block) [0x00000]
at Mono.CSharp.MethodData.Emit (Mono.CSharp.DeclSpace parent) [0x00000]
at Mono.CSharp.Method.Emit () [0x00000]
at Mono.CSharp.TypeContainer.EmitType () [0x00000]
at Mono.CSharp.RootContext.EmitCode () [0x00000]
at Mono.CSharp.Driver.MainDriver (System.String[] args) [0x00000]
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list