HeaderExposesAliasOpenTest
Tags:elm-spec
Checks, in A Standard Definition of Elm?:restriction modules-header-exposing
Not translated into Lean for the mechanisation of the book: see why.
A header cannot expose a type alias with `(..)`. A Standard Definition of Elm?, restriction modules-header-exposing: each item `T(..)` of a header is the type of a custom-type binding, never of a type alias. <https://elm-test-suite.netlify.app/standard/restrictions/modules-header-exposing>
Results
elm-0.19.1
passOutput
Compiling ...-- BAD EXPORT ------------------------------- src/HeaderExposesAliasOpenTest.elm
The (..) syntax is for exposing variants of a custom type. It cannot be used
with a type alias like `Name` though.
1| module HeaderExposesAliasOpenTest exposing (Name(..), main)
^^
Remove the (..) and you should be fine!
Detected problems in 1 module.
elm-0.19.2
passOutput
Compiling ...-- BAD EXPORT ------------------------------- src/HeaderExposesAliasOpenTest.elm
The (..) syntax is for exposing variants of a custom type. It cannot be used
with a type alias like `Name` though.
1| module HeaderExposesAliasOpenTest exposing (Name(..), main)
^^
Remove the (..) and you should be fine!
Detected problems in 1 module.
elm-0.19.3
passOutput
Compiling ...-- BAD EXPORT ------------------------------- src/HeaderExposesAliasOpenTest.elm
The (..) syntax is for exposing variants of a custom type. It cannot be used
with a type alias like `Name` though.
1| module HeaderExposesAliasOpenTest exposing (Name(..), main)
^^
Remove the (..) and you should be fine!
Detected problems in 1 module.
lamdera-1.5.0
passOutput
Detected problems in 1 module.
-- BAD EXPORT ------------------------------- src/HeaderExposesAliasOpenTest.elm
The (..) syntax is for exposing variants of a custom type. It cannot be used
with a type alias like `Name` though.
1| module HeaderExposesAliasOpenTest exposing (Name(..), main)
^^
Remove the (..) and you should be fine!
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm/HeaderExposesAliasOpenTest] in its title.
Source
The -- CHECK: lines give the expected output.
module HeaderExposesAliasOpenTest exposing (Name(..), main)
{-| A header cannot expose a type alias with `(..)`.
A Standard Definition of Elm?, restriction modules-header-exposing: each item `T(..)` of a header
is the type of a custom-type binding, never of a type alias. <https://elm-test-suite.netlify.app/standard/restrictions/modules-header-exposing>
-}
-- TAGS: elm-spec, modules-header-exposing
-- COMPILE-ERROR: a header exposing an alias with (..)
-- CHECK: {{-- [A-Z ]+ -}}
import Html
type alias Name =
String
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_HeaderExposesAliasOpenTest, 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-header-exposing. It holds for every derivation, with no hypothesis about principality.