[Mono-bugs] [Bug 568955] System.InvalidOperationException: List has changed. from gmcs while compiling.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Apr 20 15:46:39 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=568955

http://bugzilla.novell.com/show_bug.cgi?id=568955#c6


--- Comment #6 from Pablo Ruiz <pruiz at netway.org> 2010-04-20 19:46:37 UTC ---
Looks like some compiler optimizations between 2.4.x and 2.6.x broke
Expression<> handling..

Here it's a disassembled code compiled with 2.4.x:

------ v2.4 code ----
public class IntSpec : Specification
{
    // Methods
    public IntSpec(int id) : base(Expression.Lambda<Func<int,
bool>>(Expression.Equal(expression = Expression.Parameter(typeof(int), "x"),
Expression.Constant(storey.id)), expressionArray1))
    {
        ParameterExpression expression;
        <IntSpec>c__AnonStorey0 storey = new <IntSpec>c__AnonStorey0 {
            id = id
        };
        ParameterExpression[] expressionArray1 = new ParameterExpression[] {
expression };
    }

    // Nested Types
    [CompilerGenerated]
    private sealed class <IntSpec>c__AnonStorey0
    {
        // Fields
        internal int id;
    }
}
--------------

And here the same code with 2.6:

--------------
public class IntSpec : Specification
{
    // Methods
    public IntSpec(int id) : base(Expression.Lambda<Func<int,
bool>>(Expression.Equal(expression, Expression.Constant(storey.id)),
expressionArray1))
    {
        ParameterExpression expression;
        <IntSpec>c__AnonStorey0 storey = new <IntSpec>c__AnonStorey0 {
            id = id
        };
        ParameterExpression[] expressionArray1 = new ParameterExpression[] {
expression };
    }

    // Nested Types
    [CompilerGenerated]
    private sealed class <IntSpec>c__AnonStorey0
    {
        // Fields
        internal int id;
    }
}
----------- 

As you can see the call to base ctor it's missing it's parameter ("x") on left
side:

v2.4.x --> public IntSpecx(int id) : base(Expression.Lambda<Func<int,
bool>>(Expression.Equal(expression, Expression.Constant(storey.id)),
expressionArray1))

v2.6.x --> public IntSpec(int id) : base(Expression.Lambda<Func<int,
bool>>(Expression.Equal(expression = Expression.Parameter(typeof(int), "x"),
Expression.Constant(storey.id)), expressionArray1))

-- 
Configure bugmail: http://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