Skip to content

Commit

Permalink
fix: send receiver is reference to singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Nov 21, 2022
1 parent dd4d36d commit b08d303
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/src/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ function referenceDefinition(ref: Reference<Node>): Node | undefined {
const sendDefinitions = (environment: Environment) => ( send: Send): Method[] => {
try {
return send.receiver.match({
Singleton: match => definedOrEmpty(match.lookupMethod(send.message, send.args.length)),
Reference: match => {
const target = match.target()
return target && target.is('Singleton') ?
definedOrEmpty(target.lookupMethod(send.message, send.args.length))
: allMethodDefinitions(environment, send)
},
New: match => definedOrEmpty(match.instantiated.target()?.lookupMethod(send.message, send.args.length)),
Self: _ => moduleFinderWithBackup(environment, send)(
(module) => definedOrEmpty(module.lookupMethod(send.message, send.args.length))
Expand Down

0 comments on commit b08d303

Please sign in to comment.