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

Redeclare Instance members within an object frame in New

Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
This commit is contained in:
joshvera 2018-12-13 13:14:33 -05:00
parent 0dc1ad4e35
commit a6657cc679

View File

@ -642,10 +642,16 @@ instance Evaluatable New where
objectFrame <- newFrame objectScope (Map.singleton Superclass $ Map.singleton assocScope classFrame)
objectVal <- object objectFrame
classScope <- scopeLookup classFrame
instanceMembers <- relationsOfScope classScope Instance
void . withScopeAndFrame objectFrame $ do
for_ instanceMembers $ \Data{..} -> do
declare dataDeclaration dataRelation dataSpan dataAssociatedScope
let constructorName = Name.name "constructor"
reference (Reference constructorName) (Declaration constructorName)
constructor <- deref =<< lookupDeclaration (Declaration $ constructorName)
constructor <- deref =<< lookupDeclaration (Declaration constructorName)
args <- traverse eval arguments
call constructor (objectVal : args)