Fix testdata after migrating to NewKotlinTypeCheckerImpl in OverrideResolver
- In kt10409 both 'pipe'-declarations contain error type. NewKotlinTypeChecker in OverrideResolver considers error types as equal, thus they are matched as bound declarations, thus 'IterablePipeline' isn't considered to contain abstract member, thus no suggestion to add abstract modifier. Because initially test was covering purely technical issue of working with error types, instead of removing it completely the additional abstract member has been added - in kt10808 we don't add explicit type anymore because 'noTypeInference' is false, because both expected type and actual type are error-types, and KotlinIntroduceVariableHandler explicitly uses type checker with 'errorTypesEqualToAnything=false'. Also, this change might be ultimately seen as small improvement, because if one extracts something with error type, they would certainly prefer it to have a proper type as soon as errors are resolved (i.e. additional code/imports written), rather than having a useless Any-type.
This commit is contained in:
+1
-1
@@ -1,11 +1,11 @@
|
||||
// "Make 'IterablePipeline' 'abstract'" "true"
|
||||
// ERROR: 'pipe' overrides nothing
|
||||
// ERROR: One type argument expected for interface Pipeline<TPipeline>
|
||||
|
||||
// Actually this test is about getting rid of assertion happenning while creating quick fixes
|
||||
// See KT-10409
|
||||
interface Pipeline<TPipeline> {
|
||||
fun pipe(block: Pipeline<TPipeline, String>)
|
||||
fun completelyAbstract()
|
||||
}
|
||||
|
||||
<caret>class IterablePipeline<T> : Pipeline<T> {
|
||||
|
||||
+1
-1
@@ -1,11 +1,11 @@
|
||||
// "Make 'IterablePipeline' 'abstract'" "true"
|
||||
// ERROR: 'pipe' overrides nothing
|
||||
// ERROR: One type argument expected for interface Pipeline<TPipeline>
|
||||
|
||||
// Actually this test is about getting rid of assertion happenning while creating quick fixes
|
||||
// See KT-10409
|
||||
interface Pipeline<TPipeline> {
|
||||
fun pipe(block: Pipeline<TPipeline, String>)
|
||||
fun completelyAbstract()
|
||||
}
|
||||
|
||||
abstract class IterablePipeline<T> : Pipeline<T> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun main(args:Array<String>) {
|
||||
val old = pref.getString("", "")
|
||||
pref.edit().putString("", "").apply()
|
||||
val instance: Any = LocalBroadcastManager.getInstance(this)
|
||||
val instance = LocalBroadcastManager.getInstance(this)
|
||||
instance.sendBroadcast(Intent(""))
|
||||
}
|
||||
Reference in New Issue
Block a user