Fixed rendering of error message for 'cannot capture type' error

Type variable should be chosen correctly
This commit is contained in:
Svetlana Isakova
2015-01-21 22:25:25 +03:00
parent 971ad53bcc
commit 6cac6350a6
6 changed files with 47 additions and 13 deletions
@@ -0,0 +1,10 @@
// !DIAGNOSTICS_NUMBER: 1
// !DIAGNOSTICS: TYPE_INFERENCE_CANNOT_CAPTURE_TYPES
class My<R, T>
fun <R, T> foo(my: My<Array<R>, T>): My<Array<R>, T> = my
fun test11(my: My<Array<out Int>, out Int>) {
foo(my)
}
@@ -0,0 +1,2 @@
<!-- typeInferenceCannotCaptureTypes1 -->
Type inference failed: 'R' cannot capture 'out Int'. Only top-level type projections can be captured