Ellipsis shouldn't introduce anything into scope
This commit is contained in:
parent
4ee68caa70
commit
d8a66c09ab
|
@ -341,26 +341,25 @@ buildArgument params arg = do
|
|||
Nothing -> id
|
||||
Just n -> M.insert n $ const $
|
||||
thunk (withScopes scope arg)
|
||||
loebM (inject $ alignWithKey (assemble scope isVariadic)
|
||||
loebM (inject $ M.mapMaybe id $ alignWithKey (assemble scope isVariadic)
|
||||
args (M.fromList s))
|
||||
where
|
||||
assemble :: Scopes m t
|
||||
-> Bool
|
||||
-> Text
|
||||
-> These t (Maybe (m v))
|
||||
-> AttrSet t
|
||||
-> m t
|
||||
-> Maybe (AttrSet t -> m t)
|
||||
assemble scope isVariadic k = \case
|
||||
That Nothing ->
|
||||
That Nothing -> Just $
|
||||
const $ evalError @v $ ErrorCall $
|
||||
"Missing value for parameter: " ++ show k
|
||||
That (Just f) -> \args ->
|
||||
That (Just f) -> Just $ \args ->
|
||||
thunk $ withScopes scope $ pushScope args f
|
||||
This x | isVariadic -> const (pure x)
|
||||
| otherwise ->
|
||||
This _ | isVariadic -> Nothing
|
||||
| otherwise -> Just $
|
||||
const $ evalError @v $ ErrorCall $
|
||||
"Unexpected parameter: " ++ show k
|
||||
These x _ -> const (pure x)
|
||||
These x _ -> Just (const (pure x))
|
||||
|
||||
addSourcePositions :: (MonadReader e m, Has e SrcSpan)
|
||||
=> Transform NExprLocF (m a)
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
let x = 1;
|
||||
f = { ... }: x;
|
||||
in f { x = 2; }
|
Loading…
Reference in New Issue