Coder Social home page Coder Social logo

[Codegen] overloaded fromRawValue across modules for ArrayEnum props with type alias uint32_t cause runtime crash about react-native HOT 7 OPEN

netmaxt3r avatar netmaxt3r commented on May 3, 2024
[Codegen] overloaded fromRawValue across modules for ArrayEnum props with type alias uint32_t cause runtime crash

from react-native.

Comments (7)

Martin2037 avatar Martin2037 commented on May 3, 2024 1

same problem, need help

from react-native.

cortinico avatar cortinico commented on May 3, 2024 1

One possible solution i see is using strong warapper class/struct for alias types

@netmaxt3r I believe the best solution would be the one you suggested, to wrap the types into a struct and use them so the overload resolution won't be ambiguous.
If you could send over a PR to draft this fix, we can look into merging it (or see if there are any blockers)

from react-native.

netmaxt3r avatar netmaxt3r commented on May 3, 2024 1

@cortinico please see PR #44123 , I am pretty new to codegen, i need to figure out the call stack for static inline std::string toString(const ${enumMask}Wrapped &wrapped) function and check other platforms + update jest snapshots. Please review changes with internal team if i missed any scenario.

from react-native.

cortinico avatar cortinico commented on May 3, 2024

Thanks for the reproducer @netmaxt3r

One possible solution i see is using strong warapper class/struct for alias types, Or is there any compiler flag we can use to fix function overloading?

Type wrappers could be a solution here, or we could qualify the fromRawValue function with the module name so they won't clash at runtime.

Let me get back to you on potential solution here.

from react-native.

netmaxt3r avatar netmaxt3r commented on May 3, 2024

we could qualify the fromRawValue function with the module name

we need to consider single module having multiple array enum props as well , which could clash each other in this case

from react-native.

cortinico avatar cortinico commented on May 3, 2024

we could qualify the fromRawValue function with the module name

we need to consider single module having multiple array enum props as well , which could clash each other in this case

Ah that's also a really valid scenario

from react-native.

netmaxt3r avatar netmaxt3r commented on May 3, 2024

@cortinico any news on the possible approach to fix this ? If i get direction i can start working on a PR

from react-native.

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.