Skip to content

Commit

Permalink
Fix #398: Include inherited members in the PackageRef fallback lookup.
Browse files Browse the repository at this point in the history
If we have a `package object` that extends other classes, we may
have to look member selections among inherited members. This is
done by `getMember` instead of `getDecl`.

To test this, we need a Scala 2 `package object` with an `extends`
clause. There is no such thing in the standard library, which is
our only source of Scala 2 code, unfortunately. So we don't add a
test for that.
  • Loading branch information
sjrd committed Nov 28, 2023
1 parent d6adb02 commit 381d48e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tasty-query/shared/src/main/scala/tastyquery/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1190,7 +1190,7 @@ object Types {
.allPackageObjectDecls()
.iterator
.map { cls =>
cls.getDecl(name) match
cls.getMember(name) match
case None => ResolveMemberResult.NotFound
case Some(decl) => makeResult(decl, cls.moduleValue.get.staticRef)
}
Expand Down

0 comments on commit 381d48e

Please sign in to comment.