elm / compiler

Compiler for Elm, a functional language for reliable webapps.
https://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
7.48k stars 659 forks source link

Allow `.` in `import` alias #2260

Open lue-bird opened 2 years ago

lue-bird commented 2 years ago

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
github-actions[bot] commented 2 years ago

Thanks for reporting this! To set expectations:

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