Elm Exactly
Results / elm /

InfixNoQualifiedOperatorTest

Tags:elm-spec

Checks, in A Standard Definition of Elm?:figure core-grammar-expressions

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
`1 Basics.+ 2` is not an expression: no operator is qualified.

A Standard Definition of Elm?, Section 2.7: there are no sections, and no operator is qualified.
The grammar of expressions has no phrase for a qualified operator. <https://elm-test-suite.netlify.app/standard/figures/core-grammar-expressions>

Results

elm-0.19.1

pass
Output
Compiling ...-- UNFINISHED PARENTHESES ----------------- src/InfixNoQualifiedOperatorTest.elm

I was expecting to see a closing parentheses next, but I got stuck here:

21|             Debug.log "sum" (1 Basics.+ 2)
                                   ^
Try adding a ) to see if that helps?

Note: I can get stuck when I run into keywords, operators, parentheses, or
brackets unexpectedly. So there may be some earlier syntax trouble (like extra
parenthesis or missing brackets) that is confusing me.

Detected problems in 1 module.

elm-0.19.2

pass
Output
Compiling ...-- UNFINISHED PARENTHESES ----------------- src/InfixNoQualifiedOperatorTest.elm

I was expecting to see a closing parentheses next, but I got stuck here:

21|             Debug.log "sum" (1 Basics.+ 2)
                                   ^
Try adding a ) to see if that helps?

Note: I can get stuck when I run into keywords, operators, parentheses, or
brackets unexpectedly. So there may be some earlier syntax trouble (like extra
parenthesis or missing brackets) that is confusing me.

Detected problems in 1 module.

elm-0.19.3

pass
Output
Compiling ...-- EXPECTING RECORD ACCESSOR -------------- src/InfixNoQualifiedOperatorTest.elm

I am trying to parse a record accessor here:

21|             Debug.log "sum" (1 Basics.+ 2)
                                          ^
Something like .name or .price that accesses a value from a record.

Note: Record field names must start with a lower case letter!

Detected problems in 1 module.

lamdera-1.5.0

pass
Output
Detected problems in 1 module.
-- EXPECTING RECORD ACCESSOR -------------- src/InfixNoQualifiedOperatorTest.elm

I am trying to parse a record accessor here:

21|             Debug.log "sum" (1 Basics.+ 2)
                                          ^
Something like .name or .price that accesses a value from a record.

Note: Record field names must start with a lower case letter!

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module InfixNoQualifiedOperatorTest exposing (main)
{-| `1 Basics.+ 2` is not an expression: no operator is qualified.
A Standard Definition of Elm?, Section 2.7: there are no sections, and no operator is qualified.
The grammar of expressions has no phrase for a qualified operator. <https://elm-test-suite.netlify.app/standard/figures/core-grammar-expressions>
-}
-- TAGS: elm-spec, fig:core-grammar-expressions
-- COMPILE-ERROR: a qualified operator
-- CHECK: {{-- [A-Z ]+ -}}
-- CHECK-NOT: TYPE MISMATCH
import Html
main =
let
_ =
Debug.log "sum" (1 Basics.+ 2)
in
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. 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.