From 387741a5e2a484f5a598fd2246f812db7fe9efb3 Mon Sep 17 00:00:00 2001 From: odersky Date: Tue, 1 Nov 2022 08:29:21 +0100 Subject: [PATCH] Attempt to fix completion crash Fixes #16228 (hopefully) --- .../dotty/tools/dotc/core/Denotations.scala | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/Denotations.scala b/compiler/src/dotty/tools/dotc/core/Denotations.scala index f267e6c85e03..5602cdf6a0a4 100644 --- a/compiler/src/dotty/tools/dotc/core/Denotations.scala +++ b/compiler/src/dotty/tools/dotc/core/Denotations.scala @@ -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