Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Transpilation bug - enums as class initial values #949

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

markwpearce
Copy link
Collaborator

Previously, there was a transpilation bug when using enums directly (eg. with no namespace prefix) inside a namespace... I was seeing it especially in classes.

                namespace MyNS
                    class HasEnumKlass
                        enumValue = MyEnum.A
                    end class

                    enum MyEnum
                        A = "A"
                        B = "B"
                    end enum
                end namespace

was being transpiled to (notice the MyEnum.A):

            function __MyNS_HasEnumKlass_builder()
                    instance = {}
                    instance.new = sub()
                        m.enumValue = MyEnum.A
                    end sub
                    return instance
                end function
                function MyNS_HasEnumKlass()
                    instance = __MyNS_HasEnumKlass_builder()
                    instance.new()
                    return instance
                end function

@markwpearce markwpearce changed the base branch from master to release-0.66.0 November 21, 2023 18:18
@markwpearce markwpearce changed the title Fixes Transpilation bugenums as class initial values Fixes Transpilation bug - enums as class initial values Nov 21, 2023
@markwpearce markwpearce merged commit 378c599 into release-0.66.0 Nov 21, 2023
4 checks passed
@markwpearce markwpearce deleted the fixes_enums_as_class_initial_values branch November 21, 2023 18:40
@TwitchBronBron TwitchBronBron added this to the v1.0.0 milestone Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants