Skip to content

Commit

Permalink
Semantic: impl discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanjermakov committed Jun 18, 2023
1 parent da9c3a8 commit 1cd6f36
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scope/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export const vidToString = (vid: VirtualIdentifier) => [...vid.scope, vid.name].
export const vidScopeToString = (vid: VirtualIdentifier) => vid.scope.join('::')

export const findImplsById = (vId: VirtualIdentifier, ctx: Context): ImplDef[] => {
// TODO: go through imports only
return ctx.modules
.filter(m => vidToString(m.identifier) === vidScopeToString(vId))
.flatMap(m => m.statements.filter(s => s.kind === 'impl-def').map(s => <ImplDef>s))
.filter(i => i.identifier.name.value === vId.name)
}
Expand Down

0 comments on commit 1cd6f36

Please sign in to comment.