Skip to content

Commit ceb4dd9

Browse files
committed
Revert "Dropping a type annotation, which is no longer needed."
This reverts commit 7cb292f.
1 parent ceaebef commit ceb4dd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ class Definitions(implicit ctx: Context) {
284284
object FunctionType {
285285
def apply(args: List[Type], resultType: Type) =
286286
FunctionClass(args.length).typeRef.appliedTo(args :+ resultType)
287-
def unapply(ft: Type) = {
287+
def unapply(ft: Type): Option[(List[Type], Type)] = { // Dotty deviation: Type annotation needed because inferred type
288+
// is Some[(List[Type], Type)] | None, which is not a legal unapply type.
288289
val tsym = ft.typeSymbol
289290
lazy val targs = ft.typeArgs
290291
if ((FunctionClasses contains tsym) &&

0 commit comments

Comments
 (0)