Commit Graph

329 Commits

Author SHA1 Message Date
Dmitriy Novozhilov b454fcc1e0 [FIR] Save IR dumps to .ir.txt files instead of .txt in tests
This is needed to avoid clashes between different dumps from different
  handlers
2021-10-12 17:26:36 +03:00
Dmitry Petrov 146f0f4904 JVM_IR KT-41214 emit PermittedSubclasses on JDK17+ 2021-10-09 17:07:35 +03:00
Pavel Kunyavskiy a40022efcd Generate IR for annotation class constructors. 2021-09-23 06:59:33 +00:00
pyos e385484994 FIR: when translating raw types, reuse computed upper bounds
Also, don't bother ensuring that the upper bound has the same tree size
as the lower bound; the new index computation can handle it when some
subtrees of the lower bound are replaced by star projections in the
upper bound.
2021-09-06 13:11:06 +03:00
pyos 5704dffdbe FIR: attach annotations to Java-converted cone types 2021-09-06 13:11:03 +03:00
Alexander Udalov ffe0d9de70 Psi2ir: do not sort descriptors for fake override generation
Descriptors are already supposed to be sorted in scopes. The problem is
that rendering descriptors for sorting takes a lot of time (~1.5% of
total compilation time of intellij with JVM IR), and simple heuristics,
like comparing by names first, don't fully help with it.

 #KT-48233
2021-08-31 20:25:59 +02:00
Mikhael Bogdanov a5e59e09ee Copy methods for lambdas to DefaultImpls without receiver transformation
#KT-48230 Fixed
2021-08-18 09:58:27 +00:00
Denis.Zharkov 753ba99b04 FIR: Support enhanced types when checking if Java type is primitive 2021-08-17 21:38:01 +03:00
pyos 3dc7b6c3ee IR: preserve argument evaluation order more carefully
1. receivers should be evaluated before named arguments;
 2. just because an argument has no side effects doesn't mean it is not
    affected by the other arguments' side effects - in that case it
    should still be evaluated in source order.

 #KT-47660 Fixed
2021-07-13 21:23:15 +03:00
Andrey Zinovyev b44785c24e [FIR] NOTHING_TO_OVERRIDE diagnostic 2021-07-08 18:13:47 +03:00
Roman Artemev 6993b86d3b [IR] Fix IrCapturedType equals/hashCode
It could lead to SOE if CT has itself as superType
- fix KT-47424
2021-06-28 20:43:14 +03:00
Andrey Zinovyev d360932ebc [FIR] Fill overriddenSymbols for fake overridden IrProperty 2021-06-17 13:24:12 +03:00
Roman Artemev 71af11052a [TEST] Mute tests irText klib tests 2021-06-16 21:16:55 +03:00
Roman Artemev bbcd511c44 [TEST] fix irText testData
- support DELEGATED_MEMBER overrides
2021-06-16 21:16:48 +03:00
Roman Artemev 14c91ca0de [TEST] Set proper TARGET_BACKEND for jvm-specific irText tests 2021-06-16 21:16:43 +03:00
Mikhail Glukhikh 77dd0ad396 FIR: handle custom attributes more precise 2021-06-09 15:42:37 +03:00
Mikhail Glukhikh a255f44d6e FIR2IR KT-46578 add overridden properties generation 2021-05-14 16:20:20 +03:00
Dmitry Petrov 53c1de172f IR KT-46578 add IrProperty#overriddenSymbols 2021-05-14 16:20:18 +03:00
Dmitry Petrov 660208740e PSI2IR KT-44013 WA: function interface constructor call accepted by FE 2021-04-27 17:35:37 +03:00
Mikhail Glukhikh f278de8768 FIR: don't call toString() inside string concatenations 2021-04-26 12:50:55 +03:00
Dmitry Petrov e89ab71bf8 JVM_IR KT-45934 don't generate declaration stubs for delegates 2021-04-15 17:59:19 +03:00
Dmitry Petrov 7d62f0b5aa JVM_IR KT-45187 use Arrays.copyOf to copy an array in spread operator
Creating a new array (and copying data into it with System.arraycopy)
doesn't work in generic case, because the actual array class depends on
call site.
2021-04-13 22:27:37 +03:00
Dmitry Petrov 7e03f8ea80 JVM_IR KT-45853 include return type into Java method IdSignature
This is a hack required to accept [potentially] incorrect input
provided by the front-end; see KT-46042.
2021-04-12 22:52:08 +03:00
Mikhail Glukhikh 9f27362ee1 Match triangle & diamond intersections in FirTypeIntersectionScope 2021-04-02 10:24:20 +03:00
Dmitriy Novozhilov 3d1f4b8386 [FIR] Don't add @EnhancedVisibility to types with @Nullable annotation 2021-03-15 12:13:06 +03:00
Dmitriy Novozhilov 65ea4e184a [FIR] Fix enhancement of FlexibleNullability and EnhancedNullability
- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
2021-03-11 13:10:04 +03:00
Denis.Zharkov 377a0aa237 FIR2IR: Adjust test data for updated overridden structure 2021-02-20 10:59:22 +03:00
Mikhail Glukhikh 357a7907a3 FIR: fix type approximation by visibility 2021-02-19 10:39:57 +03:00
Dmitriy Novozhilov 2d5b685535 [FIR] Fix processing constructors of sealed classes
- Allow declaring protected constructors in sealed classes
- Make default visibility of sealed class constructor `protected`

KT-44861
KT-44865
2021-02-12 13:36:41 +03:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Mikhail Glukhikh d4b0688690 FIR: introduce delegate field initializers
Before this commit we initialized delegate fields in primary constructor,
that could provoke NPE in case delegate is used in initializer of
some property backing field.
Now we initialize delegate fields directly instead.
2021-02-08 14:28:27 +03:00
Mikhail Glukhikh 465261e611 FIR: don't create intersection override for duplicating symbols 2021-02-02 16:25:08 +03:00
Dmitriy Novozhilov ee1aff1012 [Test] Update different testdata according to changes in sealed classes 2021-01-28 13:19:29 +03:00
Mikhail Glukhikh 4fd4f504d0 FIR: make componentX functions operator 2021-01-22 18:11:57 +03:00
Dmitriy Novozhilov 77115cea92 [TD] Union ir dumps of different test files 2021-01-22 13:51:30 +03:00
Dmitriy Novozhilov 4752924b13 [TD] Update FQN's in testdata of IR text tests 2021-01-22 13:51:29 +03:00
Dmitry Petrov 0841a6b0ea irText tests for KT-19306 2020-12-23 21:50:06 +03:00
Georgy Bronnikov 076272f7ca FIR2IR: avoid descriptors computing hashCode
When synthesizing the hashCode function for data classes, descriptors
were used, in partcular, memberScope for primitive classes.
IrBasedDescriptors have no member scope, so we compute the hashCode
function based on IR structures.
2020-12-23 18:50:52 +03:00
Jinseong Jeon fe0c25693d FIR2IR: do not convert @ExtensionFunctionType twice 2020-12-18 12:17:21 +03:00
Dmitry Petrov b0f6461fa9 JVM_IR KT-42020 special IdSignature for some fake override members 2020-12-15 12:56:45 +03:00
Dmitry Petrov 69c88a8a0a PSI2IR KT-41284 use getters for open data class property values
'allopen' compiler plug-in can make data classes and their members open,
which is a compilation error in usual case, but makes sense for Spring
and other frameworks that generate proxy-classes.
2020-12-09 10:29:09 +03:00
Zalim Bashorov 6abd656116 [IR] dumpKotlinLike: update testdata after rebase 2020-11-26 00:15:26 +03:00
Zalim Bashorov 69f0f4ef19 [IR] update testdata: unify printing custom/non-standard modifiers 2020-11-26 00:15:21 +03:00
Zalim Bashorov 57cb8f97e9 [IR] update testdata: don't use "D" suffix on double constants 2020-11-26 00:15:18 +03:00
Zalim Bashorov c68040753d [IR] dumpKotlinLike: add testdata for FIR tests 2020-11-26 00:15:13 +03:00
Zalim Bashorov ad0f154ed1 [IR] add new testdata after rebase 2020-11-26 00:15:07 +03:00
Zalim Bashorov 2dbd784a6a [IR] update testdata: print else -> ... 2020-11-26 00:14:55 +03:00
Zalim Bashorov a34a311e86 [IR] update testdata: support annotations on parameters 2020-11-26 00:14:50 +03:00
Zalim Bashorov 5cb2572c60 [IR] update testdata: better support for enum and object accesses 2020-11-26 00:14:48 +03:00
Zalim Bashorov 21da2b0350 [IR] update testdata: print whole string concatenation at one line 2020-11-26 00:14:30 +03:00