Commit Graph

57019 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov 96c9efeabb Build: Fix findNonCachedRepositories test
Previously incorrectly scanned buildscript block of script
2019-08-22 20:39:28 +03:00
Vyacheslav Gerasimov 669b6d164c Build: Use cache redirector for buildscript block of :kotlin-reflect 2019-08-22 20:39:28 +03:00
Alexander Udalov d59f2bcc80 Fix KotlinReflectionInternalError on invoking callBy with defaults in supertypes
There are two parts in this change:

1) Previously, we looked up $default methods with the incorrect
   signature in supertypes. For example in defaultInSuperClass.kt, we'd
   try to find a method foo$default with the signature `(B, String,
   String, int, Object)` in the class A. Now we're modifying the array
   of parameter types on each step if we're looking for a static
   $default method, by assigning its first element to be the containing
   class. This fixes cases when defaults come from a superclass.
2) For interfaces, $default methods are actually located in the
   corresponding DefaultImpls class. Now we look up that class and
   search for the $default method there. Note that this is needed
   because of KT-33430. This fixes cases when defaults come from a
   superinterface.

 #KT-13936 Fixed
2019-08-22 18:04:00 +02:00
Alexander Udalov cb2e68fece JVM IR: skip temporary variables in InventNamesForLocalClasses 2019-08-22 18:04:00 +02:00
Alexander Udalov 312205f376 Prohibit synchronized methods on interface members
#KT-9310 Fixed
2019-08-22 18:04:00 +02:00
Alexander Udalov 815ff3c860 JVM IR: don't generate ACC_FINAL on DefaultImpls methods
To replicate behavior of old backend
2019-08-22 18:04:00 +02:00
Mikhail Glukhikh 6f785ec881 FIR2IR: fix library annotation call generation 2019-08-22 18:55:10 +03:00
Mikhail Glukhikh 27ccff12c1 FIR: add resolve for delegated super-type
This commit fixes FIR modularized resolve test on whole Kotlin project
(without it we had empty super-type set with delegated super-types)
2019-08-22 18:53:15 +03:00
Igor Yakovlev a9bc3c19d6 Fix invalid generated Move tests 2019-08-22 17:53:28 +03:00
Ilmir Usmanov f9506db20a Ignore sources which are not LOADs in refinedIntTypeAnalysis
#KT-33414 Fixed
2019-08-22 16:08:08 +03:00
Dmitriy Novozhilov 4697822b5a [FIR] Fix setting return type for when and try with non applicable candidates 2019-08-22 16:02:56 +03:00
Svyatoslav Kuzmich 6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00
Svyatoslav Kuzmich 812083ee05 [WASM] Initial runtime library
Add directory libraries/stdlib/wasm as a placeholder for WASM runtime library
Copy built-ins from core/builtins
Add ExcludeFromCodegen annotation for internal needs
2019-08-22 15:59:49 +03:00
Svyatoslav Kuzmich 1891fa1bf1 [JS IR BE] Commonize JS lowerings 2019-08-22 15:59:41 +03:00
Ivan Gavrilovic 7bc739359b Use JDK_8 when stopping Gradle daemons with version below 5.0
Gradle started supporting running on JDK11 only with Gradle 5.0.
This commit sets JAVA_HOME to JDK8 whenever stopping daemon with
version below 5.0
2019-08-22 15:47:45 +03:00
Ivan Gavrilovic d13e26d67e Add a check that processors from KAPT classpath are not run
This commit adds check that javaslang.match.PatternsProcessor,
which is in kotlin-compiler-embeddable jar, is not run when using
JDK9+.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic 27a9aa5e2b KT-33056: Fix how parent class loader for KAPT processors is found
When instantiating annotation processors, the class loader where they
are defined needs to have the correct parent class loader set up. In
order to find the parent class loader, we need to find the most specific
class loader that contains javac compiler classes (and does not contain
e.g. KAPT classes). This commit changes how that search is done, and it
simply returns the class loader in which the com.sun.tools.javac.util.Context
is defined, as the is the class we need on the annotation processor
classpath.
2019-08-22 15:45:40 +03:00
Ivan Gavrilovic f3acd8d10c KT-33028, KT-33050: Fix how kapt invokes javac on JDK 9+
This commit fixes KT-33028 by not setting empty boot classpath when
running on JDK9+. When compiling with -source 8 and below, this allows
classes from java.base module to be available in the boot classpath.

This commit also fixes KT-33050 by passing the source level of Java compile
task in the KAPT javac options. This is important as some annotation processors
are using ProcessingEnvironment.getSourceVersion() in order to decide what
code to generate.

Test: Kapt3IT test added for worker and non-worker invocations
2019-08-22 15:45:40 +03:00
Dmitriy Novozhilov 5846db4eab [FIR] Add symbol to FirFunction and all it's inheritors 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov e3e1f3c2aa [FIR] Fix transforming value parameters of anonymous functions 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov d841090866 [FIR] Don't analyze properties with implicit types twice
Test `cast.kt` now don't work absolutely correct and implicit type of
  value parameter in lambda is't replaced with error type, but it's
  minor bug
2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov f1e56c4b3e [FIR] Force resolving all declaration while resolving of body with implicit type 2019-08-22 14:14:55 +03:00
Dmitriy Novozhilov e374242adf [FIR] Fix propagating expected type for binary operator calls 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov ba7a137e74 [FIR] Add fir node for binary && and || 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 908b6ade1d [FIR] Fix incorrect do-while loop transforming order and IR generating 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 42f171a8d2 [IR] Minor. Extract irBuiltins from IrGeneratorContext to separate interface
It's necessary to using some util functions on IrGeneratorContext in IrToFir
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov b274c7567e [FIR] Minor. Add transformResult to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov a022f85776 [FIR] Minor. Add @BaseTransformedType to FirWhenBranch 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov f877fe40b3 [FIR] Fix expected type in invoke completion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 57a2665b00 [FIR] Update tests for previous commit 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov e48959350c [FIR] Infer type of when expressions and try expressions like it is function call 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 741ff958e8 [FIR] Add util function for extracting return arguments from block 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov fe3824d796 [FIR] Introduce FirResolvable
FirResolvable is an interface representates fir node wit calleeReference
It will be useful for infer `try` and `when` expressions as function call
2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov beeba23cf0 [FIR] Minor. Wrap withScopeCleanup with try-finally 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov e944119f71 [FIR] Don't use implicit type as expected type of anonymous function 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 7861396246 [FIR] Add util function for creating functional cone type 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 637fb55a7b [FIR] Add implementation of intersection types to Fir type system 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 1708a34eb8 [FIR] Fix incorrect findCommonIntegerLiteralTypesSuperType dummy implementation 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov e6bf3b3263 [FIR] Render nullability in type renderer, not in fir renderer 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 3e44bc805f [FIR] Return error type from common super type if it present 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 6e2958880b [FIR] Add forgotten replacing arguments in abbreviated type expansion 2019-08-22 10:55:07 +03:00
Dmitriy Novozhilov 317e3edba8 [FIR] Add default upper bound to type parameter in fir deserializer 2019-08-22 10:55:07 +03:00
Ilya Chernikov 2fe01f9086 Refactor publishing plugin to lazy tasks API 2019-08-21 20:20:09 +02:00
Ilya Chernikov 315a9d66a0 Refactor more tasks to lazy API 2019-08-21 20:20:08 +02:00
Ilya Chernikov 2ed8fa7624 Convert main task creating helper to lazy API, refactor accordingly 2019-08-21 20:20:08 +02:00
Ilya Chernikov 0f41dc814f Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +02:00
Ilya Chernikov f74c4fa538 Switch all common tasks in the root build script to lazy creation 2019-08-21 20:17:53 +02:00
Ilya Chernikov 5208318f34 Fix dependency resolution during gradle project configuration 2019-08-21 20:17:53 +02:00
Sergey Igushkin 50e758cbb7 Remove the @Inclubating annotation from UnstableApiUsage inspection
Also remove `@Suppress("UnstableApiUsage)"` where it was relevant
2019-08-21 19:42:34 +03:00
Sergey Igushkin ffd0b438da Don't create the Kapt generate stubs output dir in lazy initializer
Creating a directory in the property getter interferes with Gradle cache
 outputs snapshotting, resulting in build cache being disabled for the
 task with the following info message:

 Caching disabled for task ':app:kaptGenerateStubsKotlin': Gradle does
 not know how file 'build/tmp/kapt3/incrementalData/main' was created
 (output property 'destinationDir'). Task output caching requires exclusive
 access to output paths to guarantee correctness.

 As Gradle automatically creates any @OutputDirectory, we don't need
 to create it at the task initialization phase.
2019-08-21 19:42:34 +03:00