From fa6de4c077ab4f1c28d2ec64a33a3be8c5a9bb1c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 22 Dec 2019 18:24:21 +0000 Subject: Update dhall-lang submodule --- dhall/src/error/mod.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'dhall/src/error') diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs index 1288c12..40cccac 100644 --- a/dhall/src/error/mod.rs +++ b/dhall/src/error/mod.rs @@ -76,6 +76,7 @@ pub(crate) enum TypeMessage { MergeHandlerReturnTypeMustNotBeDependent, ProjectionMustBeRecord, ProjectionMissingEntry, + ProjectionDuplicateField, Sort, RecordTypeDuplicateField, RecordTypeMergeRequiresRecordType(Value), -- cgit v1.3.1 From f22eb87b7a7aeccfa556dcdb56148e89cee023db Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 24 Dec 2019 18:10:12 +0000 Subject: Add debug output to unhandled type error message --- dhall/src/error/mod.rs | 2 +- dhall/tests/type-errors/mixedUnions.txt | 2 +- dhall/tests/type-errors/recordOfKind.txt | 2 +- dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt | 2 +- dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt | 2 +- dhall/tests/type-errors/unit/AssertDoubleZeros.txt | 2 +- dhall/tests/type-errors/unit/AssertNotEquivalence.txt | 2 +- dhall/tests/type-errors/unit/AssertTriviallyFalse.txt | 2 +- dhall/tests/type-errors/unit/EquivalenceNotSameType.txt | 2 +- dhall/tests/type-errors/unit/EquivalenceNotTerms.txt | 2 +- dhall/tests/type-errors/unit/FunctionTypeKindSort.txt | 2 +- dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt | 2 +- dhall/tests/type-errors/unit/IfBranchesNotMatch.txt | 2 +- dhall/tests/type-errors/unit/IfBranchesNotType.txt | 2 +- dhall/tests/type-errors/unit/IfNotBool.txt | 2 +- dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt | 2 +- dhall/tests/type-errors/unit/ListLiteralNotType.txt | 2 +- dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt | 2 +- dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt | 2 +- dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt | 2 +- dhall/tests/type-errors/unit/MergeAnnotationNotType.txt | 2 +- dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt | 2 +- dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt | 2 +- dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt | 2 +- dhall/tests/type-errors/unit/MergeHandlerFreeVar.txt | 2 +- dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt | 2 +- dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt | 2 +- dhall/tests/type-errors/unit/MergeLhsNotRecord.txt | 2 +- dhall/tests/type-errors/unit/MergeMissingHandler1.txt | 2 +- dhall/tests/type-errors/unit/MergeMissingHandler2.txt | 2 +- dhall/tests/type-errors/unit/MergeRhsNotUnion.txt | 2 +- dhall/tests/type-errors/unit/MergeUnusedHandler.txt | 2 +- dhall/tests/type-errors/unit/OperatorAndNotBool.txt | 2 +- dhall/tests/type-errors/unit/OperatorEqualNotBool.txt | 2 +- dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt | 2 +- dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt | 2 +- .../tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt | 2 +- dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt | 2 +- dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt | 2 +- dhall/tests/type-errors/unit/OperatorOrNotBool.txt | 2 +- dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt | 2 +- dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt | 2 +- dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt | 2 +- dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt | 2 +- dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt | 2 +- dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt | 2 +- dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt | 2 +- dhall/tests/type-errors/unit/RecordMixedKinds3.txt | 2 +- dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt | 2 +- dhall/tests/type-errors/unit/RecordProjectionEmpty.txt | 2 +- dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt | 2 +- dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt | 2 +- dhall/tests/type-errors/unit/RecordSelectionEmpty.txt | 2 +- dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt | 2 +- dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt | 2 +- dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt | 2 +- dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt | 2 +- dhall/tests/type-errors/unit/RecordTypeValueMember.txt | 2 +- dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt | 2 +- dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt | 2 +- dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt | 2 +- .../tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt | 2 +- dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt | 2 +- .../tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt | 2 +- dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt | 2 +- dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt | 2 +- dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt | 2 +- dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt | 2 +- dhall/tests/type-errors/unit/SomeNotType.txt | 2 +- dhall/tests/type-errors/unit/Sort.txt | 2 +- dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt | 2 +- dhall/tests/type-errors/unit/TypeAnnotationWrong.txt | 2 +- dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt | 2 +- dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt | 2 +- dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt | 2 +- dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt | 2 +- dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt | 2 +- dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt | 2 +- dhall/tests/type-errors/unit/UnionTypeNotType.txt | 2 +- 79 files changed, 79 insertions(+), 79 deletions(-) (limited to 'dhall/src/error') diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs index 40cccac..8976478 100644 --- a/dhall/src/error/mod.rs +++ b/dhall/src/error/mod.rs @@ -125,7 +125,7 @@ impl std::fmt::Display for TypeError { y )) } - _ => "Type error: Unhandled error".to_string(), + _ => format!("Type error: Unhandled error: {:?}", self.message), }; write!(f, "{}", msg) } diff --git a/dhall/tests/type-errors/mixedUnions.txt b/dhall/tests/type-errors/mixedUnions.txt index 4b68fea..30fcdf8 100644 --- a/dhall/tests/type-errors/mixedUnions.txt +++ b/dhall/tests/type-errors/mixedUnions.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidFieldType(Label("Right"), Type) diff --git a/dhall/tests/type-errors/recordOfKind.txt b/dhall/tests/type-errors/recordOfKind.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/recordOfKind.txt +++ b/dhall/tests/type-errors/recordOfKind.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt b/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt index 4b68fea..e15da48 100644 --- a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt +++ b/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldName.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AnnotMismatch(Value@Unevaled { value: PartialExpr(RecordLit(DupTreeMap { map: {Label("x"): [Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@Unevaled { value: AppliedBuiltin(Natural, []), type: Type } }]}, size: 1 })), type: Value@WHNF { value: RecordType({Label("x"): Value@Unevaled { value: AppliedBuiltin(Natural, []), type: Type }}), type: Type } }, Value@WHNF { value: RecordType({Label("y"): Value@Unevaled { value: AppliedBuiltin(Natural, []), type: Type }}), type: Type }) diff --git a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt b/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt index 4b68fea..16b2d83 100644 --- a/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt +++ b/dhall/tests/type-errors/unit/AnnotationRecordWrongFieldType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AnnotMismatch(Value@Unevaled { value: PartialExpr(RecordLit(DupTreeMap { map: {Label("x"): [Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }]}, size: 1 })), type: Value@WHNF { value: RecordType({Label("x"): Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type }}), type: Type } }, Value@WHNF { value: RecordType({Label("x"): Value@WHNF { value: AppliedBuiltin(Text, []), type: Type }}), type: Type }) diff --git a/dhall/tests/type-errors/unit/AssertDoubleZeros.txt b/dhall/tests/type-errors/unit/AssertDoubleZeros.txt index 4b68fea..d9df5c7 100644 --- a/dhall/tests/type-errors/unit/AssertDoubleZeros.txt +++ b/dhall/tests/type-errors/unit/AssertDoubleZeros.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AssertMismatch(Value@WHNF { value: DoubleLit(NaiveDouble(-0.0)), type: Value@WHNF { value: AppliedBuiltin(Double, []), type: Type } }, Value@WHNF { value: DoubleLit(NaiveDouble(0.0)), type: Value@WHNF { value: AppliedBuiltin(Double, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/AssertNotEquivalence.txt b/dhall/tests/type-errors/unit/AssertNotEquivalence.txt index 4b68fea..537d31a 100644 --- a/dhall/tests/type-errors/unit/AssertNotEquivalence.txt +++ b/dhall/tests/type-errors/unit/AssertNotEquivalence.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AssertMustTakeEquivalence diff --git a/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt b/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt index 4b68fea..c7bbf8d 100644 --- a/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt +++ b/dhall/tests/type-errors/unit/AssertTriviallyFalse.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AssertMismatch(Value@WHNF { value: NaturalLit(1), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }, Value@WHNF { value: NaturalLit(2), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt b/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt index 4b68fea..4dbe2ad 100644 --- a/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt +++ b/dhall/tests/type-errors/unit/EquivalenceNotSameType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: EquivalenceTypeMismatch(Value@Unevaled { value: PartialExpr(BoolLit(false)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt b/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt index 4b68fea..dbce067 100644 --- a/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt +++ b/dhall/tests/type-errors/unit/EquivalenceNotTerms.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: EquivalenceArgumentMustBeTerm(true, Value@Unevaled { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt b/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt +++ b/dhall/tests/type-errors/unit/FunctionTypeKindSort.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt b/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt +++ b/dhall/tests/type-errors/unit/FunctionTypeTypeSort.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt b/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt index 4b68fea..262e54f 100644 --- a/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt +++ b/dhall/tests/type-errors/unit/IfBranchesNotMatch.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: IfBranchMismatch(Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }, Value@Unevaled { value: PartialExpr(TextLit(InterpolatedText { head: "", tail: [] })), type: Value@WHNF { value: AppliedBuiltin(Text, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/IfBranchesNotType.txt b/dhall/tests/type-errors/unit/IfBranchesNotType.txt index 4b68fea..8ef3a40 100644 --- a/dhall/tests/type-errors/unit/IfBranchesNotType.txt +++ b/dhall/tests/type-errors/unit/IfBranchesNotType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: IfBranchMustBeTerm(true, Type) diff --git a/dhall/tests/type-errors/unit/IfNotBool.txt b/dhall/tests/type-errors/unit/IfNotBool.txt index 4b68fea..64c0465 100644 --- a/dhall/tests/type-errors/unit/IfNotBool.txt +++ b/dhall/tests/type-errors/unit/IfNotBool.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidPredicate(Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt b/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt index 4b68fea..0862162 100644 --- a/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt +++ b/dhall/tests/type-errors/unit/LetWithWrongAnnotation.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AnnotMismatch(Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }, Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/ListLiteralNotType.txt b/dhall/tests/type-errors/unit/ListLiteralNotType.txt index 4b68fea..99b95a3 100644 --- a/dhall/tests/type-errors/unit/ListLiteralNotType.txt +++ b/dhall/tests/type-errors/unit/ListLiteralNotType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidListType(Type) diff --git a/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt b/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt index 4b68fea..7916dbb 100644 --- a/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt +++ b/dhall/tests/type-errors/unit/ListLiteralTypesNotMatch.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidListElement(1, Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt b/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt index 4b68fea..d4e9024 100644 --- a/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt +++ b/dhall/tests/type-errors/unit/MergeAlternativeHasNoHandler.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeVariantMissingHandler(Label("x")) diff --git a/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt b/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt index 4b68fea..823f2f7 100644 --- a/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt +++ b/dhall/tests/type-errors/unit/MergeAnnotationMismatch.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeAnnotMismatch diff --git a/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt b/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt index 4b68fea..852634a 100644 --- a/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt +++ b/dhall/tests/type-errors/unit/MergeAnnotationNotType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Merge2ArgMustBeUnion(Value@Unevaled { value: UnionType({}), type: Type }) diff --git a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt b/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt index 4b68fea..563b3bf 100644 --- a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt +++ b/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation1.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeEmptyNeedsAnnotation diff --git a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt b/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt index 4b68fea..563b3bf 100644 --- a/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt +++ b/dhall/tests/type-errors/unit/MergeEmptyNeedsDirectAnnotation2.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeEmptyNeedsAnnotation diff --git a/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt b/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt index 4b68fea..852634a 100644 --- a/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt +++ b/dhall/tests/type-errors/unit/MergeEmptyWithoutAnnotation.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Merge2ArgMustBeUnion(Value@Unevaled { value: UnionType({}), type: Type }) diff --git a/dhall/tests/type-errors/unit/MergeHandlerFreeVar.txt b/dhall/tests/type-errors/unit/MergeHandlerFreeVar.txt index 4b68fea..de9e256 100644 --- a/dhall/tests/type-errors/unit/MergeHandlerFreeVar.txt +++ b/dhall/tests/type-errors/unit/MergeHandlerFreeVar.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeHandlerReturnTypeMustNotBeDependent diff --git a/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt b/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt index 4b68fea..852634a 100644 --- a/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt +++ b/dhall/tests/type-errors/unit/MergeHandlerNotInUnion.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Merge2ArgMustBeUnion(Value@Unevaled { value: UnionType({}), type: Type }) diff --git a/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt b/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt index 4b68fea..8b729a4 100644 --- a/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt +++ b/dhall/tests/type-errors/unit/MergeHandlersWithDifferentType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeHandlerTypeMismatch diff --git a/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt b/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt index 4b68fea..da600de 100644 --- a/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt +++ b/dhall/tests/type-errors/unit/MergeLhsNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Merge1ArgMustBeRecord(Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/MergeMissingHandler1.txt b/dhall/tests/type-errors/unit/MergeMissingHandler1.txt index 4b68fea..d4e9024 100644 --- a/dhall/tests/type-errors/unit/MergeMissingHandler1.txt +++ b/dhall/tests/type-errors/unit/MergeMissingHandler1.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeVariantMissingHandler(Label("x")) diff --git a/dhall/tests/type-errors/unit/MergeMissingHandler2.txt b/dhall/tests/type-errors/unit/MergeMissingHandler2.txt index 4b68fea..d583de7 100644 --- a/dhall/tests/type-errors/unit/MergeMissingHandler2.txt +++ b/dhall/tests/type-errors/unit/MergeMissingHandler2.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeVariantMissingHandler(Label("y")) diff --git a/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt b/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt index 4b68fea..0872642 100644 --- a/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt +++ b/dhall/tests/type-errors/unit/MergeRhsNotUnion.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Merge2ArgMustBeUnion(Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/MergeUnusedHandler.txt b/dhall/tests/type-errors/unit/MergeUnusedHandler.txt index 4b68fea..b7eefdd 100644 --- a/dhall/tests/type-errors/unit/MergeUnusedHandler.txt +++ b/dhall/tests/type-errors/unit/MergeUnusedHandler.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MergeHandlerMissingVariant(Label("y")) diff --git a/dhall/tests/type-errors/unit/OperatorAndNotBool.txt b/dhall/tests/type-errors/unit/OperatorAndNotBool.txt index 4b68fea..a4346f2 100644 --- a/dhall/tests/type-errors/unit/OperatorAndNotBool.txt +++ b/dhall/tests/type-errors/unit/OperatorAndNotBool.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(BoolAnd, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt b/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt index 4b68fea..57f9095 100644 --- a/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt +++ b/dhall/tests/type-errors/unit/OperatorEqualNotBool.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(BoolEQ, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt index 4b68fea..2bcb4fc 100644 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt +++ b/dhall/tests/type-errors/unit/OperatorListConcatenateLhsNotList.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(ListAppend, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt index 4b68fea..e314702 100644 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt +++ b/dhall/tests/type-errors/unit/OperatorListConcatenateListsNotMatch.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(ListAppend, Value@Unevaled { value: PartialExpr(NEListLit([Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }])), type: Value@WHNF { value: AppliedBuiltin(List, [Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type }]), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt index 4b68fea..2bcb4fc 100644 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt +++ b/dhall/tests/type-errors/unit/OperatorListConcatenateNotListsButMatch.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(ListAppend, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt b/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt index 4b68fea..2bcb4fc 100644 --- a/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt +++ b/dhall/tests/type-errors/unit/OperatorListConcatenateRhsNotList.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(ListAppend, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt b/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt index 4b68fea..32b3549 100644 --- a/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt +++ b/dhall/tests/type-errors/unit/OperatorNotEqualNotBool.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(BoolNE, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorOrNotBool.txt b/dhall/tests/type-errors/unit/OperatorOrNotBool.txt index 4b68fea..f91bd83 100644 --- a/dhall/tests/type-errors/unit/OperatorOrNotBool.txt +++ b/dhall/tests/type-errors/unit/OperatorOrNotBool.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(BoolOr, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt b/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt index 4b68fea..9194f3a 100644 --- a/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt +++ b/dhall/tests/type-errors/unit/OperatorPlusNotNatural.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(NaturalPlus, Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt b/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt index 4b68fea..e67e9e5 100644 --- a/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt +++ b/dhall/tests/type-errors/unit/OperatorTextConcatenateLhsNotText.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(TextAppend, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt b/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt index 4b68fea..e67e9e5 100644 --- a/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt +++ b/dhall/tests/type-errors/unit/OperatorTextConcatenateRhsNotText.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(TextAppend, Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt b/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt index 4b68fea..8146ba9 100644 --- a/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt +++ b/dhall/tests/type-errors/unit/OperatorTimesNotNatural.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: BinOpTypeMismatch(NaturalTimes, Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt b/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt index 4b68fea..c319c81 100644 --- a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt +++ b/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxAbsent.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidListType(Value@WHNF { value: AppliedBuiltin(Optional, [Value@Unevaled { value: AppliedBuiltin(Bool, []), type: Type }]), type: Type }) diff --git a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt b/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt index 4b68fea..99df27c 100644 --- a/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt +++ b/dhall/tests/type-errors/unit/OptionalDeprecatedSyntaxPresent.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AnnotMismatch(Value@Unevaled { value: PartialExpr(NEListLit([Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@Unevaled { value: AppliedBuiltin(Natural, []), type: Type } }])), type: Value@WHNF { value: AppliedBuiltin(List, [Value@Unevaled { value: AppliedBuiltin(Natural, []), type: Type }]), type: Type } }, Value@WHNF { value: AppliedBuiltin(Optional, [Value@Unevaled { value: AppliedBuiltin(Natural, []), type: Type }]), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt b/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt index 4b68fea..4fc4a50 100644 --- a/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt +++ b/dhall/tests/type-errors/unit/RecordLitDuplicateFields.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeDuplicateField diff --git a/dhall/tests/type-errors/unit/RecordMixedKinds3.txt b/dhall/tests/type-errors/unit/RecordMixedKinds3.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/unit/RecordMixedKinds3.txt +++ b/dhall/tests/type-errors/unit/RecordMixedKinds3.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt b/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt index 4b68fea..0d2e83e 100644 --- a/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt +++ b/dhall/tests/type-errors/unit/RecordProjectionDuplicateFields.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: ProjectionDuplicateField diff --git a/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt b/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt index 4b68fea..ddbe5e4 100644 --- a/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt +++ b/dhall/tests/type-errors/unit/RecordProjectionEmpty.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: ProjectionMissingEntry diff --git a/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt b/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt index 4b68fea..ddbe5e4 100644 --- a/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt +++ b/dhall/tests/type-errors/unit/RecordProjectionNotPresent.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: ProjectionMissingEntry diff --git a/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt b/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt index 4b68fea..cb4b52f 100644 --- a/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt +++ b/dhall/tests/type-errors/unit/RecordProjectionNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: ProjectionMustBeRecord diff --git a/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt b/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt index 4b68fea..1770faa 100644 --- a/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt +++ b/dhall/tests/type-errors/unit/RecordSelectionEmpty.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MissingRecordField(Label("x"), Value@Unevaled { value: PartialExpr(RecordLit(DupTreeMap { map: {}, size: 0 })), type: Value@WHNF { value: RecordType({}), type: Type } }) diff --git a/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt b/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt index 4b68fea..9211e05 100644 --- a/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt +++ b/dhall/tests/type-errors/unit/RecordSelectionNotPresent.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MissingRecordField(Label("x"), Value@Unevaled { value: PartialExpr(RecordLit(DupTreeMap { map: {Label("y"): [Value@Unevaled { value: PartialExpr(RecordLit(DupTreeMap { map: {}, size: 0 })), type: Value@Unevaled { value: RecordType({}), type: Type } }]}, size: 1 })), type: Value@WHNF { value: RecordType({Label("y"): Value@Unevaled { value: RecordType({}), type: Type }}), type: Type } }) diff --git a/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt b/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt index 4b68fea..27db6a2 100644 --- a/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt +++ b/dhall/tests/type-errors/unit/RecordSelectionNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: NotARecord(Label("x"), Value@WHNF { value: BoolLit(true), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt b/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt index 4b68fea..36c8e28 100644 --- a/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt +++ b/dhall/tests/type-errors/unit/RecordSelectionTypeNotUnionType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: NotARecord(Label("x"), Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt b/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt index 4b68fea..4fc4a50 100644 --- a/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt +++ b/dhall/tests/type-errors/unit/RecordTypeDuplicateFields.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeDuplicateField diff --git a/dhall/tests/type-errors/unit/RecordTypeValueMember.txt b/dhall/tests/type-errors/unit/RecordTypeValueMember.txt index 4b68fea..72d4316 100644 --- a/dhall/tests/type-errors/unit/RecordTypeValueMember.txt +++ b/dhall/tests/type-errors/unit/RecordTypeValueMember.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidFieldType(Label("x"), Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt b/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt index 4b68fea..42cdf65 100644 --- a/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt +++ b/dhall/tests/type-errors/unit/RecursiveRecordMergeLhsNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeMergeRequiresRecordType(Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt b/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt index 4b68fea..42cdf65 100644 --- a/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt +++ b/dhall/tests/type-errors/unit/RecursiveRecordMergeOverlapping.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeMergeRequiresRecordType(Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt b/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt index 4b68fea..42cdf65 100644 --- a/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt +++ b/dhall/tests/type-errors/unit/RecursiveRecordMergeRhsNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeMergeRequiresRecordType(Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt index 4b68fea..42cdf65 100644 --- a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt +++ b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeLhsNotRecordType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeMergeRequiresRecordType(Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt index 4b68fea..42cdf65 100644 --- a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt +++ b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeOverlapping.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeMergeRequiresRecordType(Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt index 4b68fea..42cdf65 100644 --- a/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt +++ b/dhall/tests/type-errors/unit/RecursiveRecordTypeMergeRhsNotRecordType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: RecordTypeMergeRequiresRecordType(Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt index 4b68fea..9a2913b 100644 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt +++ b/dhall/tests/type-errors/unit/RightBiasedRecordMergeLhsNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MustCombineRecord(Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt +++ b/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds2.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt +++ b/dhall/tests/type-errors/unit/RightBiasedRecordMergeMixedKinds3.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt b/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt index 4b68fea..9a2913b 100644 --- a/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt +++ b/dhall/tests/type-errors/unit/RightBiasedRecordMergeRhsNotRecord.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MustCombineRecord(Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/SomeNotType.txt b/dhall/tests/type-errors/unit/SomeNotType.txt index 4b68fea..43581a0 100644 --- a/dhall/tests/type-errors/unit/SomeNotType.txt +++ b/dhall/tests/type-errors/unit/SomeNotType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidOptionalType(Type) diff --git a/dhall/tests/type-errors/unit/Sort.txt b/dhall/tests/type-errors/unit/Sort.txt index 4b68fea..5b88ff7 100644 --- a/dhall/tests/type-errors/unit/Sort.txt +++ b/dhall/tests/type-errors/unit/Sort.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: Sort diff --git a/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt b/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt index 4b68fea..ba2aecd 100644 --- a/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt +++ b/dhall/tests/type-errors/unit/TextLiteralInterpolateNotText.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidTextInterpolation(Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }) diff --git a/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt b/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt index 4b68fea..77ff57f 100644 --- a/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt +++ b/dhall/tests/type-errors/unit/TypeAnnotationWrong.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: AnnotMismatch(Value@Unevaled { value: PartialExpr(NaturalLit(1)), type: Value@WHNF { value: AppliedBuiltin(Natural, []), type: Type } }, Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt b/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt index 4b68fea..7b2e610 100644 --- a/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt +++ b/dhall/tests/type-errors/unit/UnionConstructorFieldNotPresent.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: MissingUnionField(Label("y"), Value@WHNF { value: UnionType({Label("x"): Some(Value@Unevaled { value: AppliedBuiltin(Bool, []), type: Type })}), type: Type }) diff --git a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt b/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt index 4b68fea..27c6cbe 100644 --- a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt +++ b/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants1.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: UnionTypeDuplicateField diff --git a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt b/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt index 4b68fea..27c6cbe 100644 --- a/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt +++ b/dhall/tests/type-errors/unit/UnionTypeDuplicateVariants2.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: UnionTypeDuplicateField diff --git a/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt b/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt index 4b68fea..07604ba 100644 --- a/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt +++ b/dhall/tests/type-errors/unit/UnionTypeMixedKinds.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidFieldType(Label("y"), Type) diff --git a/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt b/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt index 4b68fea..07604ba 100644 --- a/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt +++ b/dhall/tests/type-errors/unit/UnionTypeMixedKinds2.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidFieldType(Label("y"), Type) diff --git a/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt b/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt index 4b68fea..83fc426 100644 --- a/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt +++ b/dhall/tests/type-errors/unit/UnionTypeMixedKinds3.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidFieldType(Label("y"), Value@Unevaled { value: AppliedBuiltin(Bool, []), type: Type }) diff --git a/dhall/tests/type-errors/unit/UnionTypeNotType.txt b/dhall/tests/type-errors/unit/UnionTypeNotType.txt index 4b68fea..72d4316 100644 --- a/dhall/tests/type-errors/unit/UnionTypeNotType.txt +++ b/dhall/tests/type-errors/unit/UnionTypeNotType.txt @@ -1 +1 @@ -Type error: Unhandled error +Type error: Unhandled error: InvalidFieldType(Label("x"), Value@Unevaled { value: PartialExpr(BoolLit(true)), type: Value@WHNF { value: AppliedBuiltin(Bool, []), type: Type } }) -- cgit v1.3.1 From 5f52c5bda0277edd87323eb67dcda721cd18a9d3 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 24 Dec 2019 20:23:19 +0000 Subject: Extend merge to work on Optionals --- dhall-lang | 2 +- dhall/build.rs | 16 ++++++++++++--- dhall/src/dhall.pest.visibility | 1 + dhall/src/error/mod.rs | 2 +- dhall/src/semantics/phase/normalize.rs | 24 ++++++++++++++++++++-- dhall/src/semantics/phase/typecheck.rs | 16 +++++++++++++-- dhall/src/syntax/text/parser.rs | 9 ++++++++ .../type-errors/unit/MergeAnnotationNotType.txt | 2 +- .../unit/MergeEmptyWithoutAnnotation.txt | 2 +- .../type-errors/unit/MergeHandlerNotInUnion.txt | 2 +- dhall/tests/type-errors/unit/MergeRhsNotUnion.txt | 2 +- 11 files changed, 65 insertions(+), 13 deletions(-) (limited to 'dhall/src/error') diff --git a/dhall-lang b/dhall-lang index c7dd51e..0c99dc6 160000 --- a/dhall-lang +++ b/dhall-lang @@ -1 +1 @@ -Subproject commit c7dd51ec433e07433243cf1a1134655dbab6cc95 +Subproject commit 0c99dc6f53919fc2df6b965877c355b62cf6ba02 diff --git a/dhall/build.rs b/dhall/build.rs index 981e558..3d4a2eb 100644 --- a/dhall/build.rs +++ b/dhall/build.rs @@ -128,7 +128,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/import/urls/emptyPath0" || path == "unit/import/urls/emptyPath1" || path == "unit/import/urls/emptyPathSegment" - // TODO: https://github.com/dhall-lang/dhall-lang/pull/788#issuecomment-568298973 + // TODO: waiting for https://github.com/dhall-lang/dhall-lang/pull/871 || path == "preferMissingNoSpaces" }), input_type: FileType::Text, @@ -154,7 +154,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/import/urls/emptyPath0" || path == "unit/import/urls/emptyPath1" || path == "unit/import/urls/emptyPathSegment" - // TODO: https://github.com/dhall-lang/dhall-lang/pull/788#issuecomment-568298973 + // TODO: waiting for https://github.com/dhall-lang/dhall-lang/pull/871 || path == "preferMissingNoSpaces" }), input_type: FileType::Text, @@ -178,7 +178,7 @@ fn generate_tests() -> std::io::Result<()> { || path == "unit/import/urls/emptyPath0" || path == "unit/import/urls/emptyPath1" || path == "unit/import/urls/emptyPathSegment" - // TODO: https://github.com/dhall-lang/dhall-lang/pull/788#issuecomment-568298973 + // TODO: waiting for https://github.com/dhall-lang/dhall-lang/pull/871 || path == "preferMissingNoSpaces" }), input_type: FileType::Text, @@ -282,6 +282,9 @@ fn generate_tests() -> std::io::Result<()> { // TODO: record completion || path == "simple/completion" || path == "unit/Completion" + // TODO: waiting for https://github.com/dhall-lang/dhall-lang/pull/871 + || path == "unit/MergeNone" + || path == "unit/MergeSome" }), input_type: FileType::Text, output_type: Some(FileType::Text), @@ -317,6 +320,9 @@ fn generate_tests() -> std::io::Result<()> { // TODO: record completion || path == "simple/completion" || path == "unit/Completion" + // TODO: waiting for https://github.com/dhall-lang/dhall-lang/pull/871 + || path == "unit/MergeNone" + || path == "unit/MergeSome" }), input_type: FileType::Text, output_type: Some(FileType::Text), @@ -423,6 +429,10 @@ fn convert_abnf_to_pest() -> std::io::Result<()> { // Prefer my nice error message to illegible parse errors. rules.remove("unicode_escape"); + rules.remove("unbraced_escape"); + rules.remove("braced_escape"); + rules.remove("braced_codepoint"); + rules.remove("unicode_suffix"); writeln!( &mut file, r#"unicode_escape = _{{ HEXDIG{{4}} | "{{" ~ HEXDIG+ ~ "}}" }}"# diff --git a/dhall/src/dhall.pest.visibility b/dhall/src/dhall.pest.visibility index 5d3b4c8..03a000b 100644 --- a/dhall/src/dhall.pest.visibility +++ b/dhall/src/dhall.pest.visibility @@ -21,6 +21,7 @@ quoted_label # label # nonreserved_label # any_label +any_label_or_some double_quote_chunk double_quote_escaped # unicode_escape diff --git a/dhall/src/error/mod.rs b/dhall/src/error/mod.rs index 8976478..6e7be64 100644 --- a/dhall/src/error/mod.rs +++ b/dhall/src/error/mod.rs @@ -67,7 +67,7 @@ pub(crate) enum TypeMessage { BinOpTypeMismatch(BinOp, Value), InvalidTextInterpolation(Value), Merge1ArgMustBeRecord(Value), - Merge2ArgMustBeUnion(Value), + Merge2ArgMustBeUnionOrOptional(Value), MergeEmptyNeedsAnnotation, MergeHandlerMissingVariant(Label), MergeVariantMissingHandler(Label), diff --git a/dhall/src/semantics/phase/normalize.rs b/dhall/src/semantics/phase/normalize.rs index 5a0f566..459eaf1 100644 --- a/dhall/src/semantics/phase/normalize.rs +++ b/dhall/src/semantics/phase/normalize.rs @@ -590,8 +590,8 @@ pub(crate) fn normalize_one_layer( ty: &Value, ) -> ValueKind { use ValueKind::{ - AppliedBuiltin, BoolLit, DoubleLit, EmptyListLit, IntegerLit, - NEListLit, NEOptionalLit, NaturalLit, RecordLit, TextLit, + AppliedBuiltin, BoolLit, DoubleLit, EmptyListLit, EmptyOptionalLit, + IntegerLit, NEListLit, NEOptionalLit, NaturalLit, RecordLit, TextLit, UnionConstructor, UnionLit, UnionType, }; @@ -739,6 +739,26 @@ pub(crate) fn normalize_one_layer( Ret::Expr(expr) } }, + (RecordLit(kvs), EmptyOptionalLit(_)) => { + match kvs.get(&"None".into()) { + Some(h) => Ret::Value(h.clone()), + None => { + drop(handlers_borrow); + drop(variant_borrow); + Ret::Expr(expr) + } + } + } + (RecordLit(kvs), NEOptionalLit(v)) => { + match kvs.get(&"Some".into()) { + Some(h) => Ret::Value(h.app(v.clone())), + None => { + drop(handlers_borrow); + drop(variant_borrow); + Ret::Expr(expr) + } + } + } _ => { drop(handlers_borrow); drop(variant_borrow); diff --git a/dhall/src/semantics/phase/typecheck.rs b/dhall/src/semantics/phase/typecheck.rs index 7ea4951..97502d4 100644 --- a/dhall/src/semantics/phase/typecheck.rs +++ b/dhall/src/semantics/phase/typecheck.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::cmp::max; use std::collections::HashMap; @@ -695,8 +696,19 @@ fn type_last_layer( let union_type = union.get_type()?; let union_borrow = union_type.as_whnf(); let variants = match &*union_borrow { - ValueKind::UnionType(kts) => kts, - _ => return mkerr(Merge2ArgMustBeUnion(union.clone())), + ValueKind::UnionType(kts) => Cow::Borrowed(kts), + ValueKind::AppliedBuiltin(syntax::Builtin::Optional, args) + if args.len() == 1 => + { + let ty = &args[0]; + let mut kts = HashMap::new(); + kts.insert("None".into(), None); + kts.insert("Some".into(), Some(ty.clone())); + Cow::Owned(kts) + } + _ => { + return mkerr(Merge2ArgMustBeUnionOrOptional(union.clone())) + } }; let mut inferred_type = None; diff --git a/dhall/src/syntax/text/parser.rs b/dhall/src/syntax/text/parser.rs index 0e3e97a..feaa2a5 100644 --- a/dhall/src/syntax/text/parser.rs +++ b/dhall/src/syntax/text/parser.rs @@ -183,6 +183,15 @@ impl DhallParser { Ok(Label::from(input.as_str())) } + // TODO: waiting for https://github.com/dhall-lang/dhall-lang/pull/871 + // #[alias(label)] + // fn any_label_or_some(input: ParseInput) -> ParseResult