Commit Graph

2557 Commits

Author SHA1 Message Date
Natalia Ukhorskaya d9d045cbb2 Fix line separators for windows in tests 2014-03-07 18:05:12 +04:00
Mikhael Bogdanov e54ece8d12 Field access chain update on lambda regeneration 2014-03-07 16:12:10 +04:00
Alexander Udalov 0b2c832343 Write KotlinSyntheticClass to anonymous and local classes 2014-03-07 03:08:19 +04:00
Alexander Udalov cbfb626d50 Write KotlinSyntheticClass to generated classes for functions
That is SAM wrappers, callable reference wrappers, local functions and
anonymous functions
2014-03-07 03:08:18 +04:00
Alexander Udalov 36936e0a6b Minor fix in tests for sources appearing in libraries 2014-03-07 03:08:16 +04:00
Alexander Udalov 64ac223895 Move DebugProtoBuf to module "compiler-tests"
To help debug serialization-related code in compiler tests
2014-03-07 03:08:16 +04:00
Alexey Sedunov 36633af275 Extract JSON utility functions 2014-03-04 19:45:36 +04:00
Alexey Sedunov d2f6b55cb5 Box qualified names of package directives into dot-qualified expressions 2014-03-04 19:45:30 +04:00
Alexander Udalov 3a0a688ebc Add test on KotlinSyntheticClass annotation for $$TImpl 2014-03-04 18:19:43 +04:00
Alexander Udalov eb5aba560e Load class kind in KotlinSyntheticClass annotation
Fix some of the usages of KotlinSyntheticClass header where really package
parts were meant (they were committed by mistake).

DescriptorResolverUtils.isCompiledKotlinPackageClass no longer checks for class
being a compiled package part, because PSI classes are not built for package
parts (according to EmptyPackageFragmentClsStubBuilderFactory)
2014-03-04 18:19:42 +04:00
Ilya Klyuchnikov ea40389e34 validating android annotations 2014-03-04 14:28:53 +04:00
Mikhael Bogdanov 7995ffb798 Support regeneration of non inlinable lambdas/local funs/sams 2014-03-03 15:43:39 +04:00
Mikhael Bogdanov 4f5b20a8db Test framework for inline 2014-03-03 15:43:35 +04:00
Alexander Udalov d04ee09636 Rename "import jet" to "import kotlin" in Java sources 2014-03-02 21:33:22 +04:00
Alexander Udalov cfe3619db7 Introduce KotlinSyntheticClass annotation
Will be used instead of KotlinPackagePart, KotlinTraitImpl and other
hypothetical annotations we were planning to write on our synthesized classes
(lambdas, local functions, etc.)
2014-03-02 19:55:29 +04:00
Alexander Udalov 787b4753c7 Copy KotlinSignature to package "kotlin.jvm"
Support both KotlinSignature classes in the compiler and in the IDEA plugin.
The old one will be deprecated later and dropped eventually
2014-03-02 19:55:28 +04:00
Alexander Udalov 33a9f3abd1 Move all annotation FQ names to JvmAnnotationNames
Delete reflected usages of annotation classes (JetValueParameter.class,
KotlinSignature.class, etc.). It's wrong: this is a dependency on the old
runtime, whereas the compiler should work with the new one
2014-03-02 19:55:28 +04:00
Alexander Udalov f7b6457139 Replace "jet" package name with "kotlin" in testData 2014-03-02 19:55:26 +04:00
Alexander Udalov f2b4c7fa3e Fix LoadBuiltinsTest after renaming "jet" to "kotlin" 2014-03-02 19:55:25 +04:00
Alexander Udalov b3a9721571 Store receiver parameter in JVM intrinsics map
To differentiate between "String?.plus" extension in builtins and
"Iterable<*>.plus" extension in stdlib (they have the same owner, name and
value parameter count)
2014-03-02 19:55:25 +04:00
Alexander Udalov 6b0fce8cd5 Unsorted replacements "jet" -> "kotlin"
#KT-2896 Fixed
2014-03-02 19:55:15 +04:00
Alexander Udalov ac71911720 Get rid of "jet" in comments, assertions, READMEs, etc.
Replace with "kotlin"

 #KT-2896 Fixed
2014-03-02 19:55:11 +04:00
Alexander Udalov 0490d4c989 Rewrite ProgressionUtil to Kotlin, move to "kotlin.internal"
Use reflection in ProgressionUtilTest instead of calling methods on the class
from the class path, because in the latter case we were just testing
ProgressionUtil from bootstrap runtime (which, presumably, always works
correctly since it's a bootstrap distribution)

With this change, compilable built-ins (under core/builtins/src) are fully
written in Kotlin
2014-03-02 19:54:59 +04:00
Alexander Udalov aef0fabd53 Move jet.Kotlin* annotations to package "kotlin.jvm.internal"
Also rename poorly named KotlinPackageFragment -> KotlinPackagePart
2014-03-02 19:54:58 +04:00
Alexander Udalov 0da92e22a2 Move jet.JetObject -> kotlin.jvm.internal.KObject
Don't use JetObject as a marker class in KotlinRuntimeLibraryUtil anymore,
since there are other classes for this purpose (KotlinPackage, Unit)
2014-03-02 19:54:58 +04:00
Alexander Udalov 3b1a043c13 Move JVM Intrinsics class to package "kotlin.jvm.internal"
Delete unused intrinsics, reformat code, rename some declarations for better
readability
2014-03-02 19:54:57 +04:00
Alexander Udalov b68e47f705 Move JVM-specific annotations out of built-ins
Move 'volatile' and 'synchronized' to package 'kotlin' in stdlib. Also delete
'atomic', since its support was never implemented
2014-03-02 19:54:55 +04:00
Alexander Udalov 774e5f0535 Sort out JVM intrinsics for equals, hashCode, toString 2014-03-02 19:54:55 +04:00
Alexander Udalov ec30d52978 Delete Hashable, pull up its members to Any
Extensions on nullable types remain in Library.kt

 #KT-1741 Obsolete
 #KT-2805 Obsolete
 #KT-1365 Fixed
 #KT-4517 In Progress
2014-03-02 19:54:08 +04:00
Alexander Udalov 8425f2e668 Copy type parameters for JVM function accessors
Otherwise generic signature wasn't correctly written to accessors, resulting in
classfiles not being valid and javac failing to compile Java sources against
them
2014-02-26 21:22:57 +04:00
Andrey Breslav a7135fee06 Report CLASS_OBJECT_NOT_ALLOWED for local classes 2014-02-26 19:42:05 +04:00
Tuomas Tynkkynen 3e451c5811 Disallow break or continue across a function boundary
Code containing breaks or continues that attempt to jump across a
function boundary weren't detected during analysis but would crash
the compiler during code generation. Add diagnostics for these kinds
of errors.

Example:

fun f() {
    while (true) {
        fun inner() {
            continue
        }
    }
}

 #KT-4334 Fixed
2014-02-26 00:14:42 +02:00
Alexander Udalov 4968afebf8 Don't generate bodies of built-in stub methods into interfaces 2014-02-24 21:44:42 +04:00
Andrey Breslav 23527c927b Unused parameter removed 2014-02-24 17:27:01 +04:00
Andrey Breslav fb0713d1c2 Do not inject TopDownAnalysisParameters into TopDownAnalyzer 2014-02-24 16:40:05 +04:00
Andrey Breslav 5b67cf67eb Usages of expressionTypingServices from ExpressionTypingContext are replaced with injection
The basic principle behind this change is that no context object should store components.
Components should be injected instead, and contexts only carry parameters around.

Particular changes:
- resolveCallWithGivenName() and resolveBinaryCall() moved to CallResolver
- ForLoopConventionsChecker introduced to confine checking conventions for Iterator and Iterable
- ExpressionTypingComponents introduced to deliver necessary components to ExpressionTypingVisitor's
- Some static methods became non-static to get access to injected components
- ExpressionTypingUtils and ControlStructureTypingUtils became components (got state injected) to avoid passing parameters around
2014-02-24 15:52:52 +04:00
Andrey Breslav ff762a4467 Use JDK annotations downloaded from a KAnnotator build 2014-02-21 19:23:41 +04:00
Nikolay Krasko a2c567da93 Common injector for lazy resolve with java lazy resolve 2014-02-20 16:31:22 +04:00
Nikolay Krasko 592969bad1 Rewrite utils method for qualified names to Kotlin 2014-02-20 16:17:51 +04:00
Nikolay Krasko ac4fe93774 Add ability to filter out some particular classes from generator 2014-02-20 16:17:38 +04:00
Nikolay Krasko e9091c85a4 Compile java sources into library 2014-02-20 16:08:03 +04:00
Alexander Udalov 339a990482 Remove ClassLoaderIsolationUtil
Minimize usages of jet.* in Java code: this will help in migration of jet.* to
package kotlin. Since tests will work with fq names instead of Class<?>
instances from now on, ClassLoaderIsolationUtil is useless now (except for one
unrelated method, which was moved to CodegenTestUtil)
2014-02-19 17:46:18 +04:00
Alexander Udalov eb7b757e38 Fix VerifyError on rangeTo on primitive types 2014-02-19 17:46:18 +04:00
Alexander Udalov 304129f9c9 Check if the class is special by FQ name
This is needed because our built-ins can be loaded with two different
mechanisms (deserialization and lazy resolve) and, when that happens,
corresponding descriptors aren't equal to each other, so one of two resolved
descriptors for Any (or the same with Nothing) was never considered to be a
"special class" with no supertypes
2014-02-19 17:44:19 +04:00
Alexander Udalov 3e33473c1a Don't check equals, hashCode, toString in LoadBuiltinsTest
Otherwise there'll be too many fake overrides when these methods will appear in
Any
2014-02-19 17:44:19 +04:00
Andrey Breslav b0ec4f10e9 Migrate from MutableClassDescriptor to ClassDescriptorWithResolutionScopes
Cast to MutableClassDescriptor where needed. The code with casts will be removed shortly
2014-02-19 14:30:48 +04:00
Natalia Ukhorskaya 9f3b73986a Update to IDEA 13.1 (134.1007) 2014-02-17 10:45:48 +04:00
Pavel V. Talanov 4c57aa9f23 Generate Injectors: minor, remove redundant GenerateInjectors class 2014-02-14 16:47:23 +04:00
Pavel V. Talanov f8a8bbe9b0 Generate Injectors: add ability to specify that a field is a context
Context field's properties can injected into other components
Use it in GenerateInjectors.kt
2014-02-14 16:47:22 +04:00
Pavel V. Talanov 6c77ea91c5 Generate Injectors: simplify and remove redundancy 2014-02-14 16:47:21 +04:00