Skip to content

Commit 34c9c36

Browse files
Victor NawothnigVictor Nawothnig
Victor Nawothnig
authored and
Victor Nawothnig
committed
Fix overlapping errors
1 parent 3a0601a commit 34c9c36

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

Diff for: scripts/hpc-ratchet

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ Each item represents the number of "things" we are OK with not being covered.
3737
COVERAGE_TOLERANCE = {
3838
ALTERNATIVES: 161,
3939
BOOLEANS: 8,
40-
EXPRESSIONS: 1416,
40+
EXPRESSIONS: 1413,
4141
LOCAL_DECLS: 14,
42-
TOP_LEVEL_DECLS: 669,
42+
TOP_LEVEL_DECLS: 666,
4343
}
4444

4545

Diff for: src/GraphQL/Internal/API/Enum.hs

+4-12
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,16 @@ instance forall conName p b. (KnownSymbol conName) => GenericEnumValues (C1 ('Me
8686

8787
-- TODO(tom): better type errors using `n`. Also type errors for other
8888
-- invalid constructors.
89-
instance forall conName p b sa sb.
90-
( TypeError ('Text "Constructor not unary: " ':<>: 'Text conName)
89+
instance forall conName f s sa sb.
90+
( TypeError ('Text "Constructor not nullary: " ':<>: 'Text conName)
9191
, KnownSymbol conName
92-
) => GenericEnumValues (C1 ('MetaCons conName p b) (S1 sa sb)) where
93-
genericEnumValues = nonUnaryConstructorError
94-
genericEnumFromValue = nonUnaryConstructorError
95-
genericEnumToValue = nonUnaryConstructorError
96-
97-
instance forall conName p b sa sb f.
98-
( TypeError ('Text "Constructor not unary: " ':<>: 'Text conName)
99-
, KnownSymbol conName
100-
) => GenericEnumValues (C1 ('MetaCons conName p b) (S1 sa sb) :+: f) where
92+
) => GenericEnumValues (C1 ('MetaCons conName f s) (S1 sa sb)) where
10193
genericEnumValues = nonUnaryConstructorError
10294
genericEnumFromValue = nonUnaryConstructorError
10395
genericEnumToValue = nonUnaryConstructorError
10496

10597
nonUnaryConstructorError :: a
106-
nonUnaryConstructorError = panic "Tried to construct enum with non-unary constructor. Should get a compile-time error instead of this."
98+
nonUnaryConstructorError = panic "Tried to construct enum with non-nullary constructor. Should get a compile-time error instead of this."
10799

108100
-- | For each enum type we need 1) a list of all possible values 2) a
109101
-- way to serialise and 3) deserialise.

0 commit comments

Comments
 (0)