Skip to content

Commit 26cc911

Browse files
schuetzcarlWojciechMazur
authored andcommitted
Apply review changes
[Cherry-picked e3c984e]
1 parent 04988ab commit 26cc911

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

compiler/src/dotty/tools/dotc/transform/CheckShadowing.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,15 @@ class CheckShadowing extends MiniPhase:
127127
!owner.isConstructor && !owner.is(Synthetic) && !owner.is(Exported)
128128

129129
private def reportShadowing(res: ShadowingData.ShadowResult)(using Context): Unit =
130-
res.warnings.sortBy(w => (w.pos.line, w.pos.startPos.column))(using Ordering[(Int, Int)]).foreach { s =>
131-
s match
132-
case PrivateShadowWarning(pos, shadow, shadowed) =>
133-
report.warning(s"${shadow.showLocated} shadows field ${shadowed.name} inherited from ${shadowed.owner}", pos)
134-
case TypeParamShadowWarning(pos, shadow, parent, shadowed) =>
135-
if shadowed.exists then
136-
report.warning(s"Type parameter ${shadow.name} for $parent shadows the type defined by ${shadowed.showLocated}", pos)
137-
else
138-
report.warning(s"Type parameter ${shadow.name} for $parent shadows an explicitly renamed type : ${shadow.name}", pos)
139-
}
130+
res.warnings.sortBy(w => (w.pos.line, w.pos.startPos.column))(using Ordering[(Int, Int)]).foreach {
131+
case PrivateShadowWarning(pos, shadow, shadowed) =>
132+
report.warning(s"${shadow.showLocated} shadows field ${shadowed.name} inherited from ${shadowed.owner}", pos)
133+
case TypeParamShadowWarning(pos, shadow, parent, shadowed) =>
134+
if shadowed.exists then
135+
report.warning(s"Type parameter ${shadow.name} for $parent shadows the type defined by ${shadowed.showLocated}", pos)
136+
else
137+
report.warning(s"Type parameter ${shadow.name} for $parent shadows an explicitly renamed type : ${shadow.name}", pos)
138+
}
140139

141140
private def nestedTypeTraverser(parent: Symbol) = new TreeTraverser:
142141
import tpd._
@@ -311,4 +310,5 @@ object CheckShadowing:
311310
/** A container for the results of the shadow elements analysis */
312311
case class ShadowResult(warnings: List[ShadowWarning])
313312

314-
end CheckShadowing
313+
end CheckShadowing
314+

0 commit comments

Comments
 (0)