Closed 9999years closed 4 months ago
I tried making the LoadedModule
fields public and replacing ModuleSet
with HashSet<LoadedModule>
. The diff was +67 -148 (net -81 lines). I like the type safety and the implementation of ModuleSet
has changed before, so I'm inclined to keep it at least for now.
Previously, a
ModuleSet
wrapped aHashMap<NormalPath, TargetKind>
. This had a number of undesirable consequences:TargetKind
) were split from each other and difficult to reference.:unadd
ed modules we needed to format them as strings.Now, a
ModuleSet
wraps aHashSet<LoadedModule>
.A
LoadedModule
wraps a path but optionally contains the module's dotted name, if the module is loaded by name (and needs to be referred to by name to avoid the "module defined in multiple files" error).The
LoadedModule
Display
instance formats the module's import name correctly (with a dotted name if needed) and avoids hitting the disk or any string processing.[ ] Labeled the PR with
patch
,minor
, ormajor
to request a version bump when it's merged.[ ] Updated the user manual in
docs/
.[ ] Added integration / regression tests in
tests/
.