Coder Social home page Coder Social logo

Comments (8)

opcfoundation-org avatar opcfoundation-org commented on August 26, 2024

Can you provide the places where the #nullable disable needs to go?

from ua-modelcompiler.

cho-regin avatar cho-regin commented on August 26, 2024

at the top of the .Classes.cs file and the .DataTypes.cs file. The files are riddled with nullable violations

from ua-modelcompiler.

opcfoundation-org avatar opcfoundation-org commented on August 26, 2024

Not surprising since the code was written before that feature existed in the C# language. But it also means that making it nullable compliant would break existing code so it can never be more than option that has to be enabled during generation.

from ua-modelcompiler.

opcfoundation-org avatar opcfoundation-org commented on August 26, 2024

Looks like #nullable disable is not an option given all the different frameworks that the Core library has to build against:
Error CS8370 Feature 'nullable reference types' is not available in C# 7.3. Please use language version 8.0 or greater.

See OPCFoundation/UA-.NETStandard#2300

from ua-modelcompiler.

cho-regin avatar cho-regin commented on August 26, 2024

crazy that there is no preprocessor switch that could help here... but a commandline switch during generation would be perfectly fine!

from ua-modelcompiler.

opcfoundation-org avatar opcfoundation-org commented on August 26, 2024

The language version is explicitly set to 7.3 in the Core library.
If you know a way to create a constant like this:

#if CSHARP_8_OR_NEWER
#nullable disable
#endif

Then it will be possible to update the generated code.
I tried to find a way to do it but none of them worked and I have no more time right now.

from ua-modelcompiler.

cho-regin avatar cho-regin commented on August 26, 2024

I also tried to find a solution like that but I could not find a pretty one. The best solution would be to add a nullable switch to the executable but then it would a bit much to add that switch just to print those three lines... Ideally it would be nice to have a switch to properly generate nullable enabled code but I realize that is not so simple...

from ua-modelcompiler.

opcfoundation-org avatar opcfoundation-org commented on August 26, 2024

Marked as nice-to-have enhancement but switching to nullable is not trival. It requires a rethink of almost every line of code.

from ua-modelcompiler.

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.