Commit Graph

367 Commits

Author SHA1 Message Date
Mikhail Glukhikh 692623cb55 Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X) 2016-07-27 16:24:18 +03:00
Nikolay Krasko 2783c9bde2 Fix AbstractAnnotationProcessorBoxTest on Windows: load text without \r 2016-07-07 02:51:25 +03:00
Alexander Udalov 6ba32ed624 Refactor CallChecker and subclasses
Encapsulate everything that is needed in checkers into CallCheckerContext. Pass
an instance of this context instead of BasicCallResolutionContext to checkers.

Also pass an instance of the element to report errors on: this is useful
because before this, every checker had its own way of determining where should
the error be reported on. Some of them, for example, were not doing anything if
Call#calleeExpression returned null, which is wrong, see operatorCall.kt

 #KT-12875 Open
2016-06-29 19:20:00 +03:00
Yan Zhulanow bb083a51cc KT-12895, EA-84877: Fix NoSuchMethodError thrown when saving a Kotlin file.
newOutputStreamSupplier() is deprecated and was deleted in Guava 18.
2016-06-29 17:52:25 +03:00
Michael Bogdanov 3b419e8ba3 Fix for KT-11964: No TABLESWITCH in when on enum bytecode if enum constant is imported
#KT-11964 Fixed
2016-06-29 09:32:45 +03:00
Mikhael Bogdanov db5d9940df Added 'isInline' implementation to property accessor descriptors 2016-06-24 17:05:48 +03:00
Yan Zhulanow 6e6c9682ec Fix KT-12173 (Kotlin Lint False Positive for "Toast created but not shown" inside SAM adapter).
(cherry picked from commit 4940d3b)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 1720f8b4ff KT-12681 (Lint: run from main menu / Analyze: Kotlin inspections reports only java source)
Cause we've copied Lint diagnostics to the Kotlin project, there's no harm in making them Kotlin-only.
(cherry picked from commit 7105648)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 8f75ababde KT-12674 "Calling new methods on older versions" errors for inlined constants
Inlined constants from Java should not be detected.
(cherry picked from commit b34ee4e)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 206e439595 KT-12023 Kotlin Lint: Cast doesn't trigger minSdk error
Check Kotlin as/is types.
(cherry picked from commit c0db8e0)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 1de05b965e KT-12015 (Kotlin Lint False Positive for Bundle.getInt())
Java approach is not sufficient here, in Kotlin receivers can be implicit.
Use Kotlin extension/dispatch receivers to figure out the receiver type for our method call.
(cherry picked from commit cdedf1d)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 530ab42de6 Android Extensions: Fix KT-10969 (NullPointerException when finding view in Fragment if getView() is null)
(cherry picked from commit 80f5852)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 2cd0e9c8d8 Fix EA-80764. Do not try to get the resource manager for the disposed module
(cherry picked from commit c3bd243)
(cherry picked from commit cddcf02)
2016-06-24 15:10:19 +03:00
Yan Zhulanow e0243fd568 Fix EA-82394. PsiType.getClassName() can return null. Return "<anonymous type>" in that case.
(cherry picked from commit 8be1335)
(cherry picked from commit 5101596)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 1a0acf3208 Fix EA-82166. NPE. loadModel() can return null, and it's a bad idea to call methods on a null pointer.
(cherry picked from commit cf033d0)
(cherry picked from commit 37dc0ae)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 001d5397c5 Fix EA-82449. Do not run Lint diagnostics if the project is already disposed
(cherry picked from commit 98b2899)
(cherry picked from commit 2179ee8)
2016-06-24 15:10:19 +03:00
Yan Zhulanow c5e0f992e5 KT-12387 Fix Performance problem with Lint in IDE
Call checkCanceled() before running Lint diagnostics (UastScanner)
(cherry picked from commit c6e328a)
(cherry picked from commit 696475e)
2016-06-24 15:10:19 +03:00
Yan Zhulanow 4ee19cce93 Fix #KT-12047 (Kotlin Lint: "Missing @JavascriptInterface on methods" does not report anything)
(cherry picked from commit 61e8e01)
(cherry picked from commit dbc54e2)
2016-06-24 15:10:19 +03:00
Yan Zhulanow d1447faf2b Fix #KT-12015 (Kotlin Lint False Positive for Bundle.getInt()).
Android firstly checks API version against the function call receiver type, so we should do the same to be consistent.
(cherry picked from commit c3d01ec)
(cherry picked from commit 5c78acc)
2016-06-24 15:10:19 +03:00
Denis Zharkov 1b82e43d76 Add LanguageFeatureSettings parameter to single method in checkers interfaces
This parameter will be used further for target-dependent checks

Also introduce SimpleDeclarationChecker/SimpleCallChecker sub-interfaces (more weak ones)
Implementing them instead of base checkers is more convenient in most cases
2016-06-09 17:57:15 +03:00
Stanislav Erokhin f41c8dc045 Refactoring. Removed several usages of asSimpleType 2016-06-09 12:58:00 +03:00
Stanislav Erokhin 957bae18be Refactoring. Move flexible type creation to KotlinTypeFactory. 2016-06-09 12:57:44 +03:00
Stanislav Erokhin 3a451744c5 Introduce KotlinTypeFactory 2016-06-09 12:57:43 +03:00
Nikolay Krasko a6b16f6d00 Move uast dependency modules before idea module that now contains uast too. 2016-06-02 14:38:44 +03:00
Alexander Udalov da42023dd9 Support new callable reference expressions in UAST
Manually mute the class literal test in apiCheck.kt; support for new class
literal expressions is postponed because it's not straightforward to combine
both unbound (Type::class) and bound (instance::class) class literals in one
UClassLiteralExpression: in Java they're two very different expressions
(Type.class and instance.getClass())
2016-05-26 22:22:41 +03:00
Alexander Udalov 6674412079 Rename compilerConfigurationForTests -> newConfiguration 2016-05-26 11:47:30 +03:00
Alexander Udalov f8816b5d67 Pass CompilerConfiguration to GenerationState instead of ton of parameters 2016-05-23 14:49:26 +03:00
Alexander Udalov 0124cb64f0 Cleanup test utilities in JvmResolveUtil and GenerationUtils
Simplify usages and fix some warnings along the way.

Rename:
- analyzeFilesWithJavaIntegration, analyzeOneFileWithJavaIntegration -> analyze
- analyzeFilesWithJavaIntegrationAndCheckForErrors,
  analyzeOneFileWithJavaIntegrationAndCheckForErrors -> analyzeAndCheckForErrors
- compileFilesGetGenerationState, compileManyFilesGetGenerationStateForTest ->
  compileFiles
- compileFileGetGenerationStateForTest -> compileFile
- compileFileGetClassFileFactoryForTest -> compileFileTo
2016-05-23 14:47:00 +03:00
Nikolay Krasko a801d8fa6f Don't use reference to asm directly. Use asm from Idea instead. 2016-05-20 15:51:55 +03:00
Stanislav Erokhin 7332032bb6 Support sealed class inheritors in the same file
#KT-11573 Fixed
2016-05-19 16:22:40 +03:00
Nikolay Krasko add07ad1a5 Remove unused import 2016-05-18 13:33:18 +03:00
Nikolay Krasko 89a10578f4 Remove unused method that causes compatibility problem in update AS plugin 2016-05-17 21:34:00 +03:00
Mikhail Glukhikh 9bd3be68f7 Code cleanup: protected is effectively private 2016-05-13 17:57:17 +03:00
Yan Zhulanow 99b619497a Fix EA-81689 2016-05-11 21:37:16 +03:00
Alexey Tsvetkov 60c5c8a2cc Fix Application leak in AbstractAnnotationProcessorBoxTest 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov 6f3ea01084 Refactoring: rename ClassBuilderMode entry LIGHT_CLASSES_WITH_METADATA->KAPT 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov 10b9be9f51 Fix collecting source retention annotations
#KT-12187 fixed
2016-05-11 20:41:48 +03:00
Alexey Tsvetkov fb8ed25e99 Report compiled classes when generating kapt stubs 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov 4b591d2220 Include metadata in light classes for kapt 2016-05-11 20:41:48 +03:00
Alexey Tsvetkov 12531c4a90 Make annotation collector tests more thorough 2016-05-11 20:41:48 +03:00
Valentin Kipyatkov b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Mikhail Glukhikh 5c9d6fd460 UAST: unnecessary 'val' removed from constructor 2016-04-27 18:42:08 +03:00
Mikhail Glukhikh ee46c34a5e Android: unnecessary 'val's removed from constructors 2016-04-27 18:42:00 +03:00
Denis Zharkov 0d4a132be5 Minor. Regenerate tests 2016-04-25 17:41:08 +03:00
Stanislav Erokhin a1d052b8fa Refactoring. Remove FlexibleTypeFactory.DEFAULT and refactor flexible type creation by special fq-name for tests. 2016-04-25 15:28:46 +03:00
Stanislav Erokhin 0a4ad3f267 Refactoring. Rename FlexibleTypeCapabilities -> FlexibleTypeFactory. Also use factory.create instead of DelegatingFlexibleType.create. 2016-04-25 15:28:46 +03:00
Yan Zhulanow d478b90fb8 Lint: Fix KT-12009: IAE at JavaContext.getLocation() 2016-04-22 19:48:28 +03:00
Yan Zhulanow 9ea7a4f112 Lint: run inspections only for Kotlin 2016-04-22 19:48:28 +03:00
Yan Zhulanow 04ed20c574 Lint: Remove AssertDetector (unrelated to Kotlin) 2016-04-22 19:48:28 +03:00
Yan Zhulanow cbe21ab568 Minor: Fix Uast blinking tests 2016-04-22 19:48:28 +03:00