Giter Club home page Giter Club logo

Comments (4)

ap0llo avatar ap0llo commented on July 18, 2024

I tried to track down the problem by debugging into Cake.

The issue seems to be in ParameterEmitter.

It writes out all of the method parameter's attributes into the generated Cake script, including System.Runtime.CompilerServices.NullableAttribute.
But the nullable attribute is a little special, since it does not seem to exist in the BCL but instead the C# compiler generates it into the addin assembly as internal class.

image

This attribute is thus not visible to the generated Cake script, causing the compilation error.

I could see multiple ways to fix this

  • Add special handling for the Nullable attribute and simply ignore it when generating the alias method
  • Add special handling for the Nullable attribute and emit the proper nullability annotations in the generated script
    • This emits a warning though (usage of nullability annoations when nullable is not enabled)
  • Ignore all internal attributes (this might avoid similar problems in the future, but I'm not sure if this causes other issues)

I hope this information is helpful.
I'd be happy in assisting with a bugfix and provide a PR once I know what the fix should look like

from cake.

devlead avatar devlead commented on July 18, 2024

Ideally the proxy methods generated would have the same signature as the original addin extension method with the exception of the context being supplied.

The warnings could once be pragma disabled and enabled before and after method generation.

from cake.

ap0llo avatar ap0llo commented on July 18, 2024

Ideally the proxy methods generated would have the same signature as the original addin extension method with the exception of the context being supplied.

The warnings could once be pragma disabled and enabled before and after method generation.

Okay, so that would point to special-casing the "Nullable" attribute and emitting a ? in the proper places.
I'll see what I can come up with.

from cake.

cake-build-bot avatar cake-build-bot commented on July 18, 2024

🎉 This issue has been resolved in version v4.0.0 🎉

The release is available on:

Your GitReleaseManager bot 📦🚀

from cake.

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.