Skip to content

Commit

Permalink
Merge pull request #1577 from dotty-staging/fix-1543-2
Browse files Browse the repository at this point in the history
Fix #1543: Ignore IgnoredProto when normalizing method application.
  • Loading branch information
odersky committed Oct 13, 2016
2 parents 4f8a85c + 13c5c28 commit 6095454
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dotty/tools/dotc/typer/ProtoTypes.scala
Expand Up @@ -400,9 +400,10 @@ object ProtoTypes {
if (mt.isDependent) tp
else {
val rt = normalize(mt.resultType, pt)
if (pt.isInstanceOf[ApplyingProto])
mt.derivedMethodType(mt.paramNames, mt.paramTypes, rt)
else {
pt match {
case pt: IgnoredProto => mt
case pt: ApplyingProto => mt.derivedMethodType(mt.paramNames, mt.paramTypes, rt)
case _ =>
val ft = defn.FunctionOf(mt.paramTypes, rt)
if (mt.paramTypes.nonEmpty || ft <:< pt) ft else rt
}
Expand Down
31 changes: 31 additions & 0 deletions tests/run/i1543.check
@@ -0,0 +1,31 @@
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
41 changes: 41 additions & 0 deletions tests/run/i1543.scala
@@ -0,0 +1,41 @@

object Test extends dotty.runtime.LegacyApp {
new Bar().foo(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31)
}


class Bar {
def foo(p1: Int, p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int, p20: Int, p21: Int, p22: Int, p23: Int, p24: Int, p25: Int, p26: Int, p27: Int, p28: Int, p29: Int, p30: Int, p31: Int): Unit = {
println(p1)
println(p2)
println(p3)
println(p4)
println(p5)
println(p6)
println(p7)
println(p8)
println(p9)
println(p10)
println(p11)
println(p12)
println(p13)
println(p14)
println(p15)
println(p16)
println(p17)
println(p18)
println(p19)
println(p20)
println(p21)
println(p22)
println(p23)
println(p24)
println(p25)
println(p26)
println(p27)
println(p28)
println(p29)
println(p30)
println(p31)
}
}

0 comments on commit 6095454

Please sign in to comment.