Commit Graph

307 Commits

Author SHA1 Message Date
Dmitry Savvinov 50d1c013fc Force-resolve body in contract computation under lock
Even though acquire/release pattern guarantees memory visibility across
threads, it doesn't prevents concurrent access to critical section (i.e.
to force-resolve of the corresponding body).

This can lead to multiple resolution passes over one and the same PSI in
IDE, which, in turn, leads to 'rewrite at slice'-exceptions. See
KT-30030 for case description and details.

^KT-30030 Fixed
2019-02-25 11:10:16 +03:00
Alexander Udalov 3d1858a8c5 Refactor and rename CodegenUtil.getDeclarationsToGenerate
Move logic regarding expect classes to the only relevant call site at
PackageCodegenImpl, and return the list of members to remove code
duplication at remaining call sites
2019-02-19 16:37:46 +01:00
Simon Ogorodnik 5afb0a6f4a FIR rename: FirType -> FirTypeRef and related 2019-02-19 09:54:24 +03:00
Ilya Gorbunov 8ed2facc8c Remove integration test involving kotlin-stdlib-jre7/8 2019-02-18 18:45:20 +03:00
Alexander Udalov f2bf81e799 Fix UOE when using Java annotation with infinity/NaN as default value
The root problem is the fact that ConstantExpressionEvaluator returns
null for values such as infinity and NaN loaded from cls psi (see
IDEA-207252). This commit simply reverts a part of 8ab9226805 where we
started to compute default values more often than needed. In
LazyJavaClassMemberScope, we only need to check whether or not there
_is_ a default value, not compute its value.

 #KT-29792 Fixed
2019-02-15 19:13:53 +01:00
Dmitry Petrov 08de82db85 Added tests for KT-29833 2019-02-15 16:25:16 +03:00
Anton Bannykh 6e74c4ce71 JS: switch off the validator until class translation is fixed 2019-02-14 15:14:28 +03:00
Anton Bannykh d7499363bc JS: review fixes 2019-02-14 15:14:28 +03:00
Anton Bannykh 299a45ccbf JS: validate AST when serializing to IC cache 2019-02-14 15:14:28 +03:00
Anton Bannykh a0ff581a2f JS: refactoring 2019-02-14 15:14:28 +03:00
victor.petukhov 06b5a42d0d Improve test exceptions fixation:
- exceptions is analyzed if it's specified explicitly only,
- compute test case number for diagnostic tests in which an exception is thrown.
2019-02-14 12:31:43 +03:00
victor.petukhov fad59e200c Code stylistic improvements in BaseDiagnosticTest 2019-02-14 12:31:42 +03:00
victor.petukhov b354518a41 Add lazy debug diagnostic DEBUG_INFO_EXPRESSION_TYPE 2019-02-14 12:31:42 +03:00
victor.petukhov f92232f015 Decompose and rewrite CheckerTestUtil to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov 9e06e1eec0 Move and rename into .kt files around CheckerTestUtil for rewrite to Kotlin 2019-02-14 12:31:42 +03:00
victor.petukhov 8a9c7a69f3 Move checkType directives for tests to separate folder 2019-02-14 12:31:42 +03:00
Ilya Chernikov dab97ac936 Use KotlinPaths to access jars 2019-02-10 13:35:59 +01:00
Ilya Chernikov be95acd897 Load scripting plugin explicitly in repl tests and JSR-223 2019-02-10 13:33:21 +01:00
Ilya Chernikov 2b67dbe8dd Initialize scripting in tests if script is passed as a source 2019-02-10 13:31:56 +01:00
Ilya Chernikov 89fc7eba95 Make script infrastructure providers optional 2019-02-10 13:31:56 +01:00
Alexander Udalov 23298af5a4 Implement fillInStackTrace and others in TestsError
This fixes exception stack traces in some compiler tests. Also provide
explicit return types to get rid of platform type inspections
2019-02-07 23:33:29 +01:00
Mikhael Bogdanov 4dc304b24e Move IrBytecodeText tests to ir package 2019-02-07 16:14:20 +01:00
Alexander Udalov db487a622a Add -Xsanitize-parentheses to workaround ASM 6.1 issue in frame computation
#KT-29475 Fixed
2019-01-31 15:47:43 +01:00
Dmitriy Novozhilov 0e8c43f8c0 Generify key type parameter of ControlFlowInfo
Previously only `VariableDescriptor` was key of `ControlFlowInfo`.
Now it's generic parameter `K: Any`, so there is a possibility of using
  different object's inside CFA
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov 68d2cbf91f Extract classes used in control flow analysis of variable into variable package 2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov 80835fe6ea Add ability to configure environment in AbstractLoadJavaTest
There is two methods added into `AbstractLoadJavaTest`:
- `configureEnvironment(KotlinCoreEnvironment environment)` allow to
  configure environment that will be used two compilation of source test
  data and loading generated `.class` files (e.g. you can register extensions)
- `getExtraClasspath()` allow to add custom libraries to classpath of
  compiler

Similar methods exists in `AbstractDiagnosticsTest`
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov 68d7e51d32 Support test directive for rendering full diagnostic messages
New `RENDER_DIAGNOSTICS_MESSAGES` directive forces test system render
full messages for all diagnostics that found in test file
2019-01-31 17:25:13 +03:00
Dmitriy Novozhilov 2866bd84a1 Reformat BaseDiagnosticTest according to code style 2019-01-31 17:25:13 +03:00
Nikolay Krasko 52c46811ff Enable JPS test runner for new JPS build (KT-29368)
#KT-29368 Fixed
2019-01-30 01:13:23 +03:00
Svyatoslav Kuzmich b49ec3edb8 Disable generation of 1.2 coroutine tests for JS_IR
Add directive DONT_TARGET_EXACT_BACKEND.
This directive is needed to exclude JS_IR backned but keep "compatible"
JS backend.
2019-01-29 19:06:31 +03:00
Alexander Udalov a419112c25 Refactor class lookup methods in KotlinBuiltIns
Remove external usages of get*Nullable methods, inline/remove other
methods to simplify the API facade
2019-01-28 15:18:52 +01:00
Sergey Rostov c716ef112e Got rid of @TestOnly usages on fields 2019-01-28 13:43:08 +03:00
Simon Ogorodnik dcd41bd26f FIR: Add test for total kotlin resolve #KT-24077 Fixed 2019-01-25 18:05:08 +03:00
Alexander Udalov 6b5a16884c Refactor inheritMultifileParts to be a JVM analysis flag
Instead of a JVMConfigurationKeys key. This will allow to use it in a
checker in 'frontend.java'
2019-01-25 15:57:13 +01:00
Nikolay Krasko ad3114aa5f Allow generate closed start tags and do not reorder specific tags 2019-01-18 19:42:44 +03:00
Vyacheslav Gerasimov 13d87e8eae Remove as31 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov 818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Dmitry Savvinov 69fff12384 Drop LockBasedStorageManager.defaultDebugName, use meaningful name everywhere
Also, drop `createDelegatingWithSameLock` as it was unused
2019-01-14 11:10:37 +03:00
Mikhail Glukhikh 6e369e156d FIR: implements multi-module resolve, add tests #KT-24093 Fixed
This commit introduces FIR session provider, dependency provider,
library session + other infrastructure necessary for multi-module resolve
2019-01-11 09:55:40 +03:00
Mikhail Glukhikh bc82f2f940 Use FirModuleBasedSession with module info, use platform default imports
In this commit, FIR sessions made bound to a particular module
2019-01-11 09:55:40 +03:00
Alexander Udalov 3fee84b966 Use fast .class file reading implementation in boxAgainstJava tests
Since these tests compile Kotlin code against compiled Java code, it's
only reasonable to use the same .class file reading implementation as is
used in production for the same purpose
2018-12-28 12:53:10 +01:00
Simon Ogorodnik cfb446df9e Move FIR tests to fir modules 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh 95af0268b8 FIR: add transformer consistency test 2018-12-27 21:32:22 +03:00
Mikhail Glukhikh cdc536b147 Add visitor consistency test 2018-12-27 21:32:21 +03:00
Mikhail Glukhikh 5716bda15d Raw FIR builder: add performance test to build FIR for all Kotlin
#KT-24086 Fixed
2018-12-27 21:32:21 +03:00
Nikolay Krasko 5a40fc8679 Add UI options for comments generation (KT-5590)
#KT-5590 Fixed
2018-12-26 21:10:03 +03:00
Mads Ager 3a11322506 Enable bytecode text tests for the JVM_IR backend. 2018-12-21 16:20:45 +01:00
Mikhael Bogdanov c19c979b7d Use last asm api for visitor construction 2018-12-20 12:55:09 +01:00
Alexander Udalov f5ff3d2fa9 Remove directives that have no effect from bytecode text tests
All bytecode text tests are run with stdlib in the classpath and only
for JVM backend, therefore directives WITH_RUNTIME, TARGET_BACKEND,
IGNORE_BACKEND are not needed
2018-12-20 12:53:24 +01:00
Alexander Udalov 00caa23307 Do not support LANGUAGE_VERSION directive in codegen tests
Test data of crossinline_1_2.txt has changed because now we do not
automatically enable 1.2 (with _all_ of its features) when we're
executing a common coroutines test with old coroutines; and so the
NewCapturedReceiverFieldNamingConvention language feature (which is
introduced in 1.3) is now enabled in this test
2018-12-20 12:53:24 +01:00