Commit Graph

31736 Commits

Author SHA1 Message Date
Alexander Udalov 76d78ba666 Remove LazyResolveTestUtil, refactor usages to use JvmResolveUtil
LazyResolveTestUtil.resolve by now had almost exactly the same code as
JvmResolveUtil.analyze.

LazyResolveTestUtil.resolveLazily with 3 parameters was only used in
LoadBuiltinsTest, inline it there.

Move LazyResolveTestUtil.getTopLevelPackagesFromFileList to
AbstractDiagnosticsTest, the only place where it was used
2016-05-23 14:47:00 +03:00
Alexander Udalov a85e98a078 Minor, inline unnecessary method of TopDownAnalyzerFacadeForJVM
The TopDownAnalysisMode parameter was TopLevelDeclarations everywhere
2016-05-23 14:47:00 +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
Alexander Udalov 8a00cabce6 Minor, do not copy CompilerConfiguration in Android codegen tests
This is needed to avoid passing a custom configuration to
GenerationUtils.compileManyFilesGetGenerationStateForTest, but rather take it
from the environment in a future commit
2016-05-23 14:47:00 +03:00
Alexander Udalov 6d6488e795 Pass CompilerConfiguration to TopDownAnalyzerFacadeForJVM
In most cases, the configuration can be loaded from KotlinCoreEnvironment. In
other cases, such as IDE tests, there's no environment, so we pass EMPTY. Since
currently the configuration is only used to load incremental compilation
components and module information, it's fine to pass EMPTY
2016-05-23 14:47:00 +03:00
Alexander Udalov 6c0ff40197 Move JVMConfigurationKeys to frontend.java
Similarly to K2JVMCompilerArguments, they will soon be needed in the IDE code.
Move COMPILER_JAR_LOCATOR to CLIConfigurationKeys because it's used both in JVM
and JS, and only in CLI. Other keys, non-relevant in the IDE, may be moved out
soon as well, such as incremental compilation components
2016-05-23 14:47:00 +03:00
Alexander Udalov dcb2d7b4f6 Minor, break the line in "kotlinc -help" if it's too long
To improve description of the "pluginOptions" flag
2016-05-23 14:47:00 +03:00
Mikhail Glukhikh 1a8181bdc4 Only private constructors for sealed / enum classes #KT-12377 Fixed
Also #KT-8497 Fixed
2016-05-23 13:08:57 +03:00
Mikhail Glukhikh cffdce908e Annotation parameters now cannot be mutable #KT-12367 Fixed 2016-05-23 13:04:00 +03:00
Alexey Andreev 81bdd6b4bb JS: improve performance of Hashtable-based collections 2016-05-23 12:23:27 +03:00
Alexey Andreev f0ee52faaf KT-11086 Treat initializer of a companion object as a class initializer 2016-05-23 12:22:50 +03:00
Alexey Andreev c5eaea846d KT-7424: add test to show that inlining works for anonymous functions 2016-05-23 12:22:50 +03:00
Alexey Andreev db5baf7fa7 KT-8386: pass mutable list to JsInvocation from intrinsic generator, so that inliner had a chance to replace arguments 2016-05-23 12:22:50 +03:00
Pavel V. Talanov d03fedde74 Implement "Decompile Kotlin to Java" action
Add this action to "Attach sources" notification panel if present
 #KT-11657 Fixed
2016-05-23 12:12:13 +03:00
Pavel V. Talanov 68dd176d66 Minor: typo in changeLog 2016-05-23 11:54:16 +03:00
Pavel V. Talanov 6e9a35b432 Minor, missed '#' 2016-05-23 11:54:14 +03:00
Pavel V. Talanov 7606b4c69d Update ChangeLog for 1.0.3
Improve ticket number presentation for 1.0.3
2016-05-23 11:54:12 +03:00
Dmitry Petrov 968ed3f091 KT-5068: Introduce a special diagnostic message for TYPE_MISMATCH cases such as 'fun f(): Int = { 1 }'. 2016-05-23 09:50:41 +03:00
Nikolay Krasko 8b06d919b4 Restore packing plugin-api module output to plugin 2016-05-20 19:40:07 +03:00
Nikolay Krasko 58d24d76c4 Check there's no direct usages of asm (org.objectweb.asm) library in project
Such usages should be replaced with asm from idea (org.jetbrains.org.objectweb.asm)
2016-05-20 15:51:57 +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
Nikolay Krasko 4e0d4681ed Remove kotlin-for-upsource target. Upsource doesn't use this artifact anymore. 2016-05-20 15:51:54 +03:00
Stanislav Erokhin db64d9c528 Fixed visibility checks for annotation usage on top-level declarations
#KT-12429 Fixed
2016-05-20 14:58:18 +03:00
Stanislav Erokhin a42b8d56b4 Minor. Removed redundant field for several anonymous objects. 2016-05-20 14:58:18 +03:00
Alexander Udalov b5355358a5 Remove SAFE_CALL_IN_QUALIFIER diagnostic which was never reported
See UNEXPECTED_SAFE_CALL which is reported instead
2016-05-20 14:53:07 +03:00
Alexander Udalov ca7e4496c7 Refactor and improve class literal type checking code
Infer something sensible instead of error types when an error is reported, such
as absence of a type argument for Array or presence of type arguments for other
types
2016-05-20 14:53:07 +03:00
Alexander Udalov 1b79770121 Do not produce trailing space when rendering root package header 2016-05-20 14:53:07 +03:00
Dmitry Petrov dd12c018ca KT-8990: private member can't be overridden, even if it is visible in the current context 2016-05-20 14:32:48 +03:00
Dmitry Petrov 15c47ead97 (minor) KT-11588 Type aliases: fix conflicts after rebase. 2016-05-20 14:17:26 +03:00
Dmitry Petrov a2ec580119 KT-11588 Type aliases
Type alias stubs indexing (required for index-based declaration providers)
2016-05-20 14:17:26 +03:00
Dmitry Petrov 8bf87a9a4f KT-11588 Type aliases
Proper abbreviated type for '<type-alias>?'
2016-05-20 14:17:26 +03:00
Dmitry Petrov 440e02016b KT-11588 Type aliases
Fix diagnostic tests (renamed diagnostic message)
2016-05-20 14:17:25 +03:00
Dmitry Petrov 32f61c3918 KT-11588 Type aliases
Deserialization
2016-05-20 14:17:25 +03:00
Dmitry Petrov f296b17861 KT-11588 Type aliases
Additional test(s)
2016-05-20 14:17:25 +03:00
Dmitry Petrov 75e08ace17 KT-11588 Type aliases
Make type alias expansion PSI-independent
2016-05-20 14:17:25 +03:00
Dmitry Petrov 65293008fd KT-11588 Type aliases
Type alias descriptor serialization
Types with type aliases serialization
2016-05-20 14:17:24 +03:00
Dmitry Petrov 59472927cd KT-11588 Type aliases
Light class generation: do not fail on type aliases
TODO: actual binary representation for type aliases
2016-05-20 14:17:24 +03:00
Dmitry Petrov a4406687f1 KT-11588 Type aliases
Resolution & expansion for type aliases.
NB: Nested type aliases capturing type parameters of outer classes are not supported yet.
2016-05-20 14:17:24 +03:00
Dmitry Petrov ec94893189 KT-11588 Type aliases
Parse type aliases as top-level, member, and local declarations.
2016-05-20 14:17:24 +03:00
Mikhail Glukhikh ceb4aa7ac0 Cleanup: simplify for 2016-05-20 13:38:46 +03:00
Mikhail Glukhikh ebd57fafd7 Cleanup: val can be parameter 2016-05-20 13:38:42 +03:00
Dmitry Petrov b86fb64008 KT-12358: fake override of a method of 'Any' in an interface is not an "implementation". 2016-05-20 13:02:29 +03:00
Stanislav Erokhin 74bddcfb70 Refactoring. Convert Annotated to kotlin. 2016-05-20 09:32:55 +03:00
Stanislav Erokhin 450ea78b1d Refactoring. Convert KotlinType to kotlin. 2016-05-20 09:32:54 +03:00
Stanislav Erokhin 8c2d68fff0 Refactoring. Move specificity relations into TypeSpecificityComparator component. 2016-05-20 09:32:53 +03:00
Stanislav Erokhin 921eb8402c Transform OverloadUtil into OverloadChecker component. 2016-05-20 09:32:53 +03:00
Stanislav Erokhin c4778bfe5a Fixed type checking recursive problem.
#KT-11995 Fixed
2016-05-20 09:26:56 +03:00
Alexander Udalov 1c8272d3f1 Simplify data class function generation and signature lookup code
- change prerequisites for generating equals/hashCode/toString in a data class:
  previously they were generated if the corresponding method is trivial (i.e.
  it comes from kotlin.Any), now we're generating it always unless it'll cause
  a JVM signature clash error (see KT-6206)
- use static KotlinBuiltIns.isXxx methods to compare types instead of checking
  against descriptors loaded from certain built-ins instance, this is quicker
  and more correct in environments where several built-ins are possible
- don't use isOrOverridesSynthesized, it's not relevant for
  equals/hashCode/toString because functions with these names are never
  synthesized

 #KT-6206 Fixed
2016-05-20 00:54:19 +03:00
Alexander Udalov 2200bfcc85 Simplify ImplementationBodyCodegen#generateToArray
- don't do anything for interfaces because there's no point in generating
  abstract methods which are already abstract in supertypes
- don't use getDeclaredFunctionByRawSignature, check function signature
  manually instead
- don't use isOrOverridesSynthesized because 'toArray' is never synthesized
2016-05-20 00:54:18 +03:00
Alexander Udalov b208995d73 Render different class kinds differently in bytecode listing test 2016-05-20 00:36:56 +03:00