Comments (2)
I have taken a look in to this today and found a few things I want to note for myself (or another fixer)...
- This code uses a
NameVisitor
to look at each Type used in isolation; this means that we don't have any information about the type alias when it is being reported on. - Using a
declarationListVisitor
will mean that we can note that a Type is being shadowed and possibly ignore it, however this may mean that any fully qualified use of the type will also have to be ignored (possible false positive), unless the NameVisitor is removed (big effort). - Since the NameVisitor also uses a declarationListVisitor, it may be necessary to defer error reporting until final module evaluation, and gather possible naughty Types in the context until then (some effort). At the moment errors are returned directly from the visitors.
from elm-review-imports.
Thank-you for the SSCCE. Some more context for this, so that it's not lost. The original bug report on Slack...
I'm running into a bit of a problem with elm-review. I have something like
module MyModule exposing (Thing) import MyModule.Internal exposing (Thing(..)) type alias Thing = MyModule.Internal.Thing ... functions that use Thing(..) ...Now elm-review complains about the
type alias
and wants to change it totype alias Thing = Thing
which does not compile.I can easily work around the problem locally, of course, but I am wondering if elm-review could be made to handle this?
from elm-review-imports.
Related Issues (14)
- Ensure Consistent Aliases
- Check for default exposes HOT 1
- Discussion: Allow multiple aliases? HOT 4
- Collision detection with preferred aliases HOT 1
- Alternate way to configure consistent alias rule HOT 2
- NoModuleOnExposedName fix can introduce name collision HOT 6
- Enforce preferred names
- Applying the fix doesn't always update instances of Module.Constructor HOT 3
- Enforce consistency for every alias
- Shadowing issue with record pattern matching for NoModuleOnExposedNames
- Enforce use of an alias when one is known
- Do not allow exposed names to be qualified HOT 1
- False negative on `Json.Decode` when `Json.Decode.Extra` import is also present
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-review-imports.