Skip to content

Commit f68ae17

Browse files
committed
simplify
1 parent 59862cf commit f68ae17

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

+9-11
Original file line numberDiff line numberDiff line change
@@ -249,18 +249,16 @@ object Contexts {
249249
def getSource(path: TermName): SourceFile = base.sourceNamed.get(path) match {
250250
case Some(source) =>
251251
source
252-
case None =>
253-
val src = try {
254-
val f = new PlainFile(Path(path.toString))
255-
val s = getSource(f)
256-
base.sourceNamed(path) = s
257-
s
258-
} catch {
259-
case ex: InvalidPathException =>
260-
ctx.error(s"invalid file path: ${ex.getMessage}")
261-
NoSource
262-
}
252+
case None => try {
253+
val f = new PlainFile(Path(path.toString))
254+
val src = getSource(f)
255+
base.sourceNamed(path) = src
263256
src
257+
} catch {
258+
case ex: InvalidPathException =>
259+
ctx.error(s"invalid file path: ${ex.getMessage}")
260+
NoSource
261+
}
264262
}
265263

266264
/** Sourcefile with given path, memoized */

0 commit comments

Comments
 (0)