1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Get the declared names of methods using declaredName.

This commit is contained in:
Rob Rix 2018-07-16 10:21:30 -04:00
parent 12d2bc1d6b
commit cc6ed63103

View File

@ -47,7 +47,7 @@ instance Diffable Method where
-- local environment.
instance Evaluatable Method where
eval Method{..} = do
name <- either (throwEvalError . FreeVariablesError) pure (freeVariable $ subterm methodName)
name <- maybeM (throwEvalError (FreeVariablesError [])) (declaredName (subterm methodName))
(_, addr) <- letrec name (closure (paramNames methodParameters) (Set.fromList (freeVariables methodBody)) (subtermAddress methodBody))
bind name addr
pure (Rval addr)