KT-5482 Redundant type arguments are not detected in some cases
#KT-5482 Fixed
This commit is contained in:
+9
@@ -124,4 +124,13 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Type arguments are unnecessary</problem_class>
|
||||
<description>Remove explicit type arguments</description>
|
||||
</problem>
|
||||
|
||||
<problem>
|
||||
<file>mapGet.kt</file>
|
||||
<line>9</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/mapGet.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Type arguments are unnecessary</problem_class>
|
||||
<description>Remove explicit type arguments</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,11 @@
|
||||
interface I<T>
|
||||
|
||||
interface MyMap {
|
||||
fun <T : Any> get(`type`: I<T>): T?
|
||||
}
|
||||
|
||||
class A(val map: MyMap) {
|
||||
fun <T> foo(`type`: I<T>) {
|
||||
val value = map.get<caret><T>(`type`)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
interface I<T>
|
||||
|
||||
interface MyMap {
|
||||
fun <T : Any> get(`type`: I<T>): T?
|
||||
}
|
||||
|
||||
class A(val map: MyMap) {
|
||||
fun <T> foo(`type`: I<T>) {
|
||||
val value = map.get<caret>(`type`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user