File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -315,9 +315,11 @@ object MarkupParsers {
315315 }
316316
317317 /** Some try/catch/finally logic used by xLiteral and xLiteralPattern. */
318- private def xLiteralCommon (f : () => Tree , ifTruncated : String => Unit ): Tree = {
319- try return f()
320- catch {
318+ @ inline private def xLiteralCommon (f : () => Tree , ifTruncated : String => Unit ): Tree = {
319+ var result : Tree = null
320+ try {
321+ result = f()
322+ } catch {
321323 case c @ TruncatedXMLControl =>
322324 ifTruncated(c.getMessage)
323325 case c @ (MissingEndTagControl | ConfusedAboutBracesControl ) =>
@@ -327,7 +329,10 @@ object MarkupParsers {
327329 }
328330 finally parser.in resume Tokens .XMLSTART
329331
330- parser.errorTermTree
332+ if (result == null )
333+ parser.errorTermTree
334+ else
335+ result
331336 }
332337
333338 /** Use a lookahead parser to run speculative body, and return the first char afterward. */
You can’t perform that action at this time.
0 commit comments