Commit Graph

82759 Commits

Author SHA1 Message Date
Jinseong Jeon 10f19c8f4a FIR UAST: invalidate caches between tests 2021-06-03 17:56:16 +02:00
Jinseong Jeon 37d8e6ddc3 FIR UAST: relocate render/log test data 2021-06-03 17:56:16 +02:00
Jinseong Jeon 80b94a43b0 FIR/UAST: split KotlinUIdentifier into a separate file 2021-06-03 17:56:16 +02:00
Jinseong Jeon 68766024b3 FIR/UAST: commonize Identifier implementations 2021-06-03 17:56:16 +02:00
Jinseong Jeon 6af930f6df FIR UAST: convert LeafPsiElement to UIdentifier 2021-06-03 17:56:16 +02:00
Jinseong Jeon 83256ef3bd FIR UAST: introduce identifiers and refNames tests 2021-06-03 17:56:16 +02:00
Jinseong Jeon c37123603c UAST: utilize identifier test base 2021-06-03 17:56:16 +02:00
Ivan Kochurkin da15f0ffe8 [FIR] Consider fullyExpandedType instead of original type in isSubtypeForTypeMismatch, consider lookupTag in isError method 2021-06-03 18:24:36 +03:00
Ivan Kochurkin 0b0a96a1d3 [FIR] Fix processing of nested type arguments, extract extractTypeRefAndSourceFromTypeArgument method to FirHelpers and use it from FirClassVarianceChecker and FirConflictingProjectionChecker 2021-06-03 18:24:35 +03:00
Ivan Kochurkin f081a6b4fa [FIR] Implement REDUNDANT_PROJECTION diagnostics, rename FirConflictingProjectionChecker -> FirProjectionRelationChecker, fix tests 2021-06-03 18:24:34 +03:00
Ivan Kochurkin 03e577bf98 [FIR] Implement CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION diagnostics, fix tests 2021-06-03 18:24:32 +03:00
Ivan Kochurkin ca970f0a8b [FIR] Add ConeKotlinTypeConflictingProjection, return it from substituteArgument instead of ConeStarProjection in appropriate cases, remove plus operator from ProjectionKind 2021-06-03 18:24:30 +03:00
Ivan Kochurkin b85846c0c0 [FIR] Fix location for CONFLICTING_PROJECTION diagnostics, extend conflictingProjection.kt with test sample 2021-06-03 18:24:29 +03:00
Ilya Goncharov ce78457eaa [Gradle, JS] Use replace by just string, not regexp in webpack config
^KT-43379 fixed
2021-06-03 17:55:05 +03:00
Ilya Goncharov 8c38c4a8e7 [Gradle, JS] Add dependency from packageJson task on included build's rootPackageJson 2021-06-03 17:55:04 +03:00
Victor Petukhov 19c07e048a Don't check suitability of a builder inference call if unrestricted builder inference is enabled
^KT-42139 Fixed
2021-06-03 17:28:40 +03:00
Dmitry Savvinov f8fbbc01b6 Don't append 'is a module' suffix to ModuleDescriptor debug text 2021-06-03 17:22:00 +03:00
Dmitry Savvinov 708fead1cc Add debug strings to frontend scopes-related structures
Such as:
- PackageFragmentProviders, and, in particular,
CompositePackageFragmentProviders
- JavaPackageFragments
- Scopes produced by those providers

The rationale is that a lot of frontend-facing bugs (like red code) are
easily recognizeable in resolution. But at that point you just see a
bunch of scopes, without meaningful toStrings, you don't know who has
produced them, and what's exactly wrong.

With this commit it should make debugging slightly easier: now at least
you'll be able to see that "this scope is a scope of package fragment
for foo.bar of module baz" and decide whether the declaration should or
should not have been resolved from such scope.
2021-06-03 17:21:59 +03:00
Alexander Dudinsky a51c65ed60 Update test data for MultiModuleHighlightingTest.testLanguageVersionsViaFacets
Add `Resolved to error element` markers
2021-06-03 16:42:24 +03:00
Nikita Bobko e4205e5aa7 Pack 'compiler/testData/diagnostics/helpers' into kotlin-compiler-testdata-for-ide
This testdata is required for AbstractDiagnosisCompilerTestDataTest in FIR IDE in IJ infrastructure
2021-06-03 15:34:46 +02:00
Mikhail Glukhikh 2bf0e6744d FIR2IR: optimize coerceToUnitIfNeeded in implicit cast inserter 2021-06-03 16:14:42 +03:00
Mikhail Glukhikh 13d91837be FIR: cache functional type symbols in type resolver 2021-06-03 16:14:42 +03:00
Mikhail Glukhikh 1294c8de53 FIR: don't get class symbol if it's unnecessary (Java type conversion) 2021-06-03 16:14:41 +03:00
Nikita Bobko 3c7b07b90f Include tests-compiler-utils into kotlin-compiler-tests-for-ide artifact
It fixes:
```
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/fir/FirCfgConsistencyChecker

	at org.jetbrains.kotlin.test.frontend.fir.handlers.FirCfgConsistencyHandler.processModule(FirCfgConsistencyHandler.kt:15)
	at org.jetbrains.kotlin.test.frontend.fir.handlers.FirCfgConsistencyHandler.processModule(FirCfgConsistencyHandler.kt:13)
	at org.jetbrains.kotlin.test.TestRunnerKt.processModule(TestRunner.kt:236)
	at org.jetbrains.kotlin.test.TestRunnerKt.hackyProcess(TestRunner.kt:231)
	at org.jetbrains.kotlin.test.TestRunnerKt.access$hackyProcess(TestRunner.kt:1)
```
while running `DiagnosisCompilerTestFE10TestdataTestGenerated.Tests#testBinaryCallsOnNullableValues` (and probably other tests) in new infrastructure
2021-06-03 15:04:10 +02:00
Dmitry Petrov 107e71acb0 Minor: fix Android tests 2021-06-03 13:05:23 +03:00
pyos 4128d27510 JVM_IR: do not use invokedynamic for inline fun references 2021-06-03 13:05:23 +03:00
Mads Ager 5d53d34d85 Fix regression test for KT-46962. 2021-06-03 13:05:23 +03:00
Victor Petukhov 124a14c8df Use separate constraint position during call substitution as part of inferring postponed type variables
^KT-47052 Fixed
^KT-47082 Fixed
2021-06-03 12:37:17 +03:00
Ilmir Usmanov 7a2ecc58d4 Minor. Regenerate tests 2021-06-03 12:35:26 +03:00
pyos d5d3d9f112 Add regression tests for KT-46890 and other stuff 2021-06-03 12:35:25 +03:00
pyos ada4c48eba JVM_IR: correctly (?) unbox Result when needed
and don't unbox when not needed.

 #KT-46890 Fixed
2021-06-03 12:35:24 +03:00
pyos 288451db4d JVM_IR: remove an unnecessary hack from BridgeLowering
Correct IR is more important than whether some inaccessible members
precisely match what was generated by the old backend.
2021-06-03 12:35:23 +03:00
Dmitriy Novozhilov 6f54e9fd5c Revert "FIR: add smartcast stability to FIR"
This reverts commit 96bd2c54
2021-06-03 09:54:02 +03:00
Dmitriy Novozhilov 0497f60af3 Revert "FIR DFA: store stability in RealVariable"
This reverts commit 62f7e8f7
2021-06-03 09:53:57 +03:00
Dmitriy Novozhilov 796f8e6bce Revert "FIR checkers: report SMARTCAST_IMPOSSIBLE"
This reverts commit 84334b08
2021-06-03 09:48:50 +03:00
Ilya Kirillov 20d1a84002 FIR/FIR IDE: fix FirFailingTestSuppressor for IDE
We need to have IdeTestIgnoreHandler executed after FirFailingTestSuppressor,
otherwise IdeTestIgnoreHandler will suppress exceptions
and FirFailingTestSuppressor will throw error
saying that file .fir.fail exists but test passes
2021-06-03 00:19:52 +03:00
Ilya Kirillov 948d9390d6 FIR: "//TODO make thread safe" comment from FirBuiltinSymbolProvider 2021-06-03 00:09:03 +03:00
Ilya Kirillov f361312e45 FIR: use FirCachesFactory in BuiltInsPackageFragment.tryGetSyntheticFunctionalInterface 2021-06-03 00:09:02 +03:00
Ilya Kirillov ba2315430b FIR: get rid of lateinit var in FirBuiltinSymbolProvider for thread safety 2021-06-03 00:09:01 +03:00
Ilya Kirillov 863156679d FIR: use FirCachesFactory in BuiltInsPackageFragment.getClassLikeSymbolByFqName 2021-06-03 00:09:00 +03:00
Dmitry Petrov 7a43c2de79 JVM remove dead code during constant condition elimination
This avoids an extra call to 'analyze', which is rather costly.

Update debugger testData: Constant condition
elimination now performs DCE more consistently.
2021-06-03 00:08:27 +03:00
Dmitry Petrov 1fd94d1bc2 JVM Minor: cleanup RedundantNullCheckMethodTransformer 2021-06-03 00:08:25 +03:00
Mads Ager 0b5ec5535c [JVM_IR] Add String.plus(Any) to intrinsics list.
This filters it out for use in SAM wrapper generation with
invoke-dynamic.

The intrinsic is not actually used for code generation so
it is added to the list of intrinsics that should have been
lowered away before codegen.

^KT-45779 Fixed
2021-06-03 00:04:47 +03:00
Alexander Udalov c1021623e8 Do not use ClassLoader.getResourceAsStream in reflection
Use ClassLoader.getResource + openStream instead, to workaround an issue
in URLClassLoader.

Also set useCaches to false because kotlin-reflect only reads builtins
metadata once per class loader, and doesn't need it to be cached. Using
caches here might also lead to the problem of closed input streams when
protobuf is read in parallel. The test doesn't check exactly this,
though (it seems to succeed even if cached connections are used).

Note that BuiltInsResourceLoader has a JDK 9+ specialization at
libraries/reflect/api/src/java9, but that implementation does not need
any changes because it uses Module.getResourceAsStream which is not
affected by this issue in URLClassLoader.

 #KT-18277 Fixed
2021-06-02 22:54:16 +02:00
Vasily Levchenko a0503aa2d7 [kotlin-native][test][debugger] exclude non constant part of stack trace from gold values
(cherry picked from commit ac072d3cc0aea0d311062f58fb5382cac6912deb)
2021-06-02 18:36:59 +00:00
Nikita Bobko ea24da117b Publish compiler testdata which is required for Kotlin plugin 2021-06-02 21:30:03 +03:00
Sergey Shanshin 71c9e62d64 Added support serialization of local classes in IR backend
Resolves Kotlin/kotlinx.serialization#1427
2021-06-02 16:43:31 +00:00
Pavel Punegov ac0dc94800 Since 1.5.30-dev-1466 a new archive naming schema was introduced
Support both names in NativeCompilerDownloader
2021-06-02 18:30:52 +03:00
Pavel Punegov 789799ac17 Revert simpleOsName in HostManager
Support old naming in simpleOsName.
Introduce new platformName method for the new archive naming.
2021-06-02 18:30:52 +03:00
Leonid Startsev 1f837134bb Support for @EncodeDefault annotation 2021-06-02 13:43:39 +00:00