Skip to content

Precompilation warnings due to method overwriting #80

@parrangoiz

Description

@parrangoiz

It seems like #73 may have introduced a bug; starting from a fresh environment, running

julia> ]add DeviceLayout
julia> using DeviceLayout

results in

Precompiling DeviceLayout...
Info Given DeviceLayout was explicitly requested, output will be shown live 
WARNING: Method definition (::Type{DeviceLayout.SchematicDrivenLayout.WeatherVane{T} where T})() in module SchematicDrivenLayout at /Users/arrangop/.julia/packages/DeviceLayout/niCRV/src/schematics/components/builtin_components.jl:6 overwritten at /Users/arrangop/.julia/packages/DeviceLayout/niCRV/src/schematics/components/builtin_components.jl:9.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
  ? DeviceLayout
[ Info: Precompiling DeviceLayout [ebf59a4a-04ec-49d7-8cd4-c9382ceb8e85] (cache misses: wrong source (6), mismatched flags (2))
WARNING: Method definition (::Type{DeviceLayout.SchematicDrivenLayout.WeatherVane{T} where T})() in module SchematicDrivenLayout at /Users/arrangop/.julia/packages/DeviceLayout/niCRV/src/schematics/components/builtin_components.jl:6 overwritten at /Users/arrangop/.julia/packages/DeviceLayout/niCRV/src/schematics/components/builtin_components.jl:9.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
┌ Info: Skipping precompilation due to precompilable error. Importing DeviceLayout [ebf59a4a-04ec-49d7-8cd4-c9382ceb8e85].
└   exception = Error when precompiling module, potentially caused by a __precompile__(false) declaration in the module.

I'm not sure why the second WeatherVane constructor (without the type parameter) is causing an overwrite of the first, which does have a type parameter. Could @compdef be transforming the code in a way that's causing this?

I'm using Julia 1.11.5 on an M2 Mac.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions