Skip to content

EngineTest.ScenarioInterpreterNestedVariables is failing on .NET Core #908

Open
@slozier

Description

@slozier

This is passing on .NET Framework but failing on .NET Core.

ParameterExpression tmp = Expression.Parameter(typeof(object), "tmp");
var body = Expression.Lambda<Func<object>>(
    Expression.Block(
        Expression.Block(
            new[] { tmp },
            Expression.Assign(tmp, Expression.Constant(42, typeof(object)))
        ),
        Expression.Block(
            new[] { tmp },
            tmp
        )
    )
);

Debug.Assert(body.Compile()() is null);

I'm not sure which runtime is correct. If .NET Framework has the correct behavior then an issue should probably be filed for .NET Core (and Mono?). Note that CompilerHelpers.LightCompile(body)() is null so if .NET Core is correct should we "fix" the light compiler?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions