Skip to content

Commit c0c1804

Browse files
committed
Cleanups
1 parent 3c29212 commit c0c1804

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2816,9 +2816,11 @@ object Parsers {
28162816
setLastStatOffset()
28172817
if (in.token == IMPORT)
28182818
stats ++= importClause()
2819+
else if (in.token == GIVEN)
2820+
stats += implicitClosure(in.offset, Location.InBlock, modifiers(closureMods))
28192821
else if (isExprIntro)
28202822
stats += expr(Location.InBlock)
2821-
else if (isDefIntro(localModifierTokens) || in.token == GIVEN) // !!!!
2823+
else if (isDefIntro(localModifierTokens))
28222824
if (in.token == IMPLICIT || in.token == ERASED || in.token == GIVEN) {
28232825
val start = in.offset
28242826
var imods = modifiers(closureMods)

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
141141
argStr ~ " => " ~ argText(args.last)
142142
}
143143

144-
def toTextDependentFunction(appType: MethodType): Text = // !!!!
144+
def toTextDependentFunction(appType: MethodType): Text =
145+
(keywordText("erased ") provided appType.isErasedMethod) ~
145146
(keywordText("given ") provided appType.isImplicitMethod) ~
146147
"(" ~ paramsText(appType) ~ ") => " ~ toText(appType.resultType)
147148

0 commit comments

Comments
 (0)