Skip to content

Commit 56f2448

Browse files
committed
Fix // error missing from neg tests and other details
1 parent 708aeae commit 56f2448

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,13 +2898,13 @@ object Parsers {
28982898
firstClause: Boolean = false, // clause is the first in regular list of clauses
28992899
ownerKind: ParamOwner.Value
29002900
): List[TypeDef] | List[ValDef] =
2901-
if(in.token == LPAREN){
2901+
if (in.token == LPAREN)
29022902
paramClause(nparams, ofClass, ofCaseClass, prefix, givenOnly, firstClause)
2903-
}else if(in.token == LBRACKET){
2903+
else if (in.token == LBRACKET)
29042904
typeParamClause(ownerKind)
2905-
}else{
2905+
else
29062906
Nil
2907-
}
2907+
29082908
end typeOrTermParamClause
29092909

29102910
def typeOrTermParamClauses(
@@ -2935,8 +2935,6 @@ object Parsers {
29352935
else Nil
29362936
end recur
29372937

2938-
//recur(firstClause = true, numLeadParams)
2939-
29402938
recur(firstClause = true, nparams = numLeadParams)
29412939
end typeOrTermParamClauses
29422940

tests/neg/_TypeInterweaving/ab.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ given Double = 0
55
def ab[A][B](x: A)(using B): B = summon[B]
66

77
def test =
8-
ab[Int](0: Int)
8+
ab[Int](0: Int) // error
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
def f[T](x: T)[U](y: U) = (x,y)
2-
def f[T](x: T, y: T) = (x,y)
2+
def f[T](x: T, y: T) = (x,y) // error
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
def f1[T (x: T)] = ??? // error
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
3+
4+
5+
def f2[T(x: T) = ??? // error
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
3+
def f3(x: Any[)T] = ??? // error

tests/pos/_typeInterweaving/functorInterweaving.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//taken from https://dotty.epfl.ch/docs/reference/contextual/type-classes.html
22
//at version 3.1.1-RC1-bin-20210930-01f040b-NIGHTLY
3-
//modified to have type currying
3+
//modified to have type interveawing
44
trait Functor[F[_]]:
5-
def map[A][B](x: F[A], f: A => B): F[B]
5+
def map[A](x: F[A])[B](f: A => B): F[B]
66

77

88
given Functor[List] with

0 commit comments

Comments
 (0)