A non-abstract super-declaration is allowed to stand as 'an implementation' of
a fake override only if its visibility is not less than visibilities of all
other super-declarations
#KT-2491 Fixed
"funcitonTypes.kt" test data file was changed because now that there is a
positioning strategy, it takes the liberty of filtering out those diagnostics
that were reported on syntactically invalid elements
Fix warnings, simplify code. Untangle a very complex code related to
diagnostics on multiple default values and different names of parameters in
supertypes; fix a bug there, add test
Some corner cases still remain: KotlinSignature, propagation, deserialized
delegates to Java interfaces
#KT-1239 Obsolete
#KT-1924 In Progress
#KT-2081 Fixed
KT-2873: VerifyError on instantiating a local class inside a closure
KT-3210 Inline Class: CompilationException: Back-end (JVM) Internal error: wrong code generated java.lang.ArrayIndexOutOfBoundsException null
#KT-3389 Fixed
FunctionN and ExtensionFunctionN are now interfaces, with the corresponding
implementations in FunctionImplN and ExtensionFunctionImplN
Update test data
Create CheckOverrideReportStrategy interface to report override errors
(will be used later for synthesized members override checks).
Add diagnostic test on OVERRIDING_FINAL_MEMBER, as no such test happened
to exist before.
The modality was nondeterministic before.
The main change sits in OverrideResolver: the logic of "fake override" generation is restructured so that
all the descriptors a newly created "fake" one overrides are known by the time it is created, so its
modality can be determined properly from their modalities.
Also, the ReadJavaBinaryClassTestGenerated is now a clear JUnit3 test case
Their numbers now start from 1. This is made for consistency with auto-generated sources for these types. Parameters of runtime types (written in Java) are numbered starting with 0, too.
===
open class Ccc() {
fun foo() = 1
}
trait Ttt {
fun foo(): Int
}
class Zzz() : Ccc(), Ttt // there must not be an error here
===
Reported by Andrey Breslav as a bug of Comparator implementation:
===
fun comparator<T>(f: (T, T) -> Int): Comparator<T> = object : Comparator<T>, Object() {
override fun compare(o1: T, o2: T): Int = f(o1, o2)
}
===
that fixes invocation:
>>> StringBuilder.length()
that was compiled to
>>> invokevirtual CharSequence.length()
and now compiles to
>>> invokevirtual StringBuilder.length()
Essentially patch rewrites FunctionDescriptor.containingDeclaration
when FunctionDescriptor is copied to subclass scope.
FunctionDescriptor now has kind field that can be
* DECLARATION (for "real" function, maybe abstract)
* DELEGATION
* FAKE_OVERRIDE (created for functions from supertypes)
All tests pass although some parts of code are buggy and ugly.
Random comments about this patch:
* FunctionDescriptor.overrides point to function descriptors of supertype scopes
* Filling of memberScope with supertypes is moved to OverrideResolver
* ExpressionCodegen.intermediateValueForProperty must be rewritten
* Patch adds not nice REDECLARATION reports (see compiler/testData/diagnostics/tests/*).
Will be fixed later.