Giter Site home page Giter Site logo

Comments (2)

cyborgyn avatar cyborgyn commented on August 23, 2024

Actually, it seems to be that easy to fix, as the following patch suggests. Is there a not so obvious reason why static constructors were filtered out during C code generation?

diff --git "a/IL2C.Core/AssemblyPreparer.cs" "b/IL2C.Core/AssemblyPreparer.cs"
index 12389a6..49d824f 100644
--- "a/IL2C.Core/AssemblyPreparer.cs"
+++ "b/IL2C.Core/AssemblyPreparer.cs"
@@ -322,7 +322,7 @@ namespace IL2C
                 // All types
                 type => true,
                 // The methods except type initializer.
-                method => !(method.IsConstructor && method.IsStatic));
+                method => true);
         }
     }
 }

from il2c.

kekyo avatar kekyo commented on August 23, 2024

@cyborgyn Sorry for the very delay. I understood #100 work and imported it with cherry-pick. 2cbb6f1

For the life of me, I can't remember why I excluded the Type initializer; it may have been due to the fact that I had not checked the initialization order of the Type initializer. (I still have not been able to confirm this.)
If the initialization order is affected by the ECMA335 specification, I may need to rework this area, but for now, I'll leave it at that.

from il2c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.