Commit Graph

35687 Commits

Author SHA1 Message Date
Yan Zhulanow b54df7a945 Kapt3: Do not resolve declaration bodies if possible in kapt 2016-12-05 19:57:44 +03:00
Yan Zhulanow d884830700 Allow to avoid declaration body resolution for function and property initializers if the return type is explicitly specified. This significantly reduces the analysis time in kapt3. 2016-12-05 19:57:43 +03:00
Yan Zhulanow 90cbf172d2 Kapt3: Use annotation simple name if the annotation declaration is inside the same package as the current source file's package 2016-12-05 19:57:42 +03:00
Yan Zhulanow 1f1491f1ca Kapt3: Fix a number of errors in ClassFileToSourceStubConverter:
1. Support strictfp modifier for methods.
2. Support Kotlin top-level methods and properties.
3. Fix visibility modifiers on enum methods.
2016-12-05 19:57:41 +03:00
Yan Zhulanow e22ce14c36 Kapt3: Review fixes 2016-12-05 19:57:40 +03:00
Yan Zhulanow 3a29bf5e01 Minor: Add 'impls' to dictionary 2016-12-05 19:57:39 +03:00
Yan Zhulanow 86aa82da6c Kapt3: Minor: Refactor kapt3 module (move/rename) 2016-12-05 19:57:38 +03:00
Yan Zhulanow e61a7c7f2c Kapt3: Minor: Annotation processor classes may be initialized only once, so SIMPLE_PROCESSOR became a factory method 2016-12-05 19:57:37 +03:00
Yan Zhulanow 03244123c9 Kapt3: Minor: Measure stub generation time 2016-12-05 19:57:36 +03:00
Yan Zhulanow 6b1fc6fc39 Kapt3: Output stubs to .java files in verbose mode 2016-12-05 19:57:35 +03:00
Yan Zhulanow aa15e0ad67 Kapt3: Run Javac annotation processing in the kapt3 plugin.
There are two modes:
1. Run only annotation processing (like kapt1 with stubs + javac). Seems that it may be faster to process annotations once before Kotlin compilation than launching AP on each IC round.
2. Run AP, repeat analysis and compile Kotlin classes (like kapt2). This mode doesn't support IC for now.
2016-12-05 19:57:35 +03:00
Yan Zhulanow bd9d33fe44 Kapt3: Replace kapt2 in Ant and Maven artifacts with kapt3 2016-12-05 19:57:34 +03:00
Yan Zhulanow 64046f1e40 Kapt3: Add simple AP test with Kotlin 2016-12-05 19:57:33 +03:00
Yan Zhulanow 5b780ec56c Kapt3: Parse generic signatures of methods and fields 2016-12-05 19:57:32 +03:00
Yan Zhulanow efd25de13f Kapt3: Parse generic signatures of classes.
Refactoring (move TreeMaker helper functions to KaptTreeMaker, mapValues() and others to utils.kt).
2016-12-05 19:57:31 +03:00
Yan Zhulanow e4158a5571 Kapt3: Number of bugfixes in JCTreeConverter:
Convert Java primitive and array types properly.
Enums: ignore first two synthetic constructor parameters, do not generate super class constructor call, add ACC_ENUM flag to enum values, do not generate "values" and "valueOf" methods.
Provide a JavaFileObject for JCCompilationUnit.
Handle DefaultImpls, ignore empty DefaultImpls classes.
Use a name table from Javac Names.
2016-12-05 19:57:30 +03:00
Yan Zhulanow e131763cb0 Kapt3: Put static modifiers on nested non-inner classes.
Do not initialize synthetic and static fields in constructor.
2016-12-05 19:57:29 +03:00
Yan Zhulanow 68c2e8d71d Kapt3: Do not generate body for abstract methods.
Add java.lang.Override annotation for overrides.
Ignore java.lang.Synthetic annotation.
2016-12-05 19:57:28 +03:00
Yan Zhulanow 10cfde4ab9 Kapt3: Call super class constructor with some default parameters.
Allow interface, annotation, enum modifiers on class.
2016-12-05 19:57:27 +03:00
Yan Zhulanow edaadb0d48 Kapt3: Initialize final fields in class constructors 2016-12-05 19:57:27 +03:00
Yan Zhulanow 666a522fed Kapt3: Generate empty body for constructor and void methods 2016-12-05 19:57:26 +03:00
Yan Zhulanow 4305706c16 Kapt3: Filter only relevant modifiers 2016-12-05 19:57:25 +03:00
Yan Zhulanow 5f45b41d53 Kapt3: Initial implementation of JCTreeConverter 2016-12-05 19:57:24 +03:00
Yan Zhulanow f07f367ff6 Kapt3: Add kapt3 compiler plugin 2016-12-05 19:57:23 +03:00
Yan Zhulanow fc0b17c453 Kapt3: Replace "my/package/Class$Inner" to "my/package/Class/Inner" in kapt3 class builder mode 2016-12-05 19:57:21 +03:00
Yan Zhulanow 65a9d9e8d2 Kapt3: Handle exceptions while annotation processing gracefully 2016-12-05 19:57:20 +03:00
Yan Zhulanow aae80fa4ab Kapt3: Add Kapt runner 2016-12-05 19:57:19 +03:00
Nikolay Krasko 726471d98e Avoid loading psi for compiled kotlin file if it's possible to get declaration by name from stubs 2016-12-05 17:22:42 +03:00
Mikhail Glukhikh 299f477a1b Call method references search in UnusedSymbolInspection.hasReferences to fix secondary constructor search
Makes #KT-12500 Fixed
Makes #KT-12501 Fixed
2016-12-05 10:58:21 +03:00
Alexey Andreev 784fe31053 JS: fix translation of calls with aliased labeled lambda arguments. Fix KT-14999 2016-12-05 09:19:06 +03:00
Ilya Gorbunov a6fb61f5c3 Fix various maven pom problems:
- Add relativePath to samples pom.
- Specify versions of plugins
2016-12-04 14:15:34 +03:00
Alexey Andreev df88ebb1b3 KT-12877: don't throw exception when @JsModule annotation is improperly used 2016-12-03 17:15:11 +03:00
Alexey Andreev d40e923722 KT-12877: minor fixes and cleanup 2016-12-03 17:15:10 +03:00
Alexey Andreev d1820b42ef KT-12877: fix code formatting in tests 2016-12-03 17:15:10 +03:00
Alexey Andreev d63a727474 KT-12877: support plain reference to declaration in UMD wrapper, support plain reference to package 2016-12-03 17:15:09 +03:00
Alexey Andreev 495c876b3b KT-12877: add tests for UMD modules 2016-12-03 17:15:09 +03:00
Alexey Andreev 31a1d6ca66 KT-12877: add diagnostics on JsModule/JsNonModule:
1) for all cases of misusing of JsModule report on JsNonModule as well
2) report about non-top-level declarations with JsModule/JsNonModule
3) report about JsModule/JsNonModule declarations inside file marked with JsModule/JsNonModule
4) report about usages of declarations not marked with both JsModule and JsNonModule from UMD module
2016-12-03 17:15:08 +03:00
Alexey Andreev 08a7f9c298 KT-12877: reorganize JS module tests to support different module systems. Test JsModule in conjunction with JsNonModule and plain module type 2016-12-03 17:15:08 +03:00
Alexey Andreev 0238b182cc KT-12877: add JsNonModule with support on front-end 2016-12-03 17:15:07 +03:00
Alexey Andreev 3f2ec6871d KT-12877: add some front-end diagnostics for JsModule 2016-12-03 17:14:30 +03:00
Alexey Andreev 7be872ebca KT-12877: modify tests to check whether mutable top-level properties of JsModule files are supported 2016-12-03 17:14:29 +03:00
Alexey Andreev b1d8f91212 KT-12877: fix how native calls and property references are translated to be make them work with JsModule annotation 2016-12-03 17:14:29 +03:00
Alexey Andreev ac703dfda6 KT-12877: serialize information about file annotations. For each top-level declaration store containing file. Use this information to properly handle file-targeted JsModule. 2016-12-03 17:14:29 +03:00
Alexey Andreev 6df40559f0 KT-12877: initial simple implementation of JsModule. Remove unnecessary ModuleDescriptor from several classes in pipeline 2016-12-03 17:14:28 +03:00
Ilya Gorbunov 75d80acac9 Rework existing unit tests used as samples. 2016-12-02 22:41:25 +03:00
Ilya Gorbunov 57cef391ac Create a separate project for stdlib samples. 2016-12-02 22:41:25 +03:00
Mikhail Zarechenskiy 160d43fe2e Introduce new feature: division by zero in constant expressions 2016-12-02 17:42:56 +03:00
Anton Bannykh 3e4376f4ba JS: don't omit guard for catch with Throwable type (KT-13616); don't generate guard for catch with dynamic type (KT-13615) 2016-12-02 17:13:02 +03:00
Alexey Sedunov 475ae0d638 Rename: Suggest respective parameter name for the local variable passed to function
#KT-14792 Fixed
2016-12-02 14:14:10 +03:00
Alexey Sedunov b6d4bb4921 Create from Usage: Support adding type parameters to the referenced type
#KT-11760 Fixed
2016-12-02 14:14:09 +03:00