Commit Graph

69968 Commits

Author SHA1 Message Date
Juan Chen 09acea5548 [FIR]: Set proper classId to enum entries
FirVisibilityChecker::isVisible checked if a private declaration can be
accessed at a use site by matching class ids of the private
declaration's owner with the use site's containing class
declarations. When the private declaration is defined in an enum
entry and used in the same entry, its owner class id has the enum
entry name, but the use site is in an FirAnonymousObject, which has
"anonymous" as the class id. This causes visibility check to fail.

This PR fixes owner class ids of declarations defined in enum entries
to be the same as normal anonymous objects.
2020-10-15 14:46:22 +03:00
Jinseong Jeon ed188204b4 FIR checker: make property init analyzer path-sensitive
In particular, exception throwing path after finally block is
distinguished via path label.

KT-42350 Fixed
2020-10-15 14:22:39 +03:00
Jinseong Jeon 6fc3f7e776 FIR CFG: label edges from try-enter through finally block to exit target 2020-10-15 14:22:39 +03:00
Jinseong Jeon 43852ad7ab FIR CFG: add edges from try/catch to finally 2020-10-15 14:22:39 +03:00
Jinseong Jeon ea2f773e54 FIR checker: reproduce KT-42350 2020-10-15 14:22:38 +03:00
Alexander Udalov da69e3db7c kotlinx-metadata-jvm: report error on using metadata version < 1.4 in writers
The main reason for this change is that the current API for class
version requirements (`KmClass.versionRequirements`) makes it impossible
to support pre-1.4 metadata where this was stored incorrectly for nested
classes: with the "version requirement table" in the outer class, and
indexes into that table in nested classes. See KT-41011.

Other than this aspect, metadata of classes is basically the same in
pre-1.4 and 1.4, which means that if some kotlinx-metadata-jvm users
really need to serialize metadata of an earlier version and they don't
care about the version requirements issue, they can just use these new
bytes but write the earlier version (e.g. 1.1) to the class file.
Everything will work the same, except for the possible version
requirements issue mentioned above.

Note that metadata version 1.4 is still supported for
`KotlinModuleMetadata.Writer` though.

 #KT-41011 Fixed
2020-10-15 13:10:01 +02:00
Alexander Udalov 5d7d9beb0d kotlinx-metadata-jvm: remove bytecodeVersion from write methods
Bytecode version has never been used meaningfully in Kotlin, and will be
removed in a future release, so there's no point in using it. See
KT-41758.
2020-10-15 13:10:01 +02:00
Alexander Udalov 90d66b0ba5 kotlinx-metadata: reformat, cleanup, fix inspections 2020-10-15 13:10:01 +02:00
Roman Artemev c89c31cd29 [KLIB] Fix package name (js -> common) 2020-10-15 13:55:06 +03:00
Roman Artemev 07a1124b99 [KLIB] Support error code in metadata 2020-10-15 13:55:06 +03:00
Roman Artemev f4830c88b9 [JS IR] Make error code tests modular 2020-10-15 13:55:06 +03:00
Roman Artemev 0f7032051b [JS IR] Fix klib generation (proper order of flags) 2020-10-15 13:55:06 +03:00
Roman Artemev a4945878aa [KLIB] Pass containsErrorCode flag from library/IC cache into deserializer
- Make deserializer track whether error node are allowed.
2020-10-15 13:55:05 +03:00
Roman Artemev 28c6d17ab4 [KLIB] Mark klib that contains error with special flag 2020-10-15 13:55:05 +03:00
Roman Artemev 98e5510871 [KLIB] Support IrError* nodes in serialization 2020-10-15 13:55:05 +03:00
Roman Artemev 934141f8af [KLIB] Support IrError* nodes in klib proto
- add proto messages
 - regenerate java-proto
 - support in reader to make code compiled
2020-10-15 13:55:05 +03:00
Roman Artemev 8ce497c7ef [IR] Add wrapped descriptor for error declaration 2020-10-15 13:55:05 +03:00
Mikhail Zarechenskiy eacc94a89d Do not hide synthetic properties except isEmpty from Java
In order to hide synthetic property isEmpty from JDK 15, there was
 added additional logic in 5cc12b49fc but
 it also lead to the fact that now it's impossible to call synthetic
 property `declaringClass` on `Enum` as it's in the same list as method
 isEmpty(). Note that it's questionable behavior, probably we should
 also hide `declaringClass` as well but for now we turn it back to
 preserve compatibility

 #KT-42467 Fixed
2020-10-15 12:26:17 +03:00
Yaroslav Chernyshev 4227e2dc40 [Cocoapods] Fix task and directory naming to avoid subspecs collision
Logics of generating name for dependencies downloaded from git or url
admits producing tasks with forbidden symbols inside name for subspecs.
This fix introduces replacing of forbidden symbols for such purposes.

#KT-42550 Fixed
2020-10-15 09:59:33 +03:00
Jinseong Jeon b8817d5884 FIR2IR: clean up dead code regarding overriding utils 2020-10-15 08:47:46 +03:00
Jinseong Jeon 5f64d6ec76 FIR2IR: add support for callable reference to Java field
#KT-42656 Fixed
2020-10-15 08:47:46 +03:00
Jinseong Jeon 65545a10c4 FIR: reproduce KT-42656 2020-10-15 08:47:46 +03:00
Derek Bodin 96834d6f4c Update example for default buildList to not use capacity KT-41136 (#3688) 2020-10-15 01:56:57 +03:00
Vladimir Dolzhenko d9b3f91d73 Support hasError in ide perf tests vega charts 2020-10-15 00:09:48 +02:00
Vladimir Dolzhenko 051d914996 Align ide perf tests vega charts with json reports camelCase propNames
fix handling test errors
2020-10-14 21:31:03 +02:00
Ilya Kirillov 98efdaa523 FIR IDE: fix KtTypeRendererTest 2020-10-14 22:11:12 +03:00
Ilya Kirillov 5cda4b5ab3 fix test generator compilation 2020-10-14 22:11:12 +03:00
Ilya Kirillov 29151665e1 FIR IDE: add fir ide plugin tests task 2020-10-14 22:11:11 +03:00
Ilya Kirillov bd68b937e5 FIR: ignore testdata directory in testPsiConsistency test 2020-10-14 22:11:10 +03:00
Ilya Kirillov 5c798d4e13 FIR IDE: fix test data in fir-ide module 2020-10-14 22:11:10 +03:00
Ilya Kirillov 6086b54a06 FIR IDE: do preliminary highlighting in completion tests considering exceptions 2020-10-14 22:11:09 +03:00
Ilya Kirillov b9cf9d8bc5 FIR IDE: add missing test dependency 2020-10-14 22:11:09 +03:00
Ilya Kirillov 2f093e76b0 FIR IDE: render resolve phase for lazy resolve tests 2020-10-14 22:11:08 +03:00
Ilya Kirillov 9c53c66bb5 FIR IDE: actualize testdata for idea-frontend-fir module 2020-10-14 22:11:08 +03:00
Ilya Kirillov a585d20639 FIR IDE: fix bodies calculator for property acessors 2020-10-14 22:11:07 +03:00
Ilya Kirillov ab4faa52f0 FIR IDE: add missing IdeSessionComponents for FirIdeBuiltinsAndCloneableSession 2020-10-14 22:11:06 +03:00
Ilya Kirillov a22514cf8e FIR IDE: separate lazy phase into 3 phases, add contracts phase 2020-10-14 22:11:06 +03:00
Ilya Kirillov c418140bef FIR IDE: fix test dependencies 2020-10-14 22:11:05 +03:00
Ilya Kirillov dc467f7d6c FIR: add test which checks that we do not access lazy bodies & lazy expressions till contract phase 2020-10-14 22:11:04 +03:00
Ilya Kirillov 7611135a4a FIR: add raw fir building delegate expression test 2020-10-14 22:11:04 +03:00
Ilya Kirillov 971e551bae FIR IDE: implement lazy delegate initializers 2020-10-14 22:11:00 +03:00
Ilya Kirillov 3f9735dd5d FIR: use enum in RawFirBuilder to indicate its mode: normals, stubs, or lazy bodies 2020-10-14 22:11:00 +03:00
Ilya Kirillov 81d4371685 FIR IDE: generate lazy initializers for properties 2020-10-14 22:10:59 +03:00
Ilya Kirillov 7c1170722f FIR: add FirLazyExpression node 2020-10-14 22:10:58 +03:00
Ilya Kirillov 71b5b6df7c FIR IDE: add tests for lazy resolving single declaration in file 2020-10-14 22:10:58 +03:00
Ilya Kirillov f4199a0729 FIR: add ability to render declaration phase in FirRenderer 2020-10-14 22:10:57 +03:00
Ilya Kirillov bbf450703f FIR: introduce stub bodies raw fir test case 2020-10-14 22:10:56 +03:00
Ilya Kirillov d2d330c3be FIR IDE: implement lazy functions, constructors & accessors bodies building for raw fir
test
2020-10-14 22:10:56 +03:00
Ilya Kirillov 4fae9cbdb0 FIR: introduce FirLazyBlock node 2020-10-14 22:10:55 +03:00
Ilya Kirillov 864800902b FIR IDE: introduce WeakFirByPsiRef 2020-10-14 22:10:55 +03:00