Prepend the platform name to the diagnostic in a common module, which is
reported when sources of that common module are analyzed as a part of the
platform source set: "<!JVM:...!> ... <!>". Fix some existing tests, mostly by
adding "impl" to implementations
Properties are only allowed to be declared in a header class' primary
constructor if that class is an annotation class. However, we did not correctly
determine that such properties are also "header". The test passed because the
diagnostic was lost
For each platform declaration, there must be at least one impl declaration in
the module with the compatible signature; similarly, for each impl declaration,
there must be at least one platform declaration with the compatible signature.
Note that currently the presence of the 'impl' modifier is not checked yet.
Also, the sad fact is that if you have platform and impl declarations which are
not compatible, you get two errors: on the platform delcaration and on the impl
declaration. This needs to be addressed as well
E.g. 'impl typealias Foo<A, B> = Bar<A, B>' is allowed; everything else
(variance, changing order of parameters, etc.) is pretty much disallowed.
This is done for simplicity: otherwise matching the platform/impl class scopes
would be not so straightforward
Do not report "unused parameter" for parameters of platform declarations. Do
not allow platform class constructors to have val/var parameters or have an
explicit delegation call to another constructor. Do not allow platform classes
to have 'init' blocks.
Also suppress the "supertype not initialized" error for platform classes: the
supertype should be initialized in the impl class
Also add a new capability for ModuleDescriptor, which is used to obtain the
platform in the multi-platform scenario in tests.
Suppress the following errors for platform functions: "function has no body"
and "nothing to inline". Also do not report redeclaration between platform and
non-platform functions because this is the case when the common +
platform-specific code are analyzed together.
Note that some diagnostics reported in tests are not yet implemented in this
commit, they appear in subsequent commits