Commit Graph

44063 Commits

Author SHA1 Message Date
Denis Zharkov cfd612e2c1 Minor. Reformat signatureEnhancement.kt 2018-02-08 13:36:10 +03:00
Mikhail Glukhikh 8edf8b9e4d MemberInfoUtils: when no facade is available, use resolutionApi methods 2018-02-08 13:03:41 +03:00
Mikhail Glukhikh 8b8cb0abba KotlinRunConfigurationProducer: get rid of resolve via facade 2018-02-08 13:03:40 +03:00
Denis Zharkov 2ad93a0330 Use extension registry when unpacking serialized type alias
It's funny here that "extension" here means protobuf extensions
while initial issue is about extension function types

 #Fixed KT-22728
2018-02-08 12:39:26 +03:00
Denis Zharkov fbef21bf17 Remove setting usePreciseJavaTracking in gradle.properties
It's already true by default since 9b28d1a21c
2018-02-08 12:38:19 +03:00
Alexander Udalov bb013ec2bf Update bootstrap to 1.2.40-dev-165 2018-02-08 10:15:30 +01:00
Mikhael Bogdanov 0954d1ab1b Don't generate hash in sam wrapper class name
#KT-17091 Fixed
2018-02-08 10:11:48 +01:00
Alexander Udalov ba5cc65792 Rename JvmPackageTable -> JvmModuleProtoBuf, PackageTable -> Module
This protobuf message is going to contain more information about the
module than just the table of package parts
2018-02-07 17:25:43 +01:00
Mikhael Bogdanov 5d6d1bf182 Explicitly specify 'idea.home.path' in android tests 2018-02-07 15:33:54 +01:00
Dmitry Petrov 5678b3d52a Handle nullable case in '==' with smart cast using safe call 2018-02-07 14:30:59 +03:00
Dmitry Petrov 00325ae539 Handle equality checks for 'when' and data classes 2018-02-07 14:30:59 +03:00
Dmitry Petrov 299eb24ca9 Minor: simplify OperatorExpressionGenerator#invokeConversionFunction 2018-02-07 14:30:59 +03:00
Dmitry Petrov 22d59bb709 Minor: include descriptor itself in exception from DependenciesCollector 2018-02-07 14:30:59 +03:00
Dmitry Petrov 4776535205 Implement IR primitives for number comparisons in JVM BE 2018-02-07 14:30:59 +03:00
Dmitry Petrov bf18186045 More precise implicit cast generation
If an expression 'x' has a definitely non-null type 'T1',
and is used in position with an expected type 'T2',
cast 'x' to 'T2!!' (most common non-null type T*: T* <: T2).
2018-02-07 14:30:59 +03:00
Dmitry Petrov 9137e68d4e Implement special desugaring for numeric comparisons in PSI2IR
This introduces the following IR built-in functions required for proper
implementation of the number comparisons:

- ieee754Equals(T, T): Boolean,
    for each T in {Float?, Double?}

- less(T, T): Boolean
  lessOrEqual(T, T): Boolean
  greater(T, T): Boolean
  greaterOrEqual(T, T): Boolean
    for each T in {Int, Long, Float, Double}
2018-02-07 14:30:59 +03:00
Dmitry Petrov f4ed4ec9d9 Distinguish numeric comparisons in FE, store info in BindingContext
When we an equality or comparison operator expression
with both arguments "statically known to be of primitive numeric types"
(that is, either inferred type T for an operand is a primitive numeric
type, or a smart cast to a primitive numeric type T is possible in the
corresponding context), comparisons should be performed on primitive
numbers with corresponding widening conversions.

This differs from default 'equals' and 'compareTo' implementations in
case of floating-point numbers: for Float and Double, IEEE 754
comparisons are used instead of total order implemented by j.l.Float and
j.l.Double.

Examples:

fun ex1(x: Double, y: Double) = x < y
-- will use IEEE 754 comparison for Double, because
   both 'x' and 'y' have type Double

fun ex2(x: Double, y: Any) = y is Double && x < y
-- will use IEEE 754 comparison for Double, because
   smart cast to Double is possible for 'y'

fun ex3(x: Comparable<Double>, y: Double) = x is Double && x < y
-- will use IEEE 754 comparison for Double, because
   smart cast to Double is possible for 'x',
   even though corresponding operator convention is resolved to
   'Comparable<Double>#compareTo(Double)' (which would use total order)

fun ex4(x: Any, y: Any) = x is Double && y is Int && x < y
-- will use IEEE 754 comparison for Double with 'y' promoted to Double,
   because smart cast to Double is possible for 'x',
   and smart cast to Int is possible for 'y',
   and least common primitive numeric type for Double and Int is Double.
2018-02-07 14:30:59 +03:00
Alexey Sedunov 930e51e30e Misc: Update test data due to changes in 'actual' constructor checking
Now actual class constructor is considered an implementation
only if it has 'actual' modifier itself
2018-02-07 14:13:16 +03:00
Nicolay Mitropolsky 91a4bbed2e Uast: KotlinUNestedAnnotation with light annotation (IDEA-185890) 2018-02-07 10:17:40 +03:00
Nicolay Mitropolsky cb05baa02b LightAnnotations: wrapping nested annotations with KtLightAnnotationForSourceEntry 2018-02-07 10:17:40 +03:00
Nicolay Mitropolsky 48ea52def1 Uast: KotlinUNestedAnnotation for processing nested annotations (IDEA-185890) 2018-02-07 10:17:40 +03:00
Yan Zhulanow 1f81c0cdfe Kapt: Fix compilation errors when the referenced class has '$' in the beginning of its name (KT-22493) 2018-02-06 22:16:01 +03:00
Yan Zhulanow 5fc9c5671c Kapt: Escape nested comments in doc comments (KT-22469) 2018-02-06 22:16:01 +03:00
Yan Zhulanow abda4bfb57 Kapt: Remove comments inside enum values (KT-22350) 2018-02-06 22:16:01 +03:00
Yan Zhulanow a171874b2f Fix "Illegal Android Identifier" inspection reports non-instrumentation unit tests (KT-22168) 2018-02-06 22:16:00 +03:00
Yan Zhulanow 4e8969e1c2 Kapt: Fix array of anonymous type handling (KT-22468) 2018-02-06 22:16:00 +03:00
Yan Zhulanow 144ec9285f Minor: Get rid of duplicating option descriptions in Kapt plugin 2018-02-06 22:16:00 +03:00
Yan Zhulanow e38a41d2f2 Evaluate: Fix compiling evaluator issues led to improper expression caching
1. Do not save a ClassLoader reference inside the context, as we don't use it anyway after evaluation.
This is to avoid custom ClassLoader nesting.

2. Do not use 'findClass()' as it caches the loaded classes and always returns the first evaluated class if it's in cache.
2018-02-06 22:16:00 +03:00
Yan Zhulanow da74bcbcc0 Evaluate: Support dex in newer Android build tools 2018-02-06 22:16:00 +03:00
Yan Zhulanow 7c7c929b0e Kapt: Disable location mapping by default, allow to enable it manually 2018-02-06 22:16:00 +03:00
Yan Zhulanow 5668a7af92 Kapt: Replace original Javac diagnostic messages with those with Kotlin location mapped
There is no Messages dialog in newer versions of IDEA/Android Studio in which the error messages were mapped before. The new Build window shows only the original locations, so now we need to replace Java file diagnostics with ones mapped to Kotlin source files.

The side effect is that diagnostics on the same locations are automatically merged.
2018-02-06 22:16:00 +03:00
Yan Zhulanow b0e97de8a8 Kapt: Move line metadata to .kaptMetadata external files (KT-22386)
Placing location table inside .java file triggers annotation processor to run on each line table modification (even when the stub declarations themselves are the same). So we move it to the separate file.
2018-02-06 22:16:00 +03:00
Yan Zhulanow bf9eed931b Parcelable: Fix 'Simple' test (new boolean serializer) 2018-02-06 22:15:59 +03:00
Yan Zhulanow 145ddf3b1f Parcelable: Add CREATOR field (and other generated declarations) in light classes (KT-19300, KT-19853) 2018-02-06 22:15:59 +03:00
Ilya Gorbunov 90dff281ba Actualize ReadMe files
- Actualize build requirements and steps
- Extract Gradle plugin readme to the corresponding folder
- Rewrite Libraries and Maven Tools readme

#KT-20995 Fixed
2018-02-06 21:17:58 +03:00
Ilya Gorbunov aa74f163f7 Minor: improve table formatting 2018-02-06 21:17:57 +03:00
Ilmir Usmanov ad385f42a9 Fix continuaion retrieval on generated coroutineContext intrinsic code
Use fake continuation instead on real one in JVM BE.
Pass continuation parameter to closure generator in JS BE.

 #KT-22577: Fixed
2018-02-06 21:14:37 +03:00
Sergey Igushkin e8cd8b566e Delay kapt dependencies resolution from configuration phase
Store kapt configurations instead of classpath files in the tasks
Delay wrapping kapt subplugin options to task execution (when the
classpath can be safely resovled)

Issue #KT-18821 Fixed
2018-02-06 21:01:57 +03:00
Nicolay Mitropolsky 8ac95b54a2 Uast: support for Kotlin array literals 2018-02-06 17:53:17 +03:00
Alexey Sedunov 358bc62fc1 Minor: Regenerate tests 2018-02-06 17:06:03 +03:00
Alexander Udalov 12e31cedfd Write lambdaClassOriginName for lambdas copied during inline
Similarly to anonymousObjectOriginName which is written for copied
anonymous objects

 #KT-21320
2018-02-06 13:05:22 +01:00
Alexander Udalov 6da3f37fc3 Write anonymousObjectOriginName for classes copied during inline
#KT-21320
2018-02-06 13:05:22 +01:00
Mikhail Glukhikh 81122ed236 Fix a pack of broken IDE action tests
Related to KT-20281.
For Java resolve we can use also resolve with 'null' platform,
which is possible situation in tests.
2018-02-06 15:02:38 +03:00
Alexander Podkhalyuzin 09d167eafb Ask just extensions, not in some area #KT-21978 Fixed 2018-02-06 14:58:18 +03:00
Alexey Sedunov c602c51642 Slicer: Sort tree nodes to produce stable test data 2018-02-06 14:23:20 +03:00
Alexey Sedunov adca8eb7f1 Rename: Substitute synthetic expression parent before analysis
This fixes rename conflicts test
2018-02-06 14:23:20 +03:00
Alexey Sedunov 049439ce1d Rename: Update test data (follow-up for unnecessary reformatting fix) 2018-02-06 14:23:20 +03:00
Alexey Sedunov d51da8bafd Misc: Fix Android SDK path in Gradle import tests 2018-02-06 14:23:19 +03:00
Mikhail Glukhikh 7995ae05c5 Introduce inspection for redundant not-null extension receiver of inline
Related to KT-22303
2018-02-06 14:17:01 +03:00
Mikhael Bogdanov ad48099ca6 Move java 8 tests to java8 folder 2018-02-06 10:32:14 +01:00