IronLanguages / IronLanguages/ironpython3

EngineTest.ScenarioInterpreterNestedVariables is failing on .NET Core

Open
#908 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

.NET Core
Dominant language
C#
Stars
2.8k
Forks
316
Avg merge
1d 9h
Merged PRs (30d)
1

Description

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?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with EngineTest.ScenarioInterpreterNestedVariables and run the provided expression-tree example on .NET Framework, .NET Core, and Mono if available. Compare those results with CompilerHelpers.LightCompile(body)() and determine which behavior is expected; done means the runtime behavior is resolved and any required follow-up is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.