From ac7e39a752c41c06155e27e84404c67c1341065d Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Thu, 25 Jun 2020 14:28:48 +0100 Subject: spec!: remove Optional/build and Optional/fold --- dhall/tests/parser/success/builtinsB.txt | 2 +- .../failure/unit/LetWithNonterminatingAnnotation.txt | 12 ++++++++++++ .../failure/unit/RemovedBuiltinOptionalBuild.txt | 6 ++++++ .../failure/unit/RemovedBuiltinOptionalFold.txt | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt create mode 100644 dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt create mode 100644 dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt (limited to 'dhall/tests') diff --git a/dhall/tests/parser/success/builtinsB.txt b/dhall/tests/parser/success/builtinsB.txt index 4e3ed79..1005949 100644 --- a/dhall/tests/parser/success/builtinsB.txt +++ b/dhall/tests/parser/success/builtinsB.txt @@ -1 +1 @@ -λ(x : { field0 : Bool, field1 : Optional (Optional Bool), field2 : Natural, field3 : Integer, field4 : Double, field5 : Text, field6 : List (List Bool) }) → { field00 = Natural/fold, field01 = Natural/build, field02 = Natural/isZero, field03 = Natural/even, field04 = Natural/odd, field05 = Natural/toInteger, field06 = Natural/show, field07 = Integer/show, field08 = Double/show, field09 = List/build, field10 = List/fold, field11 = List/length, field12 = List/head, field13 = List/last, field14 = List/indexed, field15 = List/reverse, field16 = Optional/fold, field17 = Optional/build, field18 = True, field19 = False, field20 = None } +[Natural/fold, Natural/build, Natural/isZero, Natural/even, Natural/odd, Natural/toInteger, Natural/show, Integer/toDouble, Integer/show, Integer/negate, Integer/clamp, Natural/subtract, Double/show, List/build, List/fold, List/length, List/head, List/last, List/indexed, List/reverse, Text/show, Bool, True, False, Optional, None, Natural, Integer, Double, Text, List, Type, Kind, Sort] diff --git a/dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt b/dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt new file mode 100644 index 0000000..6e360da --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/LetWithNonterminatingAnnotation.txt @@ -0,0 +1,12 @@ +Type error: error: expected function, found `Natural` + --> :6:25 + | + 1 | -- When you check if an inferred type is equivalent to an annotation, + 2 | -- you must alpha-beta-normalize both sides first. But it is not safe + 3 | -- to beta-normalise an expression which hasn't first been + 4 | -- typechecked. +... +10 | let a +11 | : (λ(x : Natural) → x x) (λ(x : Natural) → x x) + | ^ function application requires a function + | diff --git a/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt new file mode 100644 index 0000000..e4e285c --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalBuild.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable ``Optional/build`` + --> :1:1 + | +1 | Optional/build + | ^^^^^^^^^^^^^^ not found in this scope + | diff --git a/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt new file mode 100644 index 0000000..3d6c6aa --- /dev/null +++ b/dhall/tests/type-inference/failure/unit/RemovedBuiltinOptionalFold.txt @@ -0,0 +1,6 @@ +Type error: error: unbound variable ``Optional/fold`` + --> :1:1 + | +1 | Optional/fold + | ^^^^^^^^^^^^^ not found in this scope + | -- cgit v1.2.3