Elm Exactly
Results / elm /

ImportAliasQualifiedTest

Tags:elm-spec

Checks, in A Standard Definition of Elm?:restriction modules-import-alias

Not translated into Lean for the mechanisation of the book: see why.

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
The name after `as` in an import is a single upper-case identifier.

A Standard Definition of Elm?, restriction modules-import-alias: `import Html as H.X` gives a
qualified name as the alias, so the program is rejected. <https://elm-test-suite.netlify.app/standard/restrictions/modules-import-alias>

Results

elm-0.19.1

pass
Output
Compiling ...-- UNFINISHED IMPORT -------------------------- src/ImportAliasQualifiedTest.elm

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

14| import Html as H.X
                    ^
Here are some examples of valid `import` declarations:

    import Html
    import Html as H
    import Html as H exposing (..)
    import Html exposing (Html, div, text)

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

Read <https://elm-lang.org/0.19.1/imports> to learn more.

Detected problems in 1 module.

elm-0.19.2

pass
Output
Compiling ...-- UNFINISHED IMPORT -------------------------- src/ImportAliasQualifiedTest.elm

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

14| import Html as H.X
                    ^
Here are some examples of valid `import` declarations:

    import Html
    import Html as H
    import Html as H exposing (..)
    import Html exposing (Html, div, text)

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

Read <https://elm-lang.org/0.19.2/imports> to learn more.

Detected problems in 1 module.

elm-0.19.3

pass
Output
Compiling ...-- UNFINISHED IMPORT -------------------------- src/ImportAliasQualifiedTest.elm

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

14| import Html as H.X
                    ^
Here are some examples of valid `import` declarations:

    import Html
    import Html as H
    import Html as H exposing (..)
    import Html exposing (Html, div, text)

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

Read <https://elm-lang.org/0.19.3/imports> to learn more.

Detected problems in 1 module.

lamdera-1.5.0

pass
Output
Detected problems in 1 module.
-- UNFINISHED IMPORT -------------------------- src/ImportAliasQualifiedTest.elm

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

14| import Html as H.X
                    ^
Here are some examples of valid `import` declarations:

    import Html
    import Html as H
    import Html as H exposing (..)
    import Html exposing (Html, div, text)

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

Read <https://elm-lang.org/0.19.3/imports> to learn more.

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm/ImportAliasQualifiedTest] in its title.

Source

The -- CHECK: lines give the expected output.

module ImportAliasQualifiedTest exposing (main)
{-| The name after `as` in an import is a single upper-case identifier.
A Standard Definition of Elm?, restriction modules-import-alias: `import Html as H.X` gives a
qualified name as the alias, so the program is rejected. <https://elm-test-suite.netlify.app/standard/restrictions/modules-import-alias>
-}
-- TAGS: elm-spec, modules-import-alias
-- COMPILE-ERROR: an import alias with a dot
-- CHECK: {{-- [A-Z ]+ -}}
import Html as H.X
main =
H.X.text "done"

Lean translation

No reduced program for Lean's evaluator: the test expects a compile error, so it has no meaning to evaluate. Static semantics: expected to be rejected, and eco's parser rejects it too. See the Lean mechanisation for which tests are in Lean, and why.