purescript-selda
purescript-selda copied to clipboard
Type error message in nested aggregate query with missing `aggregate` call
selectFrom_
(selectFrom table \{ id } → do -- missing `aggregate $` before selectFrom
pid ← groupBy id
pure { pid })
pure
results in an unclear error message
The inferred type
∀ t39 t62 t78
. Mapping OuterCols (Aggr (Inner t39) Int) t62
⇒ FoldingWithIndex ExtractCols (SProxy "pid") (Array (Tuple String ...)) t62 (Array (Tuple String ...))
⇒ MappingWithIndex SubQueryResult (SProxy "pid") t62 t78
⇒ FullQuery t39 { pid ∷ t78 }
has type variables which are not mentioned in the body of the type.
Consider adding a type annotation.
in value declaration ...
PureScript(AmbiguousTypeVariables)