DEVSENSE / Phalanger

PHP 5.4 compiler for .NET/Mono frameworks. Predecessor to the opensource PeachPie project (www.peachpie.io).
http://v4.php-compiler.net/
Apache License 2.0
382 stars 94 forks source link

problems with .net 4.6 #53

Closed proff closed 8 years ago

proff commented 9 years ago

in .net 4.6 anonymous delegates compiles as instance methods even if target is 4.5 and this code is not working:

            Func<object,object> isNotPhpReference = (obj) =>
            {
               Debug.Assert( !(obj is PhpReference) );
               return obj;
            };

            return Expression.Call(null, isNotPhpReference.Method, objEx);

must use static mehods

        private static object IsNotPhpReference(object obj)
        {
            Debug.Assert(!(obj is PhpReference));
            return obj;
        }
jakubmisek commented 8 years ago

fixed as suggested

proff commented 8 years ago

In my branch it was not the only one anonymous delegate with this problem, but I worked with old branch. Fix like this must applyed to all delegates called via "Expression.Call(null..."

jakubmisek commented 8 years ago

thanks, fixed