Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid IL generated for field initializer with dynamic #10463

Closed
marek-safar opened this issue Apr 11, 2016 · 0 comments
Closed

Invalid IL generated for field initializer with dynamic #10463

marek-safar opened this issue Apr 11, 2016 · 0 comments

Comments

@marek-safar
Copy link
Contributor

Version Used: 1.2.0.60317

Steps to Reproduce:

  1. Compile
using System;

public class B2
{
    public Action a = () => {
            dynamic d = 1;
            Test (d);
        };

    static decimal Test (dynamic arg)
    {
        return 3m;
    }
}

class M
{
    static void Main ()
    {
        new B2 ();
    }   
}
  1. peverify output .exe

Expected Behavior:

Valid IL produced by compiler.

Actual Behavior:

Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.

[IL]: Error: [c.exe : B2::.ctor][offset 0x00000008][found ref ('this' ptr) 'B2'][expected ref 'System.Object'] Unexpected type on the stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants