Skip to content

Commit 52a6878

Browse files
Backport "Avoid import suggestion thread hang if -Ximport-suggestion-timeout <= 1" to LTS (#22112)
Backports #21434 to the 3.3.5. PR submitted by the release tooling. [skip ci]
2 parents 5c6d059 + ef91aa7 commit 52a6878

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ trait ImportSuggestions:
147147
* `name` that are applicable to `T`.
148148
*/
149149
private def importSuggestions(pt: Type)(using Context): (List[TermRef], List[TermRef]) =
150-
val timer = new Timer()
151150
val allotted = ctx.run.nn.importSuggestionBudget
152151
if allotted <= 1 then return (Nil, Nil)
152+
val timer = new Timer()
153153
implicits.println(i"looking for import suggestions, timeout = ${allotted}ms")
154154
val start = System.currentTimeMillis()
155155
val deadLine = start + allotted

0 commit comments

Comments
 (0)