refactoring: removed logic of rendering 'expected type mismatch' error from constraint system
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package s
|
||||
|
||||
fun <T> id(t: T): T = t
|
||||
|
||||
fun test(set: Set<Int>) {
|
||||
val s: String = id(1)
|
||||
|
||||
val l: List<Int> = id(set)
|
||||
|
||||
val ss: Set<String> = id(set)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<!-- typeInferenceExpectedTypeMismatch1 -->
|
||||
<html>
|
||||
Type inference failed. Expected type mismatch: <table>
|
||||
<tr>
|
||||
<td>
|
||||
required: </td>
|
||||
<td>
|
||||
<b>
|
||||
jet.String</b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
found: </td>
|
||||
<td>
|
||||
<font color=red>
|
||||
<b>
|
||||
jet.Int</b>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
<!-- typeInferenceExpectedTypeMismatch2 -->
|
||||
<html>
|
||||
Type inference failed. Expected type mismatch: <table>
|
||||
<tr>
|
||||
<td>
|
||||
required: </td>
|
||||
<td>
|
||||
<b>
|
||||
jet.List<jet.Int></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
found: </td>
|
||||
<td>
|
||||
<font color=red>
|
||||
<b>
|
||||
jet.Set<jet.Int></b>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
<!-- typeInferenceExpectedTypeMismatch3 -->
|
||||
<html>
|
||||
Type inference failed. Expected type mismatch: <table>
|
||||
<tr>
|
||||
<td>
|
||||
required: </td>
|
||||
<td>
|
||||
<b>
|
||||
jet.Set<jet.String></b>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
found: </td>
|
||||
<td>
|
||||
<font color=red>
|
||||
<b>
|
||||
jet.Set<jet.Int></b>
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</html>
|
||||
@@ -118,4 +118,8 @@ public class DiagnosticMessageTest extends JetLiteFixture {
|
||||
doTest("numberValueTypes", 4, Errors.TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH, Errors.TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH,
|
||||
Errors.TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS);
|
||||
}
|
||||
|
||||
public void testTypeInferenceExpectedTypeMismatch() throws Exception {
|
||||
doTest("typeInferenceExpectedTypeMismatch", 3, Errors.TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user