File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
compiler/src/dotty/tools/dotc/parsing Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -245,8 +245,8 @@ object Parsers {
245
245
ctx.deprecationWarning(msg, source atPos Position (offset))
246
246
247
247
/** Issue an error at current offset taht input is incomplete */
248
- def incompleteInputError (msg : => Message ) =
249
- ctx.incompleteInputError(msg, source atPos Position (in.offset) )
248
+ def incompleteInputError (msg : => Message , pos : Position = Position (in.offset) ) =
249
+ ctx.incompleteInputError(msg, source atPos pos )
250
250
251
251
/** If at end of file, issue an incompleteInputError.
252
252
* Otherwise issue a syntax error and skip to next safe point.
@@ -1162,7 +1162,10 @@ object Parsers {
1162
1162
if (in.token == CATCH ) {
1163
1163
val pos = in.offset
1164
1164
in.nextToken()
1165
- (expr(), pos)
1165
+ accept(LBRACE )
1166
+ val res = (expr(), pos)
1167
+ accept(RBRACE )
1168
+ res
1166
1169
} else (EmptyTree , - 1 )
1167
1170
1168
1171
handler match {
You can’t perform that action at this time.
0 commit comments