Skip to content

Commit

Permalink
Localize TypeError handling in addRecheckedTypes
Browse files Browse the repository at this point in the history
[Cherry-picked 0f2613c][modified]
  • Loading branch information
WojciechMazur committed Dec 5, 2024
1 parent e8e3eab commit 15e4ee0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions compiler/src/dotty/tools/dotc/transform/Recheck.scala
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ object Recheck:

val addRecheckedTypes = new TreeMap:
override def transform(tree: Tree)(using Context): Tree =
val tree1 = super.transform(tree)
tree.getAttachment(RecheckedType) match
case Some(tpe) => tree1.withType(tpe)
case None => tree1
try
val tree1 = super.transform(tree)
tree.getAttachment(RecheckedType) match
case Some(tpe) => tree1.withType(tpe)
case None => tree1
catch
case _:TypeError => tree

extension (sym: Symbol)

Expand Down

0 comments on commit 15e4ee0

Please sign in to comment.