Commit Graph

87184 Commits

Author SHA1 Message Date
Pavel Kunyavskiy f03c897dc4 [K/N] Move fields from KFunctionImpl to functions 2021-10-14 11:22:27 +00:00
Pavel Kunyavskiy 7a52ed73de [K/N] Simplify KPropertyImpl 2021-10-14 11:22:27 +00:00
Pavel Kunyavskiy 694864ae76 [K/N] Support kType generation as ConstantValue 2021-10-14 11:22:26 +00:00
Pavel Kunyavskiy 504d72011b [K/N] Transform FunctionReference without bound values to ConstantValue 2021-10-14 11:22:26 +00:00
Pavel Kunyavskiy e4a4cd3e16 [K/N] Transform constant varargs to ConstantValue 2021-10-14 11:22:25 +00:00
Pavel Kunyavskiy 0d11a61fb2 [K/N] Initialize fields with ConstantValue initializers statically 2021-10-14 11:22:25 +00:00
Pavel Kunyavskiy 7a0f72105f [K/N] Support ConstantValue in global analyses 2021-10-14 11:22:24 +00:00
Pavel Kunyavskiy 434d4d2d83 [K/N] Support ConstantValue in autobox 2021-10-14 11:22:24 +00:00
Pavel Kunyavskiy d222e95877 [K/N] Remove unused old buggy intrinsic 2021-10-14 11:22:23 +00:00
Pavel Kunyavskiy e6b9531b6c [K/N] Implement bitcode generation for constant objects 2021-10-14 11:22:23 +00:00
Pavel Kunyavskiy c7f182adbf [K/N] Introduce intrinsic constant constructors 2021-10-14 11:22:22 +00:00
Pavel Kunyavskiy 74b9eeb584 [K/N] Refactor evaluateConst 2021-10-14 11:22:22 +00:00
Pavel Kunyavskiy bf3c343ced Introduce new ir nodes for constant values 2021-10-14 11:22:21 +00:00
Pavel Kunyavskiy 0764cef82f [K/N] Rewrite stacktrace formatting
It was inconsistent between platforms, which leads to strange work of
different parsers, including one in gradle plugin.

Now it should work more or less like it was on MacOS before recent
changes on all platforms.

^KT-49126
2021-10-14 11:18:22 +00:00
Pavel Kunyavskiy 2fe9420ca1 Compatibility hack for instantiating annotations from old klibs
^KT-49181
2021-10-14 11:03:17 +00:00
Denis.Zharkov cac69edff2 FIR: Fix forEach resolution within local class 2021-10-14 14:01:51 +03:00
Denis.Zharkov 056657525e FIR: Temporary support FE 1.0 behavior for SAM vs. generic ambiguity
^KT-48300 Relates
^KT-48938 Fixed
2021-10-14 14:01:50 +03:00
Denis.Zharkov 10c5d987d7 FIR: Fix exception on remaining flexible ILT in lambda
^KT-49191 Related
2021-10-14 14:01:49 +03:00
Tianyu Geng bbc93d597a FIR IDE: Disable tests failing in depended mode 2021-10-14 06:05:32 +03:00
Tianyu Geng e6d9098bec FIR IDE: Disable some tests in depended mode due to failures
The following error code path only runs in depended mode.

Test succeeded in normal analysis mode but failed in depended analysis mode.
java.lang.Exception: Test succeeded in normal analysis mode but failed in depended analysis mode.
	at org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AbstractLowLevelApiTest.runTest(AbstractLowLevelApiTest.kt:126)
	at org.jetbrains.kotlin.analysis.api.fir.components.OverriddenDeclarationProviderTestGenerated.testOnEnumEntry(OverriddenDeclarationProviderTestGenerated.java:72)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:688)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$6(TestMethodTestDescriptor.java:210)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:206)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:131)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:65)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
	at org.junit.platform.engine.support.hierarchical.ForkJoinPoolHierarchicalTestExecutorService$ExclusiveTask.compute(ForkJoinPoolHierarchicalTestExecutorService.java:185)
	at java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:189)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: No designation of local declaration public final static enum entry MyEntry: R|MyEnum|
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at org.jetbrains.kotlin.analysis.api.fir.components.AbstractOverriddenDeclarationProviderTest.doTestByFileStructure(AbstractOverriddenDeclarationProviderTest.kt:79)
	at org.jetbrains.kotlin.analysis.api.fir.test.framework.AbstractHLApiSingleModuleTest.doTestByFileStructure(AbstractHLApiSingleModuleTest.kt:16)
	at org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AbstractLowLevelApiTest.runTest(AbstractLowLevelApiTest.kt:117)
	... 38 more
Caused by: java.lang.IllegalStateException: No designation of local declaration public final static enum entry MyEntry: R|MyEnum|
	at org.jetbrains.kotlin.analysis.low.level.api.fir.api.FirDeclarationDesignationKt.collectDesignation(FirDeclarationDesignation.kt:90)
	at org.jetbrains.kotlin.analysis.low.level.api.fir.api.LowLevelFirApiFacadeForResolveOnAir.runBodyResolveOnAir(LowLevelFirApiFacadeForResolveOnAir.kt:239)
	at org.jetbrains.kotlin.analysis.low.level.api.fir.api.LowLevelFirApiFacadeForResolveOnAir.getResolveStateForDependentCopy(LowLevelFirApiFacadeForResolveOnAir.kt:175)
	at org.jetbrains.kotlin.analysis.api.fir.KtFirAnalysisSession.createContextDependentCopy(KtFirAnalysisSession.kt:102)
	at org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AbstractLowLevelApiTest.analyse(AbstractLowLevelApiTest.kt:203)
	at org.jetbrains.kotlin.analysis.api.fir.components.AbstractOverriddenDeclarationProviderTest.access$analyse(AbstractOverriddenDeclarationProviderTest.kt:22)
	at org.jetbrains.kotlin.analysis.api.fir.components.AbstractOverriddenDeclarationProviderTest$doTestByFileStructure$$inlined$executeOnPooledThreadInReadAction$1$1.compute(AbstractLowLevelApiTest.kt:183)
	at com.intellij.mock.MockApplication.runReadAction(MockApplication.java:183)
	at org.jetbrains.kotlin.analysis.api.fir.components.AbstractOverriddenDeclarationProviderTest$doTestByFileStructure$$inlined$executeOnPooledThreadInReadAction$1.call(AbstractLowLevelApiTest.kt:183)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:652)
	at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:649)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:649)
	at java.lang.Thread.run(Thread.java:748)
2021-10-14 06:05:32 +03:00
Tianyu Geng a08ab45e22 FIR IDE: make all HL tests covering depended mode
Also changed tests to do the analysis on the KtElement of
interest instead of the KtFile where possible because currently depended
mode does not support analysing the entire file. Maybe we should support
analysing the whole file at some point.
2021-10-14 06:05:32 +03:00
Tianyu Geng 0f016c89aa FIR LL: use real FIR in HL API implementation
In depended mode, a fake file is created and hence some generated FIR
elements are based on this fake file. However, FIR cares about the
identity of FIR elements: for example, loading overridden symbol does
not work with fake FIR elements. This change makes LL API to always
create FIR elements from the underlying real PSI so that HL API
implementation to always use the real FIR element to answer queries.
2021-10-14 06:05:32 +03:00
Dmitry Petrov 6f33259bc3 PSI2IR KT-49203 INVISIBLE_FAKE setter is non-referenceable 2021-10-13 18:38:23 +03:00
Svyatoslav Scherbina 990afcc06f Native: improve exception messages when building DFG vtable/itable 2021-10-13 15:13:43 +00:00
Dmitry Petrov 2a00def84e JVM_IR make proxy funs for inline and arrayOf funs non-synthetic 2021-10-13 16:07:53 +03:00
Viacheslav Kormushkin fcb8f331dc KMM: can't set isAllowInsecureProtocol using cocoapods plugin
#KT-48259

Merge-request: KT-MR-4728
2021-10-13 12:59:49 +00:00
Svyatoslav Kuzmich 4e74e9baee [Wasm] Add test for KT-49182 2021-10-13 15:30:00 +03:00
Artem Kobzar f645c89ebf fix(KT-43191): add static qualifier for Companion and non-inner objects. 2021-10-13 11:09:59 +00:00
Svyatoslav Kuzmich 90dd0c6150 [JS] Fix and mute failed tests on TC 2021-10-13 01:26:27 +03:00
Alexander Udalov 357f3184bf JVM IR: fix the type of IrGetField
The `irGetField` utility uses the field's own type as the type of the
resulting expression. But the field's type does not make sense outside
of the place of declaration of the field if it references a generic type
parameter of the containing class. Using this non-sensical generic type
led, for example, to an error in Ieee754 intrinsic (KT-48648).

The type of the expression should be kept as is in
JvmPropertiesLowering, i.e. taken from `expression` which the lowering
is replacing with the field access.

 #KT-48648 Fixed
2021-10-12 23:35:17 +02:00
Svyatoslav Kuzmich 279f184703 [JS] Remove failed checks based on unstable naming 2021-10-12 23:29:39 +03:00
Svyatoslav Kuzmich 3f8dce4b53 [JS IR] Support per-file mode and ES modules 2021-10-12 23:29:39 +03:00
Svyatoslav Kuzmich f479ac5c3a Remove implementation specific access to _ from test
Operator `new` is already tested with String class
2021-10-12 23:01:01 +03:00
Svyatoslav Kuzmich 5affd9d2f9 Visit declaration reference when visiting member access 2021-10-12 23:01:00 +03:00
Roman Golyshev d3e2f9a3f6 [FIR IDE] Fix bug in diagnostics' combining during code generation 2021-10-12 19:21:11 +00:00
Dmitry Petrov b946a284b0 JVM_IR move 'arrayOf' handling to JvmBuiltInsLowering
FunctionReferenceLowering creates calls to 'arrayOf' functions that
should be processed later.
2021-10-12 21:12:44 +03:00
Dmitry Petrov 27e5655480 JVM_IR minor: more JvmIrBuilder helpers 2021-10-12 21:12:43 +03:00
Yahor Berdnikau 4339671457 Migrate configuration cache tests to new test DSL.
^KT-45745 In Progress
2021-10-12 19:22:15 +03:00
Yahor Berdnikau 208422d2ec Populate settings also for buildSrc module.
^KT-45745 In Progress
2021-10-12 19:22:14 +03:00
Yahor Berdnikau 38849b7be4 Add helper to create temp directory.
This directory will be cleaned up on successful test, but will be left
on test error.

^KT-45745 In Progress
2021-10-12 19:22:13 +03:00
Yahor Berdnikau 6c747d33f7 Add Js and MPP plugins to default setup.
^KT-45745 In Progress
2021-10-12 19:22:12 +03:00
Yahor Berdnikau 9e21bda307 Also setup default settings values for 'settings.gradle.kts'.
^KT-45745 In Progress
2021-10-12 19:22:10 +03:00
Yahor Berdnikau 5d07eb77f2 Allow declaring @GradleTestVersions for the whole test suite.
^KT-45745 In Progress
2021-10-12 19:22:09 +03:00
Mark Punzalan 4f0b52b653 FIR: Transform annotations on type arguments during body resolve. 2021-10-12 18:56:32 +03:00
Dmitriy Novozhilov d6e428cd98 [Build] Add FIR plugin prototype tests to firCompilerTest task 2021-10-12 17:26:45 +03:00
Dmitriy Novozhilov fce6efe412 [FIR] Validate generated member declarations 2021-10-12 17:26:44 +03:00
Dmitriy Novozhilov 7f836ee6c3 [FIR] Remove AllOpen prefixes from fir plugin prototype entities 2021-10-12 17:26:43 +03:00
Dmitriy Novozhilov b4d955838e [FIR] Properly use FirContainingNamesAwareScope in all places
Split some delegating scopes to basic and name aware implementations

Also get rid of getContainingCallableNamesIfPresent and
  getContainingClassifierNamesIfPresent functions because they are not
  needed anymore
2021-10-12 17:26:43 +03:00
Dmitriy Novozhilov 5f625f3c16 [FIR] Fail with error if multiple plugins generated classes with same classId
In future we can turn this failure to some proper diagnostic
2021-10-12 17:26:42 +03:00
Dmitriy Novozhilov af6d6ec2b9 [FIR] Properly collect constructors from class in presence of plugins 2021-10-12 17:26:41 +03:00