aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Definitions.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 1cf875280..7f5145ba3 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -284,7 +284,8 @@ class Definitions(implicit ctx: Context) {
object FunctionType {
def apply(args: List[Type], resultType: Type) =
FunctionClass(args.length).typeRef.appliedTo(args :+ resultType)
- def unapply(ft: Type) = {
+ def unapply(ft: Type): Option[(List[Type], Type)] = { // Dotty deviation: Type annotation needed because inferred type
+ // is Some[(List[Type], Type)] | None, which is not a legal unapply type.
val tsym = ft.typeSymbol
lazy val targs = ft.typeArgs
if ((FunctionClasses contains tsym) &&