compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Allow `.` in `import` alias

Open lue-bird opened this issue 2 years ago • 1 comments

Unlike module names, import aliases can't contain ..

import Tree.Path
import Tree.Path.Extra as Tree.Path

UNFINISHED IMPORT - I am partway through parsing an import, but I got stuck here:

import Tree.Path.Extra as Tree.Path
                             #^#

Here are some examples of valid import declarations: [..]

You are probably trying to import a different module, but try to make it look like one of these examples! [..]

This makes patterns like the above X.Y.Extra as X.Y a bit uglier (less aligned), less clear and more ambiguous:

import Tree.Path
import Tree.Path.Extra as TreePath

toNeighbour index =
    \treePath ->
        treePath
            |> TreePath.toParent
            |> Tree.Path.toChild index
  • elm 0.19.1

lue-bird avatar May 22 '22 07:05 lue-bird

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

github-actions[bot] avatar May 22 '22 07:05 github-actions[bot]