-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This is because of patterns like this:
module PackageModule
struct Foo end
module InnerModule
using ..PackageModule
foo() = cond() ? (x isa Foo) : nothing
end
Inner.foo() # when inferring foo(), Foo has no binding it can be resolved to
export Foo # by exporting, Foo inside foo() suddenly resolves to a binding, so the code is invalidated
end
Essentially, an inner module has an implicit import (using ..PackageModule
) which picks up an outer type Foo
, but only after the export Foo
is executed at the outer level.
The meaning of Foo
changes once export Foo
is executed, causing invalidation. As a concrete example, this kind of thing happens in practice for StructuralTransformations._distribute_shift
and export Pre
when pre-compiling current master
MTK.
That's an easy bug to fix, and has a very small impact on latency anyway, but I wanted to open the issue for awareness.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working