File tree 3 files changed +14
-6
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -508,7 +508,8 @@ trait Inferencing { this: Typer =>
508
508
// found : Int(1)
509
509
// required: String
510
510
// val y: List[List[String]] = List(List(1))
511
- val hasUnreportedErrors = state.reporter.hasUnreportedErrors
511
+ if state.reporter.hasUnreportedErrors then return tree
512
+
512
513
def constraint = state.constraint
513
514
type InstantiateQueue = mutable.ListBuffer [(TypeVar , Boolean )]
514
515
val toInstantiate = new InstantiateQueue
@@ -521,7 +522,7 @@ trait Inferencing { this: Typer =>
521
522
typr.println(i " interpolate non-occurring $tvar in $state in $tree: $tp, fromBelow = ${tvar.hasLowerBound}, $constraint" )
522
523
toInstantiate += ((tvar, tvar.hasLowerBound))
523
524
}
524
- else if ( ! hasUnreportedErrors)
525
+ else
525
526
if (v.intValue != 0 ) {
526
527
typr.println(i " interpolate $tvar in $state in $tree: $tp, fromBelow = ${v.intValue == 1 }, $constraint" )
527
528
toInstantiate += ((tvar, v.intValue == 1 ))
Original file line number Diff line number Diff line change
1
+ object Kotlin :
2
+ def it [T ](using t : T ) = t
3
+ def fun [T , U ](fn : T ?=> U )(x : T ): U = fn(using x)
4
+
5
+ import Kotlin .{fun , it }
6
+
7
+ def Test = List (1 ).map(fun(it + 1 )) // error
Original file line number Diff line number Diff line change 1
1
-- Error: tests/neg/i9568.scala:13:10 ----------------------------------------------------------------------------------
2
2
13 | blaMonad.foo(bla) // error: diverges
3
3
| ^
4
- |no implicit argument of type => Monad[([_$3] =>> Any) ] was found for parameter ev of method blaMonad in object Test.
5
- |I found:
4
+ | no implicit argument of type => Monad[F ] was found for parameter ev of method blaMonad in object Test.
5
+ | I found:
6
6
|
7
- | Test.blaMonad[Nothing, S](Test.blaMonad[F, S])
7
+ | Test.blaMonad[Nothing, S](Test.blaMonad[F, S])
8
8
|
9
- |But method blaMonad in object Test does not match type => Monad[Nothing].
9
+ | But method blaMonad in object Test does not match type => Monad[Nothing].
You can’t perform that action at this time.
0 commit comments