Commit Graph

18 Commits

Author SHA1 Message Date
Alexander Udalov 633798db18 Render incompatible impl member in "no impl for header" diagnostic 2017-03-27 19:50:25 +03:00
Alexander Udalov db1f039586 Serialize and deserialize 'header' modifier for descriptors
This fixes KT-17001 because now 'header' modifier is loaded correctly
for deserialized members and the standard disambiguation in
OverloadingConflictResolver.compareCallsByUsedArguments takes place,
where header members are discriminated against the corresponding impl
members

 #KT-17001 Fixed
2017-03-27 19:50:25 +03:00
Alexander Udalov 81774926fa Discriminate header class in resolution from sources in AbstractLazyMemberScope
Similarly to getFirstClassifierDiscriminateHeaders, we select the first
non-header class if possible, otherwise we select just the first class.
This makes sure that a reference will never be resolved to a header
class if the corresponding impl class is present.

Note that overall the issue may not be fixed yet, because there are
other scopes where header classes are not yet discriminated
(LazyImportScope, DeserializedMemberScope). However, at this point I
cannot reproduce this problem with these other scopes

 #KT-15521 Fixed
2017-03-22 20:18:16 +03:00
Denis Zharkov 35e9f0a89a Update a test result temporary
Currently common stdlib doesn't contain Continuation interface
2017-01-27 23:24:13 +03:00
Denis Zharkov 8fa8ba7055 Move coroutine-related runtime parts to kotlin.coroutines.experimental package
#KT-15975 Fixed
2017-01-27 23:24:13 +03:00
Alexander Udalov e4e50017d0 Render header/impl on properties in tests and diagnostic messages
As a side effect, header/impl and some other modifiers on functions are now
rendered in a different, more natural, order
2016-12-26 17:06:24 +03:00
Mikhail Glukhikh 5947d49dee Multi-platform fix: no more errors for top-level impl fun / val / var in IDE 2016-12-19 14:55:49 +03:00
Alexander Udalov da6c3c3231 Support header/impl enum classes
- prohibit constructors for header enum classes
- prohibit bodies for header enum entries
- all entries from header enum must be present in impl enum
2016-12-19 11:54:40 +03:00
Alexander Udalov 56d4ff0cad Support nested header/impl classes 2016-12-19 11:54:38 +03:00
Alexander Udalov a57455ce62 Relax requirements on function modifiers in multiplatform projects
Allow to implement header functions with external/tailrec/inline/infix/operator
functions
2016-12-19 11:53:39 +03:00
Alexander Udalov 7deaf8cc41 Allow impl class to be data class, allow impl constructor properties 2016-12-19 11:50:30 +03:00
Stanislav Erokhin d7566d84d0 Fixed testdata. 2016-12-16 02:01:12 +03:00
Stanislav Erokhin 653d589f98 FIx tests after renaming platform to header. 2016-12-13 23:08:47 +03:00
Stanislav Erokhin 59efedf610 Rename platform to header. 2016-12-13 18:00:00 +03:00
Alexander Udalov 204873edf2 Support "-Xno-check-impl" argument, check only real declarations
Use "-Xno-check-impl" to suppress checking whether the platform declaration
implementation has the "impl" modifier.

Do not check presence of fake overrides from platform class in the impl class,
otherwise there would be a lot of errors about the fact that
equals/hashCode/toString are not marked with the "impl" modifier
2016-11-25 20:50:29 +03:00
Alexander Udalov bbafb7c013 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
2016-11-25 20:50:29 +03:00
Alexander Udalov 8d3f6f1ce7 Check platform<->impl declaration compatibility
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
2016-11-25 20:50:26 +03:00
Alexander Udalov a4169416ad Support platform modifier in back-ends, add multi-platform integration test
Skip 'platform' declarations completely in back-ends
2016-11-25 20:50:22 +03:00