Commit Graph

47792 Commits

Author SHA1 Message Date
Sergey Igushkin 2c04e2b95c Fix: create a compilation's default source set for Android as well 2018-08-11 23:16:03 +03:00
Anton Bannykh a2f44c3caf JS: Recreate Nashorn script engine occasionally
Otherwise execution slows down significantly.
2018-08-10 22:15:37 +03:00
Vyacheslav Gerasimov 90e0ab022a as33: Set correct intellij-core version for AS 3.3 2018-08-10 20:02:21 +03:00
Alexander Udalov f663b8f554 Fix kotlin-maven-plugin compilation 2018-08-10 18:34:40 +02:00
Alexander Udalov 76214930da Update generic signatures in codegen test data
The implementation of toString for generic types in Java reflection has
been changed in 8u162 (https://bugs.openjdk.java.net/browse/JDK-8054213)
2018-08-10 18:20:05 +02:00
Nikolay Krasko 9071b5cfa8 Enable reformat for the whole file for the reformat inspection 2018-08-10 18:45:32 +03:00
Nikolay Krasko 563b2f13a3 Better notification logic and explicit code style apply (KT-23400) 2018-08-10 18:45:30 +03:00
Nikolay Krasko 2924bd80d9 Minor: move methods 2018-08-10 18:45:29 +03:00
Nikolay Krasko 5aacd181fa Restore old code style settings action (KT-23400)
Can't use `KotlinCodeStyleSettings` instead `KtCodeStyleSettings`,
because current `KotlinCodeStyleSettings` class is already used in third
party plugin.
2018-08-10 18:45:28 +03:00
Nikolay Krasko 6920e3bd08 Prototype version for code style notifications (KT-23400)
Show information about code style update, when it is actually updated.
2018-08-10 18:45:27 +03:00
Nikolay Krasko d16b6f9874 Internal action for showing Kotlin code style status (KT-23400)
Need this to monitor different IDE actions results. Commit can be
dropped after transition to new code style settings is finished.
2018-08-10 18:45:26 +03:00
Nikolay Krasko a1759fe2ab Load kotlin formatter settings with obsolete defaults for restore (KT-23400) 2018-08-10 18:45:24 +03:00
Nikolay Krasko a22f4232c0 Add information about obsolete code style usage (KT-23400) 2018-08-10 18:45:23 +03:00
Nikolay Krasko 17b88a28a0 Utility for detection if new code style is set by default (KT-23400)
Need this because some code should work differently before and after
applying new Kotlin code style defaults.
2018-08-10 18:45:22 +03:00
Pavel V. Talanov 01f1917d2a Run/test line markers: aggregate results across implementing modules 2018-08-10 17:00:03 +02:00
Mikhail Zarechenskiy 0fff8ebf71 Fix SOE after enabling SAM conversions 2018-08-10 17:24:19 +03:00
Mikhail Zarechenskiy b1985ee422 Enable SAM conversion for Kotlin functions by default in new inference
KT-25686
2018-08-10 17:24:18 +03:00
Nicolay Mitropolsky 31a5746724 183: implementation of JvmElementActionsFactory.createChangeParametersActions 2018-08-10 15:29:44 +03:00
Nicolay Mitropolsky 45b74e9fdb MockUpdateParameterInfoContext BUNCH comments added 2018-08-10 15:29:44 +03:00
Natalia Selezneva 97f1fc1f54 Rewrite MultiplatformProjectImportingTest to use testData directory 2018-08-10 15:26:12 +03:00
Natalia Selezneva d20b58ce61 Rewrite GradleConfiguratorTest to use testData directory 2018-08-10 15:26:11 +03:00
Natalia Selezneva f395f163f8 GradleImportingTestCase: add infrastructure to use files from testData folder 2018-08-10 15:26:10 +03:00
Natalia Selezneva c17d7e63c8 Convert GradleImportingTestCase to Kotlin 2018-08-10 15:26:09 +03:00
Natalia Selezneva cf56915f03 Rename .java to .kt 2018-08-10 15:26:09 +03:00
Natalia Selezneva f104bdfe03 Do not log full file text when code fragment was created with error context of PsiFile 2018-08-10 15:26:08 +03:00
Natalia Selezneva b7bdb43219 Fix leaked thread for AbstractScriptConfigurationTest 2018-08-10 15:26:07 +03:00
Denis Zharkov b38a9ee386 Fix test data for postfix templates test
In this tests there are two variants:
- One extracts the lambda
- And another extracts the whole call

For some reason, the order of completion variants has been changed in 182
2018-08-10 18:40:44 +07:00
Dmitry Savvinov 20262b8700 Relax assertion in PsiContractPraserDispatcher.parseContract
See EA-124365 - KNPE: PsiContractParserDispatcher.parseContract

Reason of this is unknown, issue KT-26034 will be investigated
later.
2018-08-10 13:27:32 +03:00
Dmitry Savvinov 57bafcf9e9 Do not lose information about contracts if call uses default value
It is safe to treat DefaultValueArgument as UNKNOWN_COMPUTATION, because
default arguments can't break smartcasts.

Possibly, they can add new ones, but it can be supported later.

^KT-25278 Fixed
2018-08-10 13:19:32 +03:00
Nicolay Mitropolsky cf62acc6d6 MockUpdateParameterInfoContext compilation fix for 183 2018-08-10 13:15:37 +03:00
Alexander Udalov 587ce56ad6 Use safer way of filtering out files from other modules
Comparing files by paths is too error-prone and it created a problem
here, where paths of File instances on Windows use "\" as a separator,
whereas VirtualFile paths always use "/", resulting in empty source
lists being compiled. This issue was introduced in 1582354077. Instead,
get the instance of the VirtualFile by path, and use its identity for
comparison
2018-08-10 11:33:52 +02:00
Sergey Rostov 59c41e111d K2JSCompilerArguments: sourceMapEmbedSources should be null by default.
When sourceMapEmbedSources are not null and source maps is disabled warning is reported, since it has effect only when source maps are enabled. Also this fixes some JPS JS with warnings count assertions.
2018-08-10 12:23:40 +03:00
Denis Zharkov 3e3841d17e Minor. Rename DelegatingDataFlowInfo -> DataFlowInfoImpl 2018-08-10 15:40:50 +07:00
Denis Zharkov 0eba48ae46 Adjust KotlinExpressionTypeProvider to new DataFlowInfo contracts
Now, trivial info is not being perstisted in the maps of DataFlowInfo

At the same time, we don't record trivial DataFlowInfo instances in binding context:
org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt#recordDataFlowInfo
Namely, it happens in case when expression is a callee expression of
"variable as function" calls (see
org.jetbrains.kotlin.idea.codeInsight.ExpressionTypeTestGenerated#testKt11601)

At the same time, there's a hack in `org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt#getType`
that helps to obtain type itself for these callees from the resolved calls.

So, it will work anyway if we use `noTypeInfo` here, that is kind of
correct since there's no non-trivial info anyway
2018-08-10 15:40:50 +07:00
Denis Zharkov 375f3c0769 Fix type-intersection-related test data
The order of types enumeration has been changed recently:
previously it was collected at first from a child and then from
its parent, but now it's being collected in order of appearance
2018-08-10 15:40:50 +07:00
Denis Zharkov d024d2e64c Adjust PreliminaryLoopVisitor to new contracts of DataFlowInfo
Previously, there was a contract that if it contains some
non-trivial type info it also has it in `completeNullabilityInfo`.

But after two previous changes it became false
2018-08-10 15:40:50 +07:00
Denis Zharkov 666ca77666 Fix incorrect optimization in ExpressionTypingServices
Previously, it's been working because was almost always
a different instance.

After, the latter change with avoidance of storing trivial
info there, newDataFlowInfo may accidentally become empty
as context.dataFlowInfo.
But we, obviously, should compare it with newContext.dataFlowInfo instead
2018-08-10 15:40:50 +07:00
Denis Zharkov 9297babc20 Avoid putting trivial information into DelegatingDataFlowInfo map 2018-08-10 15:40:50 +07:00
Denis Zharkov d20e5ce673 Cache hashCode for DataFlowValue in another field
It's necessary because DataFlowValue instances are commonly
used as keys in maps

 #KT-24657 Fixed
2018-08-10 15:40:50 +07:00
Denis Zharkov e5507108ed Get rid of affectReceiver parameter in DelegatingDataFlow::putNullabilityAndTypeInfo
The only non-default argument was inside "assign" method
And it can be replaced with simple map instantiation
2018-08-10 15:40:50 +07:00
Denis Zharkov 851d760ac1 Minor. Extract common parts from DelegatingDataFlow::equate/disequate 2018-08-10 15:40:50 +07:00
Denis Zharkov bf1f94c185 Rewrite DelegatingDataFlowInfo using immutable collections from javaslang
It may be useful because data-flow info is mostly the same for
neighbouring expressions and changes between them should be minor.

Thus, it should help to avoid making copies of huge maps and reusing
them instead
2018-08-10 15:40:50 +07:00
Denis Zharkov f61686fcbf Minor. Convert loop to 'mapTo' call 2018-08-10 15:40:50 +07:00
Denis Zharkov 5bfa409da6 Get rid of DelegatingDataFlowInfo::parent property
It's been used to bring immutability to DelegatingDataFlowInfo
But in case of statements sequence like:
x = 1
...
x = 1

it would lead to huge DelegatingDataFlowInfo where each of
getCollectedNullability call works for O(n) where n is amount
of assignments

The solution is to get rid of reference to parent and to update
relevant maps properly

In next commits immutable maps will be used instead of making copies each
time
2018-08-10 15:40:50 +07:00
Dmitry Petrov 4f6aa50417 Fix == for inline classes with boxes
TODO generalize code generating object vs primitive equality

 #KT-25914 Fixed
 #KT-25981 Fixed
 #KT-25983 Fixed
2018-08-10 10:34:57 +03:00
Alexander Udalov cd12772bc5 Remove unneeded bunch files related to PsiJavaModule
PSI for modules and related classes are already available in AS3.1
2018-08-10 00:10:37 +02:00
Roman Artemev 6c8e30eb05 Fix test failures
* add metadata
 * unmute working tests
 * mute temporary broken ones
2018-08-09 20:55:50 +03:00
Dmitry Savvinov 447c127036 Fix unsound smartcast from loop condition on assigned vars
^KT-22379 Fixed
2018-08-09 19:56:23 +03:00
Mikhael Bogdanov a7d706f693 Unmute jvm ir-tests 2018-08-09 16:30:32 +03:00
Mikhael Bogdanov 3c5a146c1f Support captured parameters in callable references 2018-08-09 16:30:28 +03:00