HeaderExposesTwiceTest
Tags:elm-spec
Checks, in A Standard Definition of Elm?:restriction modules-exposing-distinct
Not translated into Lean for the mechanisation of the book: see why.
No item may occur twice in a header's exposing list. A Standard Definition of Elm?, restriction modules-exposing-distinct: no two items of the exposing list of a header may have the same identifier. <https://elm-test-suite.netlify.app/standard/restrictions/modules-exposing-distinct>
Results
elm-0.19.1
passOutput
Compiling ...-- REDUNDANT EXPORT ----------------------------- src/HeaderExposesTwiceTest.elm
You are trying to expose `main` multiple times!
1| module HeaderExposesTwiceTest exposing (main, main)
^^^^ ^^^^
Remove one of them and you should be all set!
Detected problems in 1 module.
elm-0.19.2
passOutput
Compiling ...-- REDUNDANT EXPORT ----------------------------- src/HeaderExposesTwiceTest.elm
You are trying to expose `main` multiple times!
0| module HeaderExposesTwiceTest exposing (main, main)
^^^^ ^^^^
Remove one of them and you should be all set!
Detected problems in 1 module.
elm-0.19.3
passOutput
Compiling ...-- REDUNDANT EXPORT ----------------------------- src/HeaderExposesTwiceTest.elm
You are trying to expose `main` multiple times!
0| module HeaderExposesTwiceTest exposing (main, main)
^^^^ ^^^^
Remove one of them and you should be all set!
Detected problems in 1 module.
lamdera-1.5.0
passOutput
Detected problems in 1 module.
-- REDUNDANT EXPORT ----------------------------- src/HeaderExposesTwiceTest.elm
You are trying to expose `main` multiple times!
0| module HeaderExposesTwiceTest exposing (main, main)
^^^^ ^^^^
Remove one of them and you should be all set!
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/HeaderExposesTwiceTest] in its title.
Source
The -- CHECK: lines give the expected output.
module HeaderExposesTwiceTest exposing (main, main)
{-| No item may occur twice in a header's exposing list.
A Standard Definition of Elm?, restriction modules-exposing-distinct: no two items of the exposing
list of a header may have the same identifier. <https://elm-test-suite.netlify.app/standard/restrictions/modules-exposing-distinct>
-}
-- TAGS: elm-spec, modules-exposing-distinct
-- COMPILE-ERROR: a header exposing main twice
-- CHECK: {{-- [A-Z ]+ -}}
import Html
main =
Html.text "done"
Lean translation
No reduced program for Lean's evaluator: the test expects a compile error, so it has no meaning to evaluate. Lean has the program as written, in source syntax, and proves what the static semantics says of it (below). See the Lean mechanisation for which tests are in Lean, and why.
Static semantics: Lean proves that the program as written is not legal, so a compiler must reject it (refuse_elm_HeaderExposesTwiceTest, in StandardElmMech/Certs/). The program breaks a syntactic restriction, which the kernel checks on its syntax tree; no type inference is involved (Stat.not_legal_of_syn): res:modules-exposing-distinct. It holds for every derivation, with no hypothesis about principality.