We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 1fe9555 + f87d240 commit f73eec7Copy full SHA for f73eec7
compiler/src/dotty/tools/dotc/ast/Trees.scala
@@ -368,7 +368,8 @@ object Trees {
368
// name (e.g. in a comment) before finding the real definition.
369
// To make this behavior more robust we'd have to change the trees for definitions to contain
370
// a fully positioned Ident in place of a name.
371
- val idx = source.content().indexOfSlice(realName, point)
+ val contents = if source.exists then source.content() else Array.empty[Char]
372
+ val idx = contents.indexOfSlice(realName, point)
373
if (idx >= 0) idx
374
else point // use `point` anyway. This is important if no source exists so scanning fails
375
}
0 commit comments