Commit Graph

131 Commits

Author SHA1 Message Date
Alexander Udalov
4484335eac Update light classes test data after d0ed0c4049 2018-03-15 18:23:16 +01:00
Mikaël Peltier
d0ed0c4049 KT-14258 Optimize accesses to properties defined into companion
- Use direct access to property defined into companion object when
it is possible rather than always use an accessor to access the
property.
- Use direct access will speedup runtime performance.
- Avoid to generate useless accessors for companion properties.

Fix of https://youtrack.jetbrains.com/issue/KT-14258
2018-03-14 15:30:40 +01:00
Pavel V. Talanov
498431311c Light classes: test "JvmPackageName" and actual declarations 2018-03-06 12:06:59 +01:00
Pavel V. Talanov
89c82a85d0 Do not build light classes for expect classes
#KT-15482 Fixed
2018-03-05 18:07:36 +01:00
Pavel V. Talanov
fd4e262b1f Minor: modify test for KT-22819 to unmute it on teamcity
#KT-22819 Open
2018-02-12 16:35:56 +01:00
Pavel V. Talanov
9e061d3bbb Fix light class exception on empty multifile facade
Fix generating multifile facade with all members private (in bytecode)
leading to delegate not being generated for corresponding light class

 #KT-20966 Fixed
2017-11-03 16:44:53 +03:00
Nikolay Krasko
94e3a51a45 Test no psi stub mismatch for light classes with suspend in overloads
IdeCompiledLightClassTestGenerated is relevant.
2017-09-14 12:28:26 +03:00
Vyacheslav Gerasimov
89257e6397 Implement light classes for Kotlin scripts 2017-09-12 13:10:38 +03:00
Pavel V. Talanov
19db4304bd Use clsDelegate to calculate hasModifierProperty("final") for light psi
AllOpen plugin can make some changes and we don't have the tools to make
    correct decision based on psi

 #KT-17857 Fixed
2017-06-06 17:11:18 +03:00
Dmitry Petrov
c558e2657b Update testData for light classes after generic signature fixes 2017-05-31 10:18:48 +03:00
Pavel V. Talanov
f750d08350 Light classes: test extending Number and CharSequence 2017-05-16 22:01:06 +03:00
Pavel V. Talanov
798c80ed07 Use wrappers around java.util.* to emulate kotlin.collection.* behaviour
Backend: If kotlin class extends kotlin.collection.List
    write it as it's super interface (light class mode only)
IDE: Provide wrapper classes to java resolve
    that try to emulate backend behaviour

For example if kotlin class implements kotlin.collections.Map,
    we provide a superinterface that has abstract 'getEntries' method
    and 'entrySet' method that is considered default.
In reality all those methods are generated in the class itself.

In IDE supporting this case without hacks is not feasible performance-wise
    since kotlin.collection.* may not be an immediate supertype and we need
    to compute all supertypes just to calculate own methods of the class
2017-05-16 22:01:03 +03:00
Pavel V. Talanov
0571c62943 KtLightElements: make light annotations lazier
Allow to get annotation list and to invoke `findAnnotation` without building delegate
Introduce KtLightNullabilityAnnotation which holds nullability information and is built
    before delegate is built
2017-05-02 15:40:17 +03:00
Pavel V. Talanov
f3dd09beaf Lighter classes: DeprecationLevel.HIDDEN affects codegen 2017-04-24 20:55:50 +03:00
Pavel V. Talanov
ec4da854b8 Codegen: fix NPE in NO_ANNOTATION_VISITOR
EA-100245 fixed
2017-04-18 14:59:49 +03:00
Pavel V. Talanov
3401529be1 IDELightClassContexts#isDummyResolveApplicable: add missing check
Missing check caused exact resolve being applied to every class that had 'equals' overridden
2017-04-18 14:59:43 +03:00
Pavel V. Talanov
2f159bb64b Light classes: do not rely on dummy context when data class autogenerated members conflict with declared members
Fix related issues with nested classes
2017-04-09 15:10:29 +03:00
Pavel V. Talanov
69c250a1b7 Light class test: avoid checking method visibility when NoLaziness is not specified
Allows to avoid putting NoLaziness flag on every test that mentions 'override' modifier
2017-04-09 15:09:15 +03:00
Pavel V. Talanov
32d3a1b4c9 Light classes: generate ACC_STATIC for DefaultImpls classes
To provide consistency between light classes and their delegates

IdeLightClass#testExtendingInterfaceWithDefaultImpls still failing since
    we do not generate implementations delegating to DefaultImpls of superinterfaces
2017-04-09 15:09:13 +03:00
Pavel V. Talanov
4f701285b1 Light class builder: do not generate methods delegating to DefaultImpls in kotlin classes
Class APIs from java point of view stays the same so we can avoid generating those methods
Otherwise we have to calculate all supertypes when getMethods() is called,
    which imposes severe performance penalties
We have to pretend these methods are not 'abstract' (also we consider them 'default' for safety)
    so java highlighting does not report "class should be abstract" for all inheritors
We have to manually report "class should be abstract" on some of the java inheritors,
    specifically those that are implementing interfaces directly
	    as opposed to extending kotlin classes implementing those interfaces
2017-04-09 15:09:01 +03:00
Pavel V. Talanov
ee33879031 Light class tests: hidden deprecated affects codegen
Provide fix later
2017-03-27 17:59:05 +03:00
Pavel V. Talanov
e822a17c0d Lazy light classes: can't use laziness for classes with supertypes delegates 2017-03-27 17:59:03 +03:00
Pavel V. Talanov
2291d91109 KtLightMethod: isVarArgs() does not trigger exact delegate computation 2017-03-27 17:59:01 +03:00
Pavel V. Talanov
a2511232ab Lazy light classes: fix visibility modifier in case of inherited protected visibility 2017-03-27 17:58:53 +03:00
Pavel V. Talanov
a81bac0b50 LightClassTest: test corner cases related to inherited visiblity
EA-99155
 #KT-16899 Fixed
2017-03-27 17:58:51 +03:00
Pavel V. Talanov
8054020f61 IDELightClassContexts: @PublishedApi affects codegen 2017-03-15 20:55:02 +03:00
Pavel V. Talanov
d34b73befb Light class codegen: all objects are considered static
Simplify code handling access flag computation
Fix a problem where kotlin nested object wasn't producing a nested light class
2017-03-15 20:55:01 +03:00
Pavel V. Talanov
fa58f1b4d7 KtLightMethod(Field): use dummyDelegate to determine modifier properties 2017-03-15 20:54:59 +03:00
Pavel V. Talanov
ac368ac182 Light classes test: test methods & fields with same name 2017-03-15 20:52:25 +03:00
Pavel V. Talanov
955fe9e1e6 Light class tests: add tests
- test Jvm* annotations with wrong arguments
  - test JvmStatic annotation
  - test JvmName annotation
2017-03-15 20:52:24 +03:00
Dmitry Jemerov
a57748f4f4 @JvmOverloads-generated overloads of final methods are also final; test to verify that overloads of deprecated methods are deprecated 2016-11-18 11:05:03 +01:00
Mikhail Glukhikh
e7e56ab85c KT-8442 related: destructuring declarations aren't taken into account during light classes generation, fixes EA-81204 2016-10-25 13:13:11 +03:00
Pavel V. Talanov
ae0d450acf Light class test for classes with dollars in name 2016-07-28 18:00:58 +03:00
Alexander Udalov
24682bf1ec Fix AssertionError on property generation in multi-file classes
See 4a533168d9 for the original change which
introduced the problem

Note that the added test case _was not failing_ before the change. It's added
because there were no tests on multi-file class behavior in light classes mode
at all. The actual repro for the problem is difficult to make a test from

 #KT-12755 Fixed
2016-07-04 15:42:35 +03:00
Alexey Sedunov
fefa0baeee Light Classes: Generate light wrappers for annotation entries 2016-03-24 17:41:58 +03:00
Dmitry Jemerov
970d6f6834 generate local variables table for @JvmOverloads-generated methods
#KT-7319 Fixed
2016-02-02 12:11:51 +01:00
Michael Bogdanov
e116cc3206 Private visibility for non-const, non-jvmField class companion property backing field 2015-12-29 16:45:22 +03:00
Michael Bogdanov
f870e365fa Removed accessors for const properties 2015-12-25 11:28:10 +03:00
Michael Bogdanov
b4db23a7b3 Removed 'INSTANCE' field from companions 2015-12-24 13:59:45 +03:00
Michael Bogdanov
2e73559f33 Removed 'INSTANCE$' field generation 2015-12-24 13:59:44 +03:00
Michael Bogdanov
7c7786f7d0 Generate private methods in TraitImpl as private, don't generate delegation to private trait methods 2015-12-12 11:41:36 +03:00
Pavel V. Talanov
fb19552920 Mark enum entries that are deprecated in Kotlin as deprecated in bytecode 2015-12-10 11:12:22 +03:00
Nikolay Krasko
2ff0b13808 Run psi check on light classes from compiled Kotlin 2015-11-18 13:34:25 +03:00
Dmitry Jemerov
736b496f6a drop deprecated @platformName and @platformStatic annotations 2015-11-02 17:00:44 +01:00
Pavel V. Talanov
69b3e5e21e Add light class test for annotation class 2015-11-02 18:38:20 +03:00
Yan Zhulanow
2a28baa154 Remove ACC_STATIC from DefaultImpls 2015-10-26 20:37:29 +03:00
Michael Bogdanov
18f3eb87e4 INSTANCE field deprecated in companion object
Fix for KT-9692: Deadlock between <clinit> of a class (KtSimpleNameExpressionImpl) and <clinit> of its companion object

 #KT-9692 Fixed
2015-10-23 17:39:27 +03:00
Michael Bogdanov
c8c3e88c82 Make top-level property backing field private in bytecode 2015-10-19 19:09:30 +03:00
Dmitry Petrov
dda508234f Drop package facades:
- update tests
- cleanup JetTyMapper after rebase
2015-10-19 16:03:22 +03:00
Dmitry Petrov
dc399ac46b Drop package facades: get rid of isPackageClassFqName 2015-10-19 16:03:18 +03:00