Skip to content

Macro hygienization doesn't consider type declarations to be assignments #8554

@toivoh

Description

@toivoh

E.g., in the following code I would expect that MyType gets replaced by a gensym, but instead it creates an actual type definition for MyType:

julia> macro def_my_type()
           quote
               type MyType
               end
           end
       end

julia> @def_my_type

julia> MyType()
MyType()

If I add an inner constructor hygienization takes place, since the constructor definition is taken as a form of assignment to MyType.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions