Skip to content

Commit 78d2d67

Browse files
Apply changes from code review
Co-authored-by: Nicolas Stucki <[email protected]>
1 parent 3561991 commit 78d2d67

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

compiler/src/dotty/tools/dotc/cc/Setup.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ extends tpd.TreeTraverser:
261261
case AppliedType(tycon, res :: exc :: Nil) if tycon.typeSymbol == defn.throwsAlias =>
262262
// hard-coded expansion since $throws aliases in stdlib are defined with `?=>` rather than `?->`
263263
defn.FunctionOf(
264-
AnnotatedType(defn.CanThrowClass.typeRef.appliedTo(exc), Annotation(defn.ErasedParamAnnot, defn.CanThrowClass.span)) :: Nil,
264+
AnnotatedType(
265+
defn.CanThrowClass.typeRef.appliedTo(exc),
266+
Annotation(defn.ErasedParamAnnot, defn.CanThrowClass.span)) :: Nil,
265267
res,
266268
isContextual = true
267269
)

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,10 +1264,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
12641264

12651265
(pt1.argInfos.init, typeTree(interpolateWildcards(pt1.argInfos.last.hiBound)))
12661266
case RefinedType(parent, nme.apply, mt @ MethodTpe(_, formals, restpe))
1267-
if defn.isNonRefinedFunction(parent) && formals.length == defaultArity =>
1268-
(formals, untpd.DependentTypeTree(syms => restpe.substParams(mt, syms.map(_.termRef))))
1269-
case RefinedType(parent, nme.apply, mt @ MethodTpe(_, formals, restpe))
1270-
if defn.isErasedFunctionType(parent) && formals.length == defaultArity =>
1267+
if (defn.isNonRefinedFunction(parent) || defn.isErasedFunctionType(parent)) && formals.length == defaultArity =>
12711268
(formals, untpd.DependentTypeTree(syms => restpe.substParams(mt, syms.map(_.termRef))))
12721269
case SAMType(mt @ MethodTpe(_, formals, restpe)) =>
12731270
(formals,

0 commit comments

Comments
 (0)