1
1
mirror of https://github.com/github/semantic.git synced 2024-12-20 13:21:59 +03:00

Use maybeLookupDeclaration

Since self isn't necessarily defined for all languages.
This commit is contained in:
joshvera 2018-12-13 17:49:43 -05:00
parent 9be3403d21
commit 493a69b8c5

View File

@ -111,8 +111,8 @@ instance ( FreeVariables term
withScopeAndFrame frameAddress $ do
case maybeThis of
Just object -> do
slot <- lookupDeclaration (Declaration __semantic_self)
assign slot object
maybeSlot <- maybeLookupDeclaration (Declaration __semantic_self)
maybe (pure ()) (`assign` object) maybeSlot
Nothing -> pure ()
for_ (zip names params) $ \(name, param) -> do
addr <- lookupDeclaration (Declaration name)