Check platform<->impl compatibility for class members

When matching platform and impl classifiers, ensure that each declaration from
the platform class scope is present in the impl class scope.

Note that the presence of the 'impl' modifier is not checked yet
This commit is contained in:
Alexander Udalov
2016-11-22 18:18:13 +03:00
parent 8d3f6f1ce7
commit bbafb7c013
21 changed files with 294 additions and 27 deletions
@@ -0,0 +1,3 @@
platform class Foo {
fun function(s: String)
}
@@ -0,0 +1 @@
impl class Foo
@@ -0,0 +1,19 @@
-- Common --
Exit code: OK
Output:
-- JVM --
Exit code: COMPILATION_ERROR
Output:
compiler/testData/multiplatform/classScopes/missingFunction/common.kt:1:16: error: no definition is found for platform declaration 'Foo'
The following declaration is incompatible because some members are not implemented.
No implementations are found for members listed below:
public final platform fun function(s: String): Unit
platform class Foo {
^
compiler/testData/multiplatform/classScopes/missingFunction/jvm.kt:1:1: error: modifier 'impl' is only applicable to members that are initially declared in platform-independent code
impl class Foo
^