Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix completion crash #16267

Merged
merged 1 commit into from
Dec 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions compiler/src/dotty/tools/dotc/core/Denotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -644,15 +644,19 @@ object Denotations {

def atSignature(sig: Signature, targetName: Name, site: Type, relaxed: Boolean)(using Context): SingleDenotation =
val situated = if site == NoPrefix then this else asSeenFrom(site)
val sigMatches = sig.matchDegree(situated.signature) match
case FullMatch =>
true
case MethodNotAMethodMatch =>
// See comment in `matches`
relaxed && !symbol.is(JavaDefined)
case ParamMatch =>
relaxed
case noMatch =>
val sigMatches =
try
sig.matchDegree(situated.signature) match
case FullMatch =>
true
case MethodNotAMethodMatch =>
// See comment in `matches`
relaxed && !symbol.is(JavaDefined)
case ParamMatch =>
relaxed
case noMatch =>
false
catch case ex: MissingType =>
false
if sigMatches && symbol.hasTargetName(targetName) then this else NoDenotation

Expand Down