Compare commits

..

281 Commits

Author SHA1 Message Date
Dmitry Petrov
4dc65c6a3e JVM_IR KT-45103 optimize direct invoke for lambdas and callable refs 2021-04-26 17:17:25 +03:00
Dmitry Petrov
05e642cacf JVM_IR KT-36646 fuze primitive equality with safe call 2021-04-26 13:10:32 +03:00
Dmitry Petrov
f830786b20 JVM_IR update test for KT-36637 2021-04-26 13:10:31 +03:00
Dmitry Petrov
22c5b3a990 JVM_IR use static 'hashCode' for boxed primitives on JVM 1.8+ 2021-04-26 13:10:31 +03:00
Mikhail Glukhikh
29d2a6acee FIR: fold String arguments inside string concatenation call
Related to KT-28006
2021-04-26 12:50:57 +03:00
Mikhail Glukhikh
f278de8768 FIR: don't call toString() inside string concatenations 2021-04-26 12:50:55 +03:00
Igor Chevdar
7dcdbf283b [box-tests] Added test 2021-04-26 11:53:27 +05:00
Igor Chevdar
eb1dcdb344 [K/N][IR] Fixed bug with enum companion init
Fixes https://youtrack.jetbrains.com/issue/KT-46048
2021-04-26 11:53:27 +05:00
Igor Chevdar
476b3befaf [K/N][IR] Refactored enums lowering a bit 2021-04-26 11:53:26 +05:00
Andrey Zinovyev
01dd3d6ed4 [lombok] Refactoring, cleaning, better tests
Add assertions to tests
Add lombok license
Provide String.[de]capitalize() implementation
Get rid of weak map because it seems it is useless here
2021-04-25 18:18:18 +03:00
Andrey Zinovyev
c4147bc2fd [lombok] Add integration test for gradle plugin 2021-04-25 18:18:17 +03:00
Andrey Zinovyev
5a6819daa8 [lombok] Check that nullability actually works 2021-04-25 18:18:16 +03:00
Andrey Zinovyev
1fb4590978 [lombok] Some cleaning and docs 2021-04-25 18:18:15 +03:00
Andrey Zinovyev
9ebce7849c [lombok] Skip generation with AccessLevel.NONE 2021-04-25 18:18:15 +03:00
Andrey Zinovyev
be4a518a25 [lombok] Support for lombok.accessors.prefix config 2021-04-25 18:18:14 +03:00
Andrey Zinovyev
17e4a6142c [lombok] Strip prefixes defined in @Accessors 2021-04-25 18:18:13 +03:00
Andrey Zinovyev
f2c0b8c68d [lombok] Strip 'is' prefix in boolean properties 2021-04-25 18:18:12 +03:00
Andrey Zinovyev
8a2279de2b [lombok] Use config values as default in annotation parsing 2021-04-25 18:18:11 +03:00
Andrey Zinovyev
c7b2c731af [lombok] Basic @Value support 2021-04-25 18:18:11 +03:00
Andrey Zinovyev
97fc187e77 [lombok] @Data support 2021-04-25 18:18:10 +03:00
Andrey Zinovyev
99f9b79c87 [lombok] Add simple way to use lombok plugin in one project with kapt 2021-04-25 18:18:09 +03:00
Andrey Zinovyev
79d49e6dbd [lombok] Gradle sublugin for no-kapt project 2021-04-25 18:18:08 +03:00
Andrey Zinovyev
8011452c28 [lombok] Don't generate members that already exist 2021-04-25 18:18:07 +03:00
Andrey Zinovyev
d459cde010 [lombok] Run compiled code 2021-04-25 18:18:06 +03:00
Andrey Zinovyev
411441c332 [lombok] Generic classes support 2021-04-25 18:18:06 +03:00
Andrey Zinovyev
afcb2ca904 [lombok] Support @RequiredArgsConstructor 2021-04-25 18:18:05 +03:00
Andrey Zinovyev
b336a335bf [lombok] Support @AllArgsConstructor 2021-04-25 18:18:04 +03:00
Andrey Zinovyev
59f936fdef [lombok] Generate no-arg static factory method 2021-04-25 18:18:03 +03:00
Andrey Zinovyev
37926f333e [lombok] Generate no-arg constructor 2021-04-25 18:18:03 +03:00
Andrey Zinovyev
e9a33e0335 [lombok] Introduce synthetic constructors generation 2021-04-25 18:18:02 +03:00
Andrey Zinovyev
e0216cc9f4 [lombok] Add readme with (not) supported features 2021-04-25 18:18:01 +03:00
Andrey Zinovyev
e0a95ff556 [lombok] @With support 2021-04-25 18:18:00 +03:00
Andrey Zinovyev
7fd8f7b3bc [lombok] @Setter support 2021-04-25 18:17:59 +03:00
Andrey Zinovyev
70e3877efc [lombok] Basic config support 2021-04-25 18:17:57 +03:00
Andrey Zinovyev
5ceefa3e3b [lombok] Support for class level @Getter 2021-04-25 18:17:56 +03:00
Andrey Zinovyev
e4bd33eb4f [lombok] Support for fluent getters 2021-04-25 18:17:55 +03:00
Andrey Zinovyev
f71e08df4d [lombok] Experimental lombok plugin prototype
Add extension point for java descriptors
Add simple usage of this point to generate getter method
Add simple test infrastructure to test compilation with lombok plugin
2021-04-25 18:17:53 +03:00
Yahor Berdnikau
ac86ad252f Optionally make java executable path contribute to the daemon id.
This change will allow to start Kotlin daemon instances using different
from the current user JDK version and use it to compile Kotlin files.
Old behaviour, when java executable path is not set, is still working
 and still,by default, using current user JDK version.

For example, user for some reason wants to use JDK 1.8 as active one,
 but compile current project using JDK 16.

Main goal is to support Gradle toolchains.

^KT-45611 In Progress
2021-04-24 11:12:47 +03:00
Yahor Berdnikau
1d47f4ad2b Consolidate compiler id digest.
Change all calculations of compiler id digest to use
 'CompilerId#digest()' method.

^KT-45611 In Progress
2021-04-24 11:12:46 +03:00
Simon Ogorodnik
c6fa363487 [FIR] Add warning if FIR is used 2021-04-23 19:49:46 +03:00
Victor Petukhov
7a81d0de8a Regenerate tests 2021-04-23 19:28:26 +03:00
sebastian.sellmair
7be48a0b4b CommonizerHierarchicalIT: Enable test commonizeHierarchicallyMultiModule
^KT-46107 Fixed
2021-04-23 16:25:59 +00:00
sebastian.sellmair
63e5298be9 Update 'versions.kotlin-native' to 1.5.20-dev-5613
^KT-46107
2021-04-23 16:25:59 +00:00
Konstantin Tskhovrebov
b894b7df6e Add integration tests for "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks. 2021-04-23 19:23:58 +03:00
Konstantin Tskhovrebov
c8ef0715b9 Register "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks when gradle is run from Xcode.
#KT-27240
2021-04-23 19:23:57 +03:00
Alexander Udalov
0c3f2eefe0 Migrate bytecodeListing tests to new test infrastructure 2021-04-23 17:58:16 +02:00
Alexander Udalov
7e170770ea Minor, move around bytecode listing tests 2021-04-23 17:58:16 +02:00
sebastian.sellmair
28690b7f32 KotlinToolRunner: Add "java.system.class.loader" to execSystemPropertiesBlacklist
IDE integration tests will forward an unvailable intellij classloader
which will fail the execution.
2021-04-23 14:34:17 +00:00
sebastian.sellmair
7b8926f85b [Commonizer] Allow propagation of leaf targets
^KT-46248 Verification Pending
2021-04-23 14:34:17 +00:00
sebastian.sellmair
7c1520a424 [Commonizer] Implement SingleTargetPropagationTest to cover KT-46248
^KT-46248
2021-04-23 14:34:16 +00:00
sebastian.sellmair
965e328766 CommonizerIT: implement test KT-46248 single supported native target dependency propagation to cover KT-46248
^KT-46248
2021-04-23 14:34:15 +00:00
Mikhail Glukhikh
683872ecbf FIR: use more precise checkers when possible 2021-04-23 17:29:43 +03:00
Mikhail Glukhikh
5c224ad17c FIR: fix positioning in fun interface checker 2021-04-23 17:29:34 +03:00
Артём
393a19db54 FIR: introduce FunInterfaceDeclarationChecker 2021-04-23 17:29:25 +03:00
Victor Petukhov
867d7b5bca Allow type variable fixation into intersection type if it isn't meaningless (i.e. has one or more final classes, or two or more open classes)
^KT-46186 Fixed
2021-04-23 15:12:13 +03:00
Victor Petukhov
310d98c4f7 Don't require existence of the corresponding type argument during computing target type to apply type use annotation loaded from class file
^KT-46131 Fixed
2021-04-23 15:12:12 +03:00
sebastian.sellmair
13b1664edf CommonizerIT: Implement additional test KT-46142 standalone native source set
^46142
Before this test, the behaviour was tested as integration test in the IDE.
This Gradle integration test will detect issues even earlier.
2021-04-23 15:02:15 +03:00
Konstantin Tskhovrebov
ee4a1d173d Revert "Add integration tests for "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks."
This reverts commit 6db3960d
2021-04-23 12:11:42 +03:00
Konstantin Tskhovrebov
8840a9ecd1 Revert "Register "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks when gradle is run from Xcode."
This reverts commit c2cdf9c7
2021-04-23 12:11:19 +03:00
Ilmir Usmanov
f7a9bc3521 Minor. Make test actually suspend and add a test without suspension 2021-04-23 03:50:08 +02:00
pyos
23ffbe4d9e JVM_IR: do not box inline classes in suspend multifile bridges 2021-04-23 03:49:47 +02:00
pyos
7d95943b8b JVM_IR: do not box inline classes in suspend synthetic accessors 2021-04-23 03:49:43 +02:00
Alexander Likhachev
857bee6ced [Build] Remove empty source directories warning
There're should be no more cache misses on empty directories with Gradle 6.8. See https://docs.gradle.org/6.8/release-notes.html#more-cache-hits-when-empty-directories-are-present
2021-04-23 03:52:45 +03:00
Alexander Likhachev
03f9d78eb3 [Build] Add workaround to make local publishing serializable
Also signing plugin now being applied only when signing is required.
#KT-44611 In Progress
2021-04-23 03:52:41 +03:00
Sergey Igushkin
4e6c483ccc Add a final override for project in KotlinGradleFragmentInternal 2021-04-23 00:43:14 +03:00
Sergey Igushkin
bb35d9271f Minor fix: don't use lazy in KotlinPm20ProjectExtension.modules 2021-04-23 00:43:14 +03:00
Sergey Igushkin
53f02a53f0 Add caching to dependency resolvers in PM20 + some refactoring 2021-04-23 00:43:13 +03:00
Sergey Igushkin
1f0089c5de Refactor the dependency graph resolver to be more readable 2021-04-23 00:43:13 +03:00
Sergey Igushkin
d07c76fca4 Add kotlin-project-model artifacts to the set of trusted artifacts 2021-04-23 00:43:12 +03:00
Sergey Igushkin
6be33448d6 Rework adding sources to FilteringSourceRootsContainer in JVM tasks
Support adding lazily-evaluated file collections (i.e. tracking their
source roots lazily, as opposed to eagerly evaluating the source roots.
2021-04-23 00:43:12 +03:00
Sergey Igushkin
e59a57d11c Add ":kotlin-project-model" to the list of modules installed for tests 2021-04-23 00:43:11 +03:00
Sergey Igushkin
e7b81c52a7 Get rid of DependencyDiscovery in favor of DependencyGraphResolver 2021-04-23 00:43:11 +03:00
Sergey Igushkin
d602470027 Fix compilation of the tests in kotlin-project-model 2021-04-23 00:43:10 +03:00
Sergey Igushkin
fe351f26ef For now, publish the sources elements variant with usage=kotlin-sources 2021-04-23 00:43:10 +03:00
Sergey Igushkin
a94597d85a Experimental sources publication in the PM2.0 prototype 2021-04-23 00:43:10 +03:00
Sergey Igushkin
44fcd7e891 Use KotlinCompilationTaskConfigurator for metadata compilation tasks 2021-04-23 00:43:09 +03:00
Sergey Igushkin
4cb6303fa8 Get rid of kotlinPluginVersion in the constructors throughout the plugin
We passed the kotlinPluginVersion which was only used for a single
purpose in countless constructors.

In fact, the plugin version is easy to load at the call site, as it gets
loaded from the plugin's resources.

So rework the plugin version loading code so that it doesn't rely on the
applied plugin, and don't pass the plugin version in all those
constructors.
2021-04-23 00:43:09 +03:00
Sergey Igushkin
2a5d511b66 Minor fix: handle kotlinOptions more carefully, store them where needed 2021-04-23 00:43:08 +03:00
Sergey Igushkin
00e5e462ea Further refactor compile task configuration: extract the configurator 2021-04-23 00:43:08 +03:00
Anton Lakotka
1a85da5ff8 Make language settings nullable in KotlinModuleFragment
There is no lang settings when importing from klibs (yet)
2021-04-23 00:43:07 +03:00
Anton Lakotka
c3264a2979 Add language consistency checks for fragments
Migrate exiting consistency checker for source sets to be generic
and reuse it for fragments
2021-04-23 00:43:07 +03:00
Anton Lakotka
de4221afd8 Add immutable LanguageSettings interface and apply it to compilation
LanguageSettingsBuilder extends LanguageSettings
2021-04-23 00:43:06 +03:00
Sergey Igushkin
54c6ae2cce (minor) Rename modelClasses.kt -> KotlinJvmVariantFactory.kt 2021-04-23 00:43:06 +03:00
Sergey Igushkin
3be2734c63 Refactor the setup of compilation in the PM20 implementation prototype 2021-04-23 00:43:05 +03:00
Sergey Igushkin
c1fe0d7158 Add publishing configurator, call it from the variant factories 2021-04-23 00:43:05 +03:00
Sergey Igushkin
1271fabffa Fix Maven scope mapping for the runtime dependencies in PM20 publishing 2021-04-23 00:43:04 +03:00
Sergey Igushkin
27015a657c Don't pass the IDE paths to the extracted klibs that don't exist 2021-04-23 00:43:04 +03:00
Sergey Igushkin
470103bfac Don't rely on the current project in dep-resolution if module is given 2021-04-23 00:43:04 +03:00
Sergey Igushkin
f029179fe0 Add basic support for Kotlin/Native variants to the PM20 Gradle plugin 2021-04-23 00:43:00 +03:00
Sergey Igushkin
401fbae8d8 Handle dependency module IDs more carefully in dependency resolution 2021-04-23 00:42:37 +03:00
Sergey Igushkin
ea458e6848 Add some API interfaces for Gradle PM20 entities in the API module 2021-04-23 00:42:37 +03:00
Sergey Igushkin
a52c6858a9 Minor fixes in exposed configurations 2021-04-23 00:42:37 +03:00
Sergey Igushkin
134fb7741e Fix getChosenVariant implementation for project(...) dependencies 2021-04-23 00:42:36 +03:00
Sergey Igushkin
ec3fa2610e Support basic publishing with maven-publish in the PM20 plugin 2021-04-23 00:42:36 +03:00
Sergey Igushkin
0bf408e147 (minor) Add isAllowCommonizer stub to the PM2.0 project extension
This prevents the IDE from failures during Gradle project sync
2021-04-23 00:42:35 +03:00
Sergey Igushkin
4e0485c523 Expose compiled metadata for project deps, set capabilities on elements 2021-04-23 00:42:35 +03:00
Sergey Igushkin
147fd22cfb (minor) Fix static init issue with Gradle multi-threaded resolve 2021-04-23 00:42:35 +03:00
Sergey Igushkin
f1f97b4104 Support published MPP consumption with PM2.0 projects 2021-04-23 00:42:34 +03:00
Sergey Igushkin
70b88ada93 Gradle plugin prototype that uses the project model 2.0 2021-04-23 00:42:34 +03:00
Sergey Igushkin
d66f95b80e Resolve dependencies as graph, support multiple modules in a project 2021-04-22 23:42:06 +03:00
Sergey Igushkin
f1fb438d00 Refactor: make fragments resolver consistent with variant resolver 2021-04-22 23:42:05 +03:00
Sergey Igushkin
7103aa3100 ModuleOrigin -> ModuleIdentifier 2021-04-22 23:42:04 +03:00
Sergey Igushkin
66b8a444c2 Add a basic markdown doc explaining dependency resolution. 2021-04-22 23:42:02 +03:00
Sergey Igushkin
6aee396e4b Build PM2.0 in o.j.k.multiplatform (+ dependency resolution API) 2021-04-22 23:42:01 +03:00
Sergey Igushkin
994f940a31 Dependency resolution API in PM2.0 2021-04-22 23:42:00 +03:00
Sergey Igushkin
f189ebc983 Project Model 2.0 initial commit: core entities 2021-04-22 23:41:59 +03:00
Konstantin Tskhovrebov
6db3960d56 Add integration tests for "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks. 2021-04-22 20:33:20 +03:00
Konstantin Tskhovrebov
c2cdf9c796 Register "assembleAppleFrameworkForXcode" and "embedAndSignAppleFrameworkForXcode" tasks when gradle is run from Xcode.
#KT-27240
2021-04-22 20:33:20 +03:00
Alexander Udalov
99e022d023 IR: minor, remove duplicate visibility field 2021-04-22 17:42:18 +02:00
Dmitriy Novozhilov
d4162f876f [FIR] Fix some warnings 2021-04-22 14:32:06 +03:00
Dmitriy Novozhilov
234ab3b35d [FIR] Fix all illegal usages of declarationSiteSession in compiler
There are still some usages in IDE which should be investigated
2021-04-22 14:32:04 +03:00
Dmitriy Novozhilov
f98f41bbc3 [FIR] Rename session to declarationSiteSession in declaration builders 2021-04-22 14:32:03 +03:00
Dmitriy Novozhilov
c3b1be1a39 [FIR] Rename FirDeclaration.session to declarationSiteSession 2021-04-22 14:32:02 +03:00
Dmitriy Novozhilov
46f5c2073d [FIR] Make most of declarations a sealed classes/interfaces 2021-04-22 14:32:00 +03:00
Dmitriy Novozhilov
7f7373dad2 [FIR] Support sealed classes and interfaces in FIR tree generator 2021-04-22 14:31:59 +03:00
Dmitriy Novozhilov
951daeea3a [FIR] Add typealias to AbstractFirBasedSymbol<*> in FirDiagnosticsList 2021-04-22 14:31:58 +03:00
Vasily Levchenko
1ae41443a2 [kotlin-native][build] clean task fix 2021-04-22 11:16:55 +00:00
Jinseong Jeon
24d792fb49 FIR checker: warn useless elvis 2021-04-22 13:10:54 +03:00
Alexander Udalov
b2005302dc JVM, JVM IR: erase generic SAM supertypes
Also, do not try to use invokedynamic on SAM calls with intersection
types, because intersection type is not allowed as an immediate type
projection of a supertype, and constructing a fake override in
LambdaMetafactoryArgumentsBuilder led to an exception. This fixes the
problem which was worked around earlier in e6c089ef, effectively
reverting that commit.

The main motivation for this change is that LambdaMetafactory also
doesn't generate generic signature for SAM wrapper classes at runtime.
Since these classes are synthetic, nobody should rely on the fact that
they have generic supertypes, which was observable only via Java
reflection.

 #KT-46149 Fixed
 #KT-46238 Fixed
2021-04-22 10:53:15 +02:00
Andrey Zinovyev
1093bffc62 [KAPT] Cache annotation processors' classloaders
Adds experimental feature to cache annotation processors' classloaders
It should increase speed of KAPT for consecutive runs
Works for gradle only (it stores cl in gradle daemon)
#KT-28901 Fixed
2021-04-22 11:51:14 +03:00
Mikhail Glukhikh
e6b9935df9 FIR: drop source-based check from InferenceUtils 2021-04-22 10:26:47 +03:00
sebastian.sellmair
75d9cd3814 [Minor] KotlinLibraryResolverImpl: Improve readability in resolveDependencies 2021-04-21 20:05:57 +00:00
sebastian.sellmair
3c4d0a1814 CInteropCommonizerTask: Mark dependency on commonized native distribution as @Classpath 2021-04-21 20:05:56 +00:00
sebastian.sellmair
f4617b2c03 Do not forward external dependencies on c-interop commonization.
^KT-46109
^KT-46107 Fixed
2021-04-21 20:05:56 +00:00
sebastian.sellmair
22ea5c7de4 Demote fatal error to warning on unresolved libraries mentioned in Klib's manifest 'depends' for metadata compilation
^KT-46107
2021-04-21 20:05:55 +00:00
sebastian.sellmair
95a1a4e66a CommonizerHierarchicalIT: Implement test commonizeHierarchicallyMultiModule
^KT-46107
2021-04-21 20:05:54 +00:00
sebastian.sellmair
5fb30b05ff Implement CommonizerIT.test KT-46234 intermediate source set with only one native target to cover KT-46234
^KT-46234
2021-04-21 20:05:06 +00:00
Ilya Kirillov
e2786197ff FIR IDE: support reporting of FirLightSourceElement based diagnostics 2021-04-21 22:22:32 +03:00
Ilya Kirillov
47e8b2f9dc FIR IDE: remove copy-pasted code from DeclarationCopyBuilder 2021-04-21 21:17:00 +03:00
Ilya Kirillov
a76c5d66eb FIR: introduce FirDeclarationBuilder as a base class for all FIR declaration builders 2021-04-21 21:16:58 +03:00
Ilya Kirillov
da6c5e13d5 FIR IDE: add completion support to classes and to type aliases 2021-04-21 21:16:56 +03:00
Ilya Kirillov
a5c33c8d42 FIR IDE: simplify completion context retrieving 2021-04-21 21:16:55 +03:00
Mikhail Zarechenskiy
f8efe3b5df Make function open to overrie it IDE specific part
Namely, this function is overrided in 211 & 212 platforms, see ScriptDefinitionsManager
2021-04-21 20:00:22 +03:00
Dmitry Petrov
5324cbe729 Minor: update tests 2021-04-21 19:10:32 +03:00
Steven Schäfer
8c9ad81c76 Psi2Ir: Fold constants when generating IR
This is necessary to avoid stack overflow errors on large constant
expressions.
2021-04-21 19:10:31 +03:00
Steven Schäfer
e87d816994 Psi2Ir: Remove unused code 2021-04-21 19:10:31 +03:00
Steven Schäfer
d3d4e94cd6 JVM: Fix constant folding for unsigned values 2021-04-21 19:10:31 +03:00
Dmitry Petrov
732405895f Add tests for KT-45308 2021-04-21 17:36:12 +03:00
Dmitry Petrov
f228c3bb04 Add tests for KT-45236 2021-04-21 17:24:41 +03:00
Yahor Berdnikau
4f352950d9 Include Dukat generated sources into generic 'sourcesJar' output.
Gradle 7 complains that "sourcesJar" task uses inputs from Dukat
generate task outputs directory, but this tasks does not have explicit
dependency.

^KT-46006 Fixed
2021-04-21 16:48:16 +03:00
Mikhail Glukhikh
a097a58edf Introduce helper FirExpression.unwrapArgument() in fir:tree 2021-04-21 16:19:09 +03:00
pyos
e6d923f65c FIR: rename HIDDEN to INVISIBLE_REFERENCE
Some of them should be INVISIBLE_MEMBER though
2021-04-21 16:18:21 +03:00
pyos
f1cf6b54e7 FIR2IR: convert some error calls to non-error IR
This allows suppressing "invisible reference"-type errors, which some
people do in production code.
2021-04-21 16:02:01 +03:00
Mikhail Glukhikh
6833e83a6f Minor fix in FirInlineClassDeclarationChecker 2021-04-21 16:01:51 +03:00
Alexander Udalov
7fe10e27a1 Minor, fix failing codegen tests on different JDKs
#KT-46238
2021-04-21 14:43:10 +02:00
Anton Yalyshev
fe5e968896 Add change-notes for 1.5.0 release 2021-04-21 14:13:46 +03:00
Vladimir Dolzhenko
590a8d088d Refine locking to avoid dead lock
#KT-46215 Fixed
2021-04-21 11:01:12 +00:00
Mikhail Glukhikh
6ae4c3f281 Drop state from FirMethodOfAnyImplementedInInterfaceChecker 2021-04-21 13:22:14 +03:00
Mikhail Glukhikh
e0fe122ee9 Drop stored types from FirInlineClassDeclarationChecker 2021-04-21 13:22:13 +03:00
Mikhail Glukhikh
9bc3404833 Drop state from FirInapplicableLateinitChecker 2021-04-21 13:22:11 +03:00
Mikhail Glukhikh
e0c8a6658b FIR: handle annotations on non-containers more precisely 2021-04-21 13:22:10 +03:00
Mikhail Glukhikh
04daf8fce8 FIR: add messages for two accessor diagnostics 2021-04-21 13:22:09 +03:00
Julia
387dafb8c5 [FIR] Introduce AnnotationUsedAsAnnotationArgumentChecker 2021-04-21 13:22:07 +03:00
Alexander Udalov
27ddc31f15 Ignore codegen test using streams on Android 2021-04-21 11:39:08 +02:00
Dmitry Petrov
59de12c609 Minor: mute bytecode text check in some box tests failing in FIR 2021-04-21 11:27:12 +03:00
Dmitry Petrov
f519150c08 JVM_IR KT-46189 lower tailrec functions after local declarations 2021-04-21 11:27:11 +03:00
Sergey Bogolepov
645014092c Add a mention of KT-46231. 2021-04-21 15:14:33 +07:00
Ilya Gorbunov
4ae5efd6da Prevent calling AssertContentEquals with two Set arguments
It's unclear whether these sets are intended to be compared with
the unordered Set equality, or with the ordered Iterable equality.

KT-32996
2021-04-21 03:08:35 +03:00
Alexander Udalov
21e9bd7ea2 Add regression tests for obsolete issues
#KT-9304
 #KT-14961
 #KT-16549
 #KT-21080
 #KT-28234
 #KT-30102
 #KT-31994
 #KT-34291
 #KT-38099
 #KT-41174
 #KT-44622
 #KT-44701
 #KT-44781
 #KT-44849
 #KT-44978
 #KT-45081
 #KT-45286
 #KT-45383
 #KT-45444
 #KT-45907
2021-04-20 21:24:29 +02:00
Ivan Gavrilovic
2666a93e6a [Gradle] Avoid using dependsOn and add output provider to the file collection 2021-04-20 22:13:25 +03:00
Alexander Udalov
e6c089ef40 IR: fix SAM conversion for types with contravariant intersection argument type
In the added test, the problem was that the SAM type as computed by
`SamTypeFactory.createByValueParameter` was `Consumer<{BaseClass &
BaseInterface}>`, which was latter approximated in psi2ir during the
KotlinType->IrType conversion to `Consumer<out Any?>` (here:
3034d9d791/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ArgumentsGenerationUtils.kt (L606)),
because intersection type argument is approximated to `out Any?`.

To avoid this, replace intersection type in immediate arguments of a SAM
type with the common supertype of its components at the same place where
we're getting rid of projections.

 #KT-45945 Fixed
2021-04-20 17:31:14 +02:00
Andrey Zinovyev
ac0af39660 [FIR][LT] Enable parallel execution for LT tests 2021-04-20 18:13:07 +03:00
Andrey Zinovyev
0a811bdd1a [FIR][LT] Don't store lexer in static context 2021-04-20 18:13:06 +03:00
Andrey Zinovyev
5fc1514104 [FIR][LightTree] Better expression identification
And some refactoring
Regenerate IDE parts
2021-04-20 18:13:06 +03:00
Andrey Zinovyev
2f7d6da22f [FIR][LightTree] Generate and fix missing tests
Add TYPE_PARAMETERS_LIST positioning
Use whole branch as source in when branches
2021-04-20 18:13:05 +03:00
Andrey Zinovyev
b9ae22207e [FIR] Fix tests data for diagnostic tests
For tests failed after light tree changes
2021-04-20 18:13:03 +03:00
Andrey Zinovyev
ee48fc320d [FIR][LightTree] Mark fake nodes in FOR loop
+ fix bunch of tests
2021-04-20 18:13:02 +03:00
Andrey Zinovyev
0a68edf3bd [FIR][LightTree] More fixes in diagnostic positioning
Keep tree padding for modifiers
More REFERENCE_EXPRESSIONS kinds
Fix source for some call expressions
2021-04-20 18:13:01 +03:00
Andrey Zinovyev
f3dc8dfb21 [FIR][LightTree] Use same fake elements kinds as in psi
Otherwise type resolution(!) for empty lambda works differently
2021-04-20 18:13:00 +03:00
Andrey Zinovyev
e8e9f67069 [FIR][LightTree] Enum and property source fixes
Also set dispatchReceiverType for properties from value params
2021-04-20 18:12:59 +03:00
Andrey Zinovyev
1fb8c3b1d7 [FIR][LightTree] Properly unwrap function inside parentheses 2021-04-20 18:12:58 +03:00
Andrey Zinovyev
05f0507cbb [FIR][LightTree] Proper source for enum constructor call 2021-04-20 18:12:57 +03:00
Andrey Zinovyev
bed45affe1 [FIR][LightTree] Don't report diagnostics on some nameless declarations 2021-04-20 18:12:56 +03:00
Andrey Zinovyev
684c4c2825 [FIR][LightTree] Don't position on trailing comments 2021-04-20 18:12:55 +03:00
Andrey Zinovyev
0d99b01dcb [FIR][LightTree] Pass source elements in FOR loop parts 2021-04-20 18:12:54 +03:00
Andrey Zinovyev
8bbdc20809 [FIR][LightTree] Pass source elements in when conditions 2021-04-20 18:12:54 +03:00
Andrey Zinovyev
9c8e92f5af [FIR][LightTree] Fix DEFAULT positioning strategy for object literals 2021-04-20 18:12:53 +03:00
Andrey Zinovyev
70f9b77cce [FIR][LightTree] Keep source in FOR loop elements 2021-04-20 18:12:52 +03:00
Andrey Zinovyev
27766c2575 [FIR] Consistent isLocal for objects inside Enum entries 2021-04-20 18:12:51 +03:00
Andrey Zinovyev
7084fec651 [FIR][LightTree] Position strategies fixes
Skip leading comments in DEFAULT strategy
Keep node offset 'padding' when getting child
2021-04-20 18:12:50 +03:00
Andrey Zinovyev
8ea3b52454 [FIR][LightTree] Fix finding error nodes in tree
When there are links to to 'upper levels' lt elements in fir tree
2021-04-20 18:12:49 +03:00
Andrey Zinovyev
dc19e39dd2 [FIR][LightTree] Properly locate return keyword 2021-04-20 18:12:47 +03:00
Andrey Zinovyev
088db0e138 [FIR] Report SEALED_CLASS_CONSTRUCTOR_CALL on expression 2021-04-20 18:12:46 +03:00
Andrey Zinovyev
48994976d4 [FIR][LightTree] Skip comments and whitespaces when marking elements 2021-04-20 18:12:45 +03:00
Andrey Zinovyev
dcbb1fb22b [FIR][LightTree] Extract syntax errors from subtrees 2021-04-20 18:12:45 +03:00
Andrey Zinovyev
7dedd04ed9 [FIR] Add SYNTAX diagnostics for light tree 2021-04-20 18:12:43 +03:00
Dmitriy Novozhilov
3e0eb06e3e [FIR] Add FirOldFrontendDiagnosticsWithLightTreeTestGenerated 2021-04-20 18:12:42 +03:00
Igor Yakovlev
e4870740e1 [LC] Fixed light classes nullability for Kotlin 1.5
Fixed #KT-44472
2021-04-20 15:21:12 +02:00
Igor Yakovlev
63160293fb [LC] Fix invalid nullability for properties
Fixed #KT-46097 and #KT-41671
2021-04-20 15:21:12 +02:00
Andrey Zinovyev
8071a1e246 [KAPT] Keep constant references in annotations with array values
#KT-29929 Fixed
2021-04-20 15:47:03 +03:00
Yahor Berdnikau
9e9450caa2 Fix adding associated compilation for Kotlin Native.
Kotlin native does not support 'compileOnly' or 'runtimeOnly'
configurations. In this case associated compilations are added as
'implementation'.

^KT-45911 Fixed
2021-04-20 10:15:15 +02:00
Abduqodiri Qurbonzoda
57c4f79c1c Update Char.digitToInt documentation 2021-04-20 04:36:05 +03:00
Ilya Kirillov
26e39b3d2a FIR IDE: do not resolve all members for getting inner classes for light classes 2021-04-20 01:32:26 +03:00
Ilya Kirillov
051310124b FIR IDE: do not fail duplicating classes with members 2021-04-20 01:32:25 +03:00
Mark Punzalan
73b796f184 FIR IDE: Enable RemoveExclExclCallFix for UNNECESSARY_NON_NULL_ASSERTION. 2021-04-19 22:29:07 +02:00
Mark Punzalan
34609b264d FIR IDE: Move RemoveExclExclCallFix to idea-frontend-independent. 2021-04-19 22:29:07 +02:00
Alexander Udalov
4fffed4165 Improve test on equals/hashCode for KProperty accessors
Remove duplication & unnecessary checks, check equality in both
directions, check hashCode, add more cases, rename variables for
clarity.

 #KT-13490
2021-04-19 20:39:54 +02:00
Xin Wang
c959b271a4 Override "hashCode" and "equals" for Getter and Setter to fix KT-13490 2021-04-19 20:39:54 +02:00
Dmitry Petrov
46d5e974df JVM_IR KT-46160 don't use LambdaMetafactory for mutifile class members 2021-04-19 19:32:34 +03:00
yantimirov-timur
1dfc3c0520 FIR: add getter visibility and setter return type checks 2021-04-19 19:21:09 +03:00
Abduqodiri Qurbonzoda
eedc4d8c3f [K/N] Fix measureTimeMillis and measureNanoTime doc 2021-04-19 19:14:34 +03:00
Abduqodiri Qurbonzoda
aa04f60df4 [K/N] Fix Floating.toInt/toLong doc 2021-04-19 19:14:33 +03:00
Abduqodiri Qurbonzoda
4c66c1c137 [K/N] Fix Primitive.shl/shr/ushr doc 2021-04-19 19:14:32 +03:00
Abduqodiri Qurbonzoda
19ecb78531 [K/N] Fix Primitive.rem doc 2021-04-19 19:14:30 +03:00
Abduqodiri Qurbonzoda
2cfbad9477 [K/N] Fix Primitive.div doc 2021-04-19 19:14:29 +03:00
Abduqodiri Qurbonzoda
b5e3dc414f Fix Array.iterator doc 2021-04-19 19:14:28 +03:00
Abduqodiri Qurbonzoda
8a1855e4da [K/N] Fix Range.isEmpty doc 2021-04-19 19:14:27 +03:00
Abduqodiri Qurbonzoda
71c5c8b20a Fix Range.isEmpty doc 2021-04-19 19:14:25 +03:00
Abduqodiri Qurbonzoda
fb4ddd2f6e [K/N] Fix StringBuilder.deleteRange doc 2021-04-19 19:14:23 +03:00
Abduqodiri Qurbonzoda
76b297fd73 [K/N] Fix StringBuilder.clear doc 2021-04-19 19:14:21 +03:00
Abduqodiri Qurbonzoda
597b18582a [K/N] Fix Char.isISOControl doc 2021-04-19 19:14:19 +03:00
Abduqodiri Qurbonzoda
bb2a50a4eb Fix Char.isISOControl doc 2021-04-19 19:14:17 +03:00
Abduqodiri Qurbonzoda
d1f18c4651 Add @see doc references to java isUpperCase and isLowerCase 2021-04-19 19:14:14 +03:00
Abduqodiri Qurbonzoda
22dcc92951 Fix Char.isTitleCase doc 2021-04-19 19:14:13 +03:00
Abduqodiri Qurbonzoda
e83ceb9d40 [K/N] Fix String.replace doc 2021-04-19 19:14:11 +03:00
Abduqodiri Qurbonzoda
36aee8f2b4 Fix String.replace doc 2021-04-19 19:14:10 +03:00
Abduqodiri Qurbonzoda
dab09e7052 Fix CharSequence.repeat doc 2021-04-19 19:14:08 +03:00
Ilya Goncharov
c73dadbcdf [Gradle, JS] Install dukat only if there is dependency with generateExternals
^KT-46178 fixed
2021-04-19 17:29:51 +03:00
pyos
dab693b075 Revert "JVM IR: Implement CHECK_NOT_NULL as a lowering"
This reverts commit dcd72b06d8.

Using a temporary variable has an effect on casts and GC.
2021-04-19 16:05:12 +02:00
Ilmir Usmanov
f5379c5a04 Add @JvmInline annotation in common code if JVM target is present
#KTIJ-8863 Fixed
 #KT-46088 Fixed
2021-04-19 16:56:31 +03:00
Ivan Kochurkin
00bc04b3df [FIR] Implement ELSE_MISPLACED_IN_WHEN diagnostics, fix tests 2021-04-19 15:46:38 +03:00
Dmitry Petrov
7f4da93cc3 JVM_IR KT-45998 protected companion object member accessors with indy 2021-04-19 15:41:21 +03:00
Dmitry Petrov
9a4a39e680 JVM_IR KT-45998 fix protected companion object member accessors
Also, make sure it works with indy-based SAM conversions.
2021-04-19 15:41:19 +03:00
Mikhail Glukhikh
b1fb0ba9e1 Fix FirDiagnosticsList (remove earlier dropped FirSourceElements) 2021-04-19 15:29:07 +03:00
Mikhail Glukhikh
8a2cab346a Fix FIR IDE tests (EXPRESSION_EXPECTED, ITERATOR_MISSING, etc.) 2021-04-19 15:11:17 +03:00
Tianyu Geng
b5caa658d6 FIR: introduce delegate diagnostics
This commit adds diagnostics for the following

* DELEGATE_SPECIAL_FUNCTION_MISSING
* DELEGATE_SPECIAL_FUNCTION_AMBIGUITY
* DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE
2021-04-19 15:11:16 +03:00
Tianyu Geng
454ae3b17a FIR checker: report UNSAFE_CALL for overloaded function calls
Previously if an unsafe call is to an overloaded function, FIR checkers
report NONE_APPLICABLE. This change instead report them as UNSAFE_CALL
or its variants.
2021-04-19 15:11:13 +03:00
Mikhail Glukhikh
92df1f575a Fir2IrVisitor: simplify creating for-loop blocks due to changed FIR side 2021-04-19 15:11:13 +03:00
Tianyu Geng
6a03f31e50 FIR: add UnsafeCall resolution diagnostics
Previously unsafe call is reported as part of InapplicableWrongReceiver.
This makes it difficult for the downstream checkers to report different
diagnostics.
2021-04-19 15:11:13 +03:00
Mikhail Glukhikh
43a2ad0467 FIR: don't flatten for loop blocks in raw FIR builder 2021-04-19 15:11:12 +03:00
Mikhail Glukhikh
a736d62edd FirForLoopChecker: report also OPERATOR_MODIFIER if appropriate + minor
This commits checks iterator/hasNext/next functions whether they are
declared as operator or not. Also, it changes logic of hasNext/next
error reporting, now we're able to report errors about both these
functions.
2021-04-19 15:11:10 +03:00
Mikhail Glukhikh
2e14b65644 Introduce FirForLoopChecker 2021-04-19 15:10:58 +03:00
Mikhail Glukhikh
4ddc0ed3fe FIR: introduce block checkers 2021-04-19 15:10:39 +03:00
Mikhail Glukhikh
eb831b9afc FIR: support separate ANONYMOUS_FUNCTION_WITH_NAME 2021-04-19 15:10:38 +03:00
Mikhail Glukhikh
6b95bcdbdb FIR: support separate ASSIGNMENT_IN_EXPRESSION_CONTEXT 2021-04-19 15:10:18 +03:00
Mikhail Glukhikh
9894b97058 FIR: rename EXPRESSION_REQUIRED to EXPRESSION_EXPECTED 2021-04-19 15:09:50 +03:00
Ilya Kirillov
26ea0be635 FIR IDE: temporary update testdata until diagnostic collection for delegated objects is fixed 2021-04-19 13:52:47 +02:00
Ilya Kirillov
f40f506852 FIR: move components from AbstractDiagnosticCollectorVisitor to CheckerRunningDiagnosticCollectorVisitor 2021-04-19 13:52:46 +02:00
Ilya Kirillov
ea233cddf8 FIR: rename goToNestedDeclarations -> visitNestedElements 2021-04-19 13:52:46 +02:00
Ilya Kirillov
eed143d17b FIR: remove beforeRunningAllComponentsOnElement/beforeRunningSingleComponentOnElement from AbstractDiagnosticCollectorVisitor 2021-04-19 13:52:45 +02:00
Ilya Kirillov
41e822e8cb FIR IDE: fix duplicated diagnostic collection 2021-04-19 13:52:44 +02:00
Ilya Kirillov
5829f1a6e7 FIR IDE: add more test cases to TraversalCounterTestGenerated 2021-04-19 13:52:43 +02:00
Ilya Kirillov
e78e8f8c79 FIR IDE: fix behaviour of DiagnosticTraversalCounterTest 2021-04-19 13:52:43 +02:00
Ilya Kirillov
32c1101959 FIR IDE: introduce tests for checking diagnostic visitor context collection 2021-04-19 13:52:42 +02:00
Ilya Kirillov
ac993754e1 FIR IDE: collect diagnostics context under read lock 2021-04-19 13:52:41 +02:00
Ilya Kirillov
ce62348709 FIR IDE: do not report suppressed diagnostics 2021-04-19 13:52:41 +02:00
Ilya Kirillov
fd082b1574 FIR IDE: get rid of DiagnosticCollectorDeclarationAction 2021-04-19 13:52:40 +02:00
Ilya Kirillov
e79c133331 FIR IDE: separate diagnostics collection and checker context collection 2021-04-19 13:52:39 +02:00
Ilya Kirillov
29a0c448a6 FIR IDE: remove FirIdeFileDiagnosticsCollector as unused 2021-04-19 13:52:38 +02:00
Ilya Kirillov
023f4e9f46 FIR: extract DiagnosticCollectingVisitor to separate file 2021-04-19 13:52:38 +02:00
Ilya Kirillov
f9d415eda6 FIR: make AbstractDiagnosticCollector.Visitor non-inner 2021-04-19 13:52:37 +02:00
Ilya Kirillov
284e828cd6 FIR: extract context related functions from AbstractDiagnosticCollector.Visitor to super class 2021-04-19 13:52:36 +02:00
Dmitriy Novozhilov
e3b5cc491d [Test] Throw exception from compiler at a first place 2021-04-19 14:32:37 +03:00
Dmitriy Novozhilov
7fb2bf00c5 Force resolve annotations in annotation checker
#KT-46173 Fixed
2021-04-19 14:32:36 +03:00
Dmitriy Novozhilov
83bae89ed8 [Test] Show diff between fir file and testdata text if FE 1.0 and FIR test files don't match 2021-04-19 14:32:35 +03:00
Ivan Kochurkin
4353365968 [FIR] Implement NULL_FOR_NONNULL_TYPE diagnostics, fix tests 2021-04-19 12:46:08 +03:00
sebastian.sellmair
9336e4b09b HierarchicalKotlinNativePlatformDependencies: Provide platform dependencies to source sets not participating in any commonization
^KT-46142 Verification Pending
2021-04-17 14:58:15 +00:00
Aleksei.Cherepanov
b5ef6c9316 Add tests for SAM conversions
Add tests for KT-45191 [JPS] Marking method as "default" in Java SAM interface doesn't affect dependencies, which was fixed in intlellij(212): cbad0d91 support kotlin-generated lambda usage

#KT-45191 Fixed
2021-04-17 03:36:17 +03:00
Andrei Klunnyi
81a5ae7780 KT-44431 Quickfix to move to sealed: suggests tests source root
From now on we display the source root matching the target directory.

^KT-44431 Fixed
2021-04-16 19:38:52 +02:00
Andrei Klunnyi
eed4cb4f00 KT-44431 Quickfix to move to sealed: refactoring
Sealed super class directory is now calculated in a more
straightforward way.
2021-04-16 19:38:52 +02:00
Abduqodiri Qurbonzoda
3a8d1c4b5e Remove redundant @OptIn 2021-04-16 19:01:28 +03:00
Abduqodiri Qurbonzoda
f253b1fb15 Incorrect description for JVM toUpperCase method #KT-45884 2021-04-16 19:01:09 +03:00
Ilmir Usmanov
7b14975740 Add 'value' modifier to modifier order
Otherwise, there will be unfixable 'non-canonical modifier order'
warning
 #KT-46088
 #KTIJ-5636 Fixed
2021-04-16 18:51:44 +03:00
sebastian.sellmair
7525d9a1ce KotlinNativeTest: Append stdOut and stdErr to failure message 2021-04-16 14:56:33 +00:00
sebastian.sellmair
05a6d89151 [Minor] Re-format :kotlin-klib-commonizer and :kotlin-klib-commonizer-api 2021-04-16 14:56:32 +00:00
sebastian.sellmair
f893709e5b [Commonizer] CommonizeLibcurlTest: Add commonizeSuccessfully with unsupported targets
This test will assert behaviour on 'unsupported' targets requested from the commonizer

^KT-46077
2021-04-16 14:56:31 +00:00
sebastian.sellmair
bbcfde7231 [Commonizer] Add 'commonizer_target' and 'commonizer_native_targets' to commonized klib's manifest
^KT-46077 Fixed
2021-04-16 14:56:31 +00:00
Alexander Likhachev
6f96c225d7 [Gradle, K/N] Prefer injection over lateinit vars for task configuration
#KT-45801 Fixed
2021-04-16 17:39:53 +03:00
Dmitriy Novozhilov
b530427bb2 Fix substitution of generic types in contracts
#KT-41078 Fixed
2021-04-16 17:23:24 +03:00
Dmitriy Novozhilov
91fedd6a12 [FIR] Substitute types from arguments in evaluating of contract
#KT-41078
2021-04-16 17:23:22 +03:00
Anton Lakotka
80f95528c2 [MPP] Always use native plugin artifact for native compilations
#KT-46122 Fixed
2021-04-16 16:25:06 +03:00
Anton Lakotka
d75d42da9d [MPP] Test that native common compilation uses native plugin artifacts
#KT-46122 In Progress
2021-04-16 16:25:04 +03:00
Dmitriy Novozhilov
c65553bb8a [FIR] Get rid of source element type parameter from diagnostic factories 2021-04-16 14:08:11 +03:00
Dmitriy Novozhilov
4133f38c8c [FIR] Transform annotations of property receiver type 2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
564de2790f [FIR] Resolve array literals in independent context 2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
cc0f28b698 [FIR] Store type of function call and qualified access from error reference 2021-04-16 11:12:56 +03:00
Dmitriy Novozhilov
e869f8091a [FIR] Properly handle callable references which were resolved with error 2021-04-16 11:12:55 +03:00
Dmitriy Novozhilov
450fb5e915 [Test] Add handler to detect implicit types which were left in resolved FIR 2021-04-16 10:52:58 +03:00
Ilya Gorbunov
ce7092a638 More efficient Char(Int) in common, JS, and JS-IR 2021-04-16 03:58:34 +03:00
Ilya Gorbunov
8041c3aa1d Support Char.code in constant evaluator, KT-46036
But do not consider Char.code a pure integer constant.
2021-04-16 03:58:34 +03:00
Alexander Udalov
0a446230f7 Reorder LanguageFeature entries according to sinceVersion 2021-04-15 21:41:17 +02:00
1724 changed files with 64580 additions and 9676 deletions

View File

@@ -192,7 +192,7 @@ extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
extra["versions.ktor-network"] = "1.0.1"
if (!project.hasProperty("versions.kotlin-native")) {
extra["versions.kotlin-native"] = "1.5.20-dev-4865"
extra["versions.kotlin-native"] = "1.5.20-dev-5613"
}
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
@@ -368,7 +368,8 @@ val gradlePluginProjects = listOf(
":kotlin-annotation-processing-gradle",
":kotlin-noarg",
":kotlin-sam-with-receiver",
":kotlin-parcelize-compiler"
":kotlin-parcelize-compiler",
":kotlin-lombok"
)
apply {
@@ -577,26 +578,6 @@ allprojects {
}
}
if ((gradle.startParameter as? org.gradle.api.internal.StartParameterInternal)?.isConfigurationCache != true) {
// TODO: remove it once Gradle is bumped to 6.8:
// See https://docs.gradle.org/6.8/release-notes.html#more-cache-hits-when-empty-directories-are-present
gradle.buildFinished {
val taskGraph = gradle?.taskGraph
if (taskGraph != null) {
taskGraph.allTasks
.filterIsInstance<SourceTask>()
.filter { it.didWork }
.forEach {
it.source.visit {
if (file.isDirectory && file.listFiles()?.isEmpty() == true) {
logger.warn("Empty source directories may cause build cache misses: " + file.absolutePath)
}
}
}
}
}
}
gradle.taskGraph.whenReady {
fun Boolean.toOnOff(): String = if (this) "on" else "off"
val profile = if (isTeamcityBuild) "CI" else "Local"

View File

@@ -5,6 +5,7 @@
package plugins
import PublishToMavenLocalSerializable
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.attributes.Usage
@@ -13,10 +14,10 @@ import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.publish.maven.tasks.PublishToMavenLocal
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.Sign
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
import java.util.*
@@ -27,7 +28,6 @@ class KotlinBuildPublishingPlugin @Inject constructor(
) : Plugin<Project> {
override fun apply(target: Project): Unit = with(target) {
apply<MavenPublishPlugin>()
apply<SigningPlugin>()
val publishedRuntime = configurations.maybeCreate(RUNTIME_CONFIGURATION).apply {
isCanBeConsumed = false
@@ -132,32 +132,40 @@ fun Project.configureDefaultPublishing() {
}
}
configureSigning()
val signingRequired = project.providers.gradleProperty("signingRequired").forUseAtConfigurationTime().orNull?.toBoolean()
?: project.providers.gradleProperty("isSonatypeRelease").forUseAtConfigurationTime().orNull?.toBoolean() ?: false
if (signingRequired) {
apply<SigningPlugin>()
configureSigning()
}
tasks.register("install") {
dependsOn(tasks.named("publishToMavenLocal"))
}
// workaround for Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
tasks.withType(PublishToMavenLocal::class.java) {
val originalTask = this
val serializablePublishTask =
tasks.register(originalTask.name + "Serializable", PublishToMavenLocalSerializable::class.java) {
publication = originalTask.publication
}
originalTask.onlyIf { false }
originalTask.dependsOn(serializablePublishTask)
}
tasks.withType<PublishToMavenRepository>()
.matching { it.name.endsWith("PublicationTo${KotlinBuildPublishingPlugin.REPOSITORY_NAME}Repository") }
.all { configureRepository() }
}
private fun Project.configureSigning() {
val signingRequired = provider {
project.findProperty("signingRequired")?.toString()?.toBoolean()
?: project.property("isSonatypeRelease") as Boolean
}
configure<SigningExtension> {
setRequired(signingRequired)
sign(extensions.getByType<PublishingExtension>().publications) // all publications
useGpgCmd()
}
tasks.withType<Sign>().configureEach {
setOnlyIf { signingRequired.get() }
}
}
fun TaskProvider<PublishToMavenRepository>.configureRepository() =
@@ -181,4 +189,4 @@ private fun PublishToMavenRepository.configureRepository() {
}
}
}
}
}

View File

@@ -7,13 +7,22 @@
// usages in build scripts are not tracked properly
@file:Suppress("unused")
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.artifacts.ProjectDependency
import org.gradle.api.file.FileSystemOperations
import org.gradle.api.internal.tasks.testing.filter.DefaultTestFilter
import org.gradle.api.publish.internal.PublishOperation
import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal
import org.gradle.api.publish.maven.internal.publisher.MavenNormalizedPublication
import org.gradle.api.publish.maven.internal.publisher.MavenPublisher
import org.gradle.api.publish.maven.internal.publisher.ValidatingMavenPublisher
import org.gradle.api.publish.maven.tasks.AbstractPublishToMaven
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.testing.Test
import org.gradle.internal.serialization.Cached
import org.gradle.kotlin.dsl.extra
import org.gradle.kotlin.dsl.project
import org.gradle.kotlin.dsl.support.serviceOf
@@ -38,6 +47,7 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
":kotlin-compiler-runner",
":kotlin-daemon-embeddable",
":kotlin-daemon-client",
":kotlin-project-model",
":kotlin-gradle-plugin-api",
":kotlin-gradle-plugin",
":kotlin-gradle-plugin-model",
@@ -279,3 +289,30 @@ fun Task.useAndroidSdk() {
fun Task.useAndroidJar() {
TaskUtils.useAndroidJar(this)
}
// Workaround to make PublishToMavenLocal compatible with Gradle configuration cache
// TODO: remove it when https://github.com/gradle/gradle/pull/16945 merged into used in build Gradle version
abstract class PublishToMavenLocalSerializable : AbstractPublishToMaven() {
private val normalizedPublication = Cached.of { this.computeNormalizedPublication() }
private fun computeNormalizedPublication(): MavenNormalizedPublication {
val publicationInternal: MavenPublicationInternal = publicationInternal
?: throw InvalidUserDataException("The 'publication' property is required")
duplicatePublicationTracker.checkCanPublishToMavenLocal(publicationInternal)
return publicationInternal.asNormalisedPublication()
}
@TaskAction
open fun publish() {
val normalizedPublication = normalizedPublication.get()
object : PublishOperation(normalizedPublication.name, "mavenLocal") {
override fun publish() {
val localPublisher = mavenPublishers.getLocalPublisher(
temporaryDirFactory
)
val validatingPublisher: MavenPublisher = ValidatingMavenPublisher(localPublisher)
validatingPublisher.publish(normalizedPublication, null)
}
}.run()
}
}

View File

@@ -87,4 +87,4 @@ open class SamTypeFactory {
companion object {
val INSTANCE = SamTypeFactory()
}
}
}

View File

@@ -158,7 +158,14 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
for (int i = 0; i < superInterfaceTypes.size(); i++) {
KotlinType superInterfaceType = superInterfaceTypes.get(i);
sw.writeInterface();
superInterfaceAsmTypes[i] = typeMapper.mapSupertype(superInterfaceType, sw).getInternalName();
Type superInterfaceAsmType;
if (samType != null && superInterfaceType.getConstructor() == samType.getType().getConstructor()) {
superInterfaceAsmType = typeMapper.mapSupertype(superInterfaceType, null);
sw.writeAsmType(superInterfaceAsmType);
} else {
superInterfaceAsmType = typeMapper.mapSupertype(superInterfaceType, sw);
}
superInterfaceAsmTypes[i] = superInterfaceAsmType.getInternalName();
sw.writeInterfaceEnd();
}

View File

@@ -39,7 +39,7 @@ class RedundantBoxingMethodTransformer(private val generationState: GenerationSt
override fun transform(internalClassName: String, node: MethodNode) {
val interpreter = RedundantBoxingInterpreter(node.instructions, generationState)
val frames = MethodTransformer.analyze(internalClassName, node, interpreter)
val frames = analyze(internalClassName, node, interpreter)
interpretPopInstructionsForBoxedValues(interpreter, node, frames)
@@ -168,7 +168,8 @@ class RedundantBoxingMethodTransformer(private val generationState: GenerationSt
val frame = frames[i] ?: continue
val insn = insnList[i]
if ((insn.opcode == Opcodes.ASTORE || insn.opcode == Opcodes.ALOAD) &&
(insn as VarInsnNode).`var` == localVariableNode.index) {
(insn as VarInsnNode).`var` == localVariableNode.index
) {
if (insn.getOpcode() == Opcodes.ASTORE) {
values.add(frame.top()!!)
} else {

View File

@@ -87,11 +87,6 @@ fun CallableMemberDescriptor.createTypeParameterWithNewName(
return newDescriptor
}
fun KotlinType.removeExternalProjections(): KotlinType {
val newArguments = arguments.map { TypeProjectionImpl(Variance.INVARIANT, it.type) }
return replace(newArguments)
}
fun isInlineClassConstructorAccessor(descriptor: FunctionDescriptor): Boolean =
descriptor is AccessorForConstructorDescriptor &&
descriptor.calleeDescriptor.constructedClass.isInlineClass()

View File

@@ -33,13 +33,11 @@ import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.extensions.ExtensionsArea
import com.intellij.openapi.fileTypes.PlainTextFileType
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.LanguageLevelProjectExtension
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.util.text.StringUtil
import com.intellij.openapi.vfs.*
import com.intellij.openapi.vfs.impl.ZipHandler
import com.intellij.pom.java.LanguageLevel
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.PsiManager
import com.intellij.psi.impl.JavaClassSupersImpl
@@ -94,6 +92,7 @@ import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
import org.jetbrains.kotlin.resolve.ModuleAnnotationsResolver
import org.jetbrains.kotlin.resolve.extensions.ExtraImportsProviderExtension
import org.jetbrains.kotlin.resolve.jvm.extensions.SyntheticJavaResolveExtension
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade
import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension
@@ -577,6 +576,7 @@ class KotlinCoreEnvironment private constructor(
fun registerPluginExtensionPoints(project: MockProject) {
ExpressionCodegenExtension.registerExtensionPoint(project)
SyntheticResolveExtension.registerExtensionPoint(project)
SyntheticJavaResolveExtension.registerExtensionPoint(project)
ClassBuilderInterceptorExtension.registerExtensionPoint(project)
AnalysisHandlerExtension.registerExtensionPoint(project)
PackageFragmentProviderExtension.registerExtensionPoint(project)

View File

@@ -96,6 +96,7 @@ import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.CodeAnalyzerInitializer
import org.jetbrains.kotlin.resolve.ModuleAnnotationsResolver
import org.jetbrains.kotlin.resolve.extensions.ExtraImportsProviderExtension
import org.jetbrains.kotlin.resolve.jvm.extensions.SyntheticJavaResolveExtension
import org.jetbrains.kotlin.resolve.extensions.SyntheticResolveExtension
import org.jetbrains.kotlin.resolve.jvm.KotlinJavaPsiFacade
import org.jetbrains.kotlin.resolve.jvm.extensions.AnalysisHandlerExtension
@@ -569,6 +570,7 @@ class KotlinCoreEnvironment private constructor(
fun registerPluginExtensionPoints(project: MockProject) {
ExpressionCodegenExtension.registerExtensionPoint(project)
SyntheticResolveExtension.registerExtensionPoint(project)
SyntheticJavaResolveExtension.registerExtensionPoint(project)
ClassBuilderInterceptorExtension.registerExtensionPoint(project)
AnalysisHandlerExtension.registerExtensionPoint(project)
PackageFragmentProviderExtension.registerExtensionPoint(project)

View File

@@ -37,8 +37,7 @@ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
import org.jetbrains.kotlin.cli.common.checkKotlinPackageUsage
import org.jetbrains.kotlin.cli.common.config.addKotlinSourceRoot
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.OUTPUT
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.WARNING
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.*
import org.jetbrains.kotlin.cli.common.messages.MessageCollector
import org.jetbrains.kotlin.cli.common.messages.OutputMessageUtil
import org.jetbrains.kotlin.cli.common.output.writeAll
@@ -305,6 +304,11 @@ object KotlinToJVMBytecodeCompiler {
val project = environment.project
val performanceManager = environment.configuration.get(CLIConfigurationKeys.PERF_MANAGER)
environment.messageCollector.report(
STRONG_WARNING,
"ATTENTION!\n This build uses in-dev FIR: \n -Xuse-fir"
)
PsiElementFinder.EP.getPoint(project).unregisterExtension(JavaElementFinder::class.java)
val projectConfiguration = environment.configuration

View File

@@ -367,8 +367,14 @@ object KotlinCompilerClient {
}
private fun startDaemon(compilerId: CompilerId, daemonJVMOptions: DaemonJVMOptions, daemonOptions: DaemonOptions, reportingTargets: DaemonReportingTargets): Boolean {
val javaExecutable = File(File(CompilerSystemProperties.JAVA_HOME.safeValue, "bin"), "java")
private fun startDaemon(
compilerId: CompilerId,
daemonJVMOptions: DaemonJVMOptions,
daemonOptions: DaemonOptions,
reportingTargets: DaemonReportingTargets
): Boolean {
val daemonJavaExecutable = compilerId.javaExecutable
?: File(File(CompilerSystemProperties.JAVA_HOME.safeValue, "bin"), "java")
val serverHostname = CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.value ?: error("${CompilerSystemProperties.JAVA_RMI_SERVER_HOSTNAME.property} is not set!")
val platformSpecificOptions = listOf(
// hide daemon window
@@ -380,7 +386,7 @@ object KotlinCompilerClient {
listOf("--illegal-access=permit")
else emptyList()
val args = listOf(
javaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) +
daemonJavaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)) +
platformSpecificOptions +
daemonJVMOptions.mappers.flatMap { it.toArgs("-") } +
javaIllegalAccessWorkaround +

View File

@@ -49,7 +49,7 @@ suspend fun walkDaemonsAsync(
useRMI: Boolean = true,
useSockets: Boolean = true
): List<DaemonWithMetadataAsync> { // TODO: replace with Deferred<List<DaemonWithMetadataAsync>> and use mapNotNullAsync to speed this up
val classPathDigest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString()
val classPathDigest = compilerId.digest()
val portExtractor = makePortFromRunFilenameExtractor(classPathDigest)
return registryDir.walk().toList() // list, since walk returns Sequence and Sequence.map{...} is not inline => coroutines dont work
.map { Pair(it, portExtractor(it.name)) }

View File

@@ -217,7 +217,7 @@ class CompileServiceRMIWrapper(val server: CompileServiceServerSide, daemonOptio
runFileDir,
makeRunFilenameString(
timestamp = "%tFT%<tH-%<tM-%<tS.%<tLZ".format(Calendar.getInstance(TimeZone.getTimeZone("Z"))),
digest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString(),
digest = compilerId.digest(),
port = port.toString()
)
)

View File

@@ -55,7 +55,7 @@ fun walkDaemons(registryDir: File,
filter: (File, Int) -> Boolean = { _, _ -> true },
report: (DaemonReportCategory, String) -> Unit = { _, _ -> }
): Sequence<DaemonWithMetadata> {
val classPathDigest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString()
val classPathDigest = compilerId.digest()
val portExtractor = makePortFromRunFilenameExtractor(classPathDigest)
return registryDir.walk()
.map { Pair(it, portExtractor(it.name)) }

View File

@@ -231,12 +231,38 @@ fun ByteArray.toHexString(): String = joinToString("", transform = { "%02x".form
data class CompilerId(
var compilerClasspath: List<String> = listOf(),
var compilerVersion: String = ""
var compilerVersion: String = "",
var javaExecutable: File? = null
) : OptionsGroup {
override val mappers: List<PropMapper<*, *, *>>
get() = listOf(PropMapper(this, CompilerId::compilerClasspath, toString = { it.joinToString(File.pathSeparator) }, fromString = { it.trimQuotes().split(File.pathSeparator) }),
StringPropMapper(this, CompilerId::compilerVersion))
get() = listOf(
PropMapper(
dest = this,
prop = CompilerId::compilerClasspath,
toString = { it.joinToString(File.pathSeparator) },
fromString = { it.trimQuotes().split(File.pathSeparator) }
),
StringPropMapper(
dest = this,
prop = CompilerId::compilerVersion
),
PropMapper(
dest = this,
prop = CompilerId::javaExecutable,
toString = { it?.absolutePath },
fromString = { File(it.trimQuotes()) },
skipIf = { it == null }
)
)
fun digest(): String = compilerClasspath
.map { File(it).absolutePath }
.run {
javaExecutable?.let { plus(it.absolutePath) } ?: this
}
.distinctStringsDigest()
.toHexString()
companion object {
@JvmStatic
@@ -245,6 +271,15 @@ data class CompilerId(
@JvmStatic
fun makeCompilerId(paths: Iterable<File>): CompilerId =
CompilerId(compilerClasspath = paths.map { it.absolutePath })
@JvmStatic
fun makeCompilerId(
paths: Iterable<File>,
javaExecutable: File
): CompilerId = CompilerId(
compilerClasspath = paths.map { it.absolutePath },
javaExecutable = javaExecutable
)
}
}

View File

@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.daemon
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.io.FileUtilRt
import junit.framework.TestCase
@@ -277,6 +278,129 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
}
}
private fun getJdk8Location() = System.getenv("JDK_18") ?: System.getenv("JAVA_HOME")
fun testNewDaemonIsNotStartedForSameJavaExecutable() {
withFlagFile(getTestName(true), "-client1.alive") { flagFile1 ->
withFlagFile(getTestName(true), "-client2.alive") { flagFile2 ->
val daemonOptions = makeTestDaemonOptions(getTestName(true))
val compilerIdJdk8 = CompilerId.makeCompilerId(
compilerClassPath +
File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler-sources.jar"),
File(getJdk8Location()).resolve("bin/java")
)
withLogFile("kotlin-daemon-test-1") { logFile ->
val daemonJVMOptions = makeTestDaemonJvmOptions(logFile)
assertTrue(logFile.length() == 0L)
val daemon1 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk8,
flagFile1,
daemonJVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemon1)
logFile.assertLogContainsSequence("INFO: starting daemon")
val daemon2 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk8,
flagFile2,
daemonJVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemon2)
val logContent = logFile.readText().lines()
assert(
logContent.filter { it.contains("INFO: starting daemon") }.size == 1
) {
"Second daemon instance was started!"
}
assert(
logContent.filter {
it.contains("INFO: Registered a client alive file: ${flagFile2.absolutePath}")
}.size == 1
) {
"Second client was not connected to the same instance!"
}
KotlinCompilerClient.shutdownCompileService(compilerIdJdk8, daemonOptions)
Thread.sleep(100)
logFile.assertLogContainsSequence("Shutdown started")
}
}
}
}
// Ignored on Windows OS due to https://bugs.openjdk.java.net/browse/JDK-8189953 bug in JDK 9
// Should be unignored once JDK10+ will be available by default on CI agents
fun testNewDaemonIsStartedOnJavaExecutableChange() {
if (SystemInfo.isWindows) return
withFlagFile(getTestName(true), "-client1.alive") { flagFile1 ->
withFlagFile(getTestName(true), "-client2.alive") { flagFile2 ->
val daemonOptions = makeTestDaemonOptions(getTestName(true))
val compilerIdJdk8 = CompilerId.makeCompilerId(
compilerClassPath +
File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler-sources.jar"),
File(getJdk8Location()).resolve("bin/java")
)
val compilerIdJdk9 = CompilerId.makeCompilerId(
compilerClassPath +
File(KotlinIntegrationTestBase.getCompilerLib(), "kotlin-compiler-sources.jar"),
File(System.getenv("JDK_9")).resolve("bin/java")
)
withLogFile("kotlin-daemon-test-1") { logFile1 ->
withLogFile("kotlin-daemon-test-2") { logFile2 ->
val daemonJdk8JVMOptions = makeTestDaemonJvmOptions(logFile1)
assertTrue(logFile1.length() == 0L)
val daemonJdk9JVMOptions = makeTestDaemonJvmOptions(logFile2)
assertTrue(logFile2.length() == 0L)
val daemonJdk7 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk8,
flagFile1,
daemonJdk8JVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemonJdk7)
logFile1.assertLogContainsSequence("INFO: starting daemon")
val daemonJdk9 = KotlinCompilerClient.connectToCompileService(
compilerIdJdk9,
flagFile2,
daemonJdk9JVMOptions,
daemonOptions,
DaemonReportingTargets(out = System.err),
autostart = true
)
assertNotNull("failed to connect daemon", daemonJdk9)
logFile2.assertLogContainsSequence("INFO: starting daemon")
KotlinCompilerClient.shutdownCompileService(compilerIdJdk8, daemonOptions)
KotlinCompilerClient.shutdownCompileService(compilerIdJdk9, daemonOptions)
Thread.sleep(100)
logFile1.assertLogContainsSequence("Shutdown started")
logFile2.assertLogContainsSequence("Shutdown started")
}
}
}
}
}
fun testDaemonRunError() {
withFlagFile(getTestName(true), ".alive") { flagFile ->
val daemonOptions = DaemonOptions(shutdownDelayMilliseconds = 1, verbose = true, runFilesPath = File(testTempDir, getTestName(true)).absolutePath)

View File

@@ -243,7 +243,7 @@ abstract class CompileServiceImplBase(
runFileDir,
makeRunFilenameString(
timestamp = "%tFT%<tH-%<tM-%<tS.%<tLZ".format(Calendar.getInstance(TimeZone.getTimeZone("Z"))),
digest = compilerId.compilerClasspath.map { File(it).absolutePath }.distinctStringsDigest().toHexString(),
digest = compilerId.digest(),
port = port.toString()
)
)

View File

@@ -29,6 +29,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("annotationUsedAsAnnotationArgument.kt")
public void testAnnotationUsedAsAnnotationArgument() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/annotationUsedAsAnnotationArgument.kt");
}
@TestMetadata("asImports.kt")
public void testAsImports() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/asImports.kt");
@@ -174,6 +179,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/ft.kt");
}
@TestMetadata("funInterfaceDeclaration.kt")
public void testFunInterfaceDeclaration() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/funInterfaceDeclaration.kt");
}
@TestMetadata("functionTypeAlias.kt")
public void testFunctionTypeAlias() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/functionTypeAlias.kt");
@@ -980,6 +990,24 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/contracts")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Contracts extends AbstractLazyBodyIsNotTouchedTilContractsPhaseTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInContracts() throws Exception {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolve/contracts"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
}
@TestMetadata("genericContract.kt")
public void testGenericContract() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/contracts/genericContract.kt");
}
}
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/delegates")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -2827,11 +2855,21 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
runTest("compiler/fir/analysis-tests/testData/resolve/references/integerLiteralInLhs.kt");
}
@TestMetadata("leakedImplicitType.kt")
public void testLeakedImplicitType() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/leakedImplicitType.kt");
}
@TestMetadata("referenceToExtension.kt")
public void testReferenceToExtension() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToExtension.kt");
}
@TestMetadata("referenceToField.kt")
public void testReferenceToField() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/referenceToField.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/references/simple.kt");

View File

@@ -0,0 +1,27 @@
FILE: annotationUsedAsAnnotationArgument.kt
public final annotation class Ann : R|kotlin/Annotation| {
public constructor(): R|Ann| {
super<R|kotlin/Any|>()
}
}
public final annotation class Ann2 : R|kotlin/Annotation| {
public constructor(): R|Ann2| {
super<R|kotlin/Any|>()
}
}
public final annotation class Ann3 : R|kotlin/Annotation| {
public constructor(arg: R|kotlin/Int|, s: R|kotlin/String|): R|Ann3| {
super<R|kotlin/Any|>()
}
public final val arg: R|kotlin/Int| = R|<local>/arg|
public get(): R|kotlin/Int|
public final val s: R|kotlin/String| = R|<local>/s|
public get(): R|kotlin/String|
}
@R|Ann3|(@R|Ann3|(@R|Ann|() Int(5), String()) @R|Ann2|() Int(1), String()) public final val a: R|kotlin/Int| = Int(0)
public get(): R|kotlin/Int|

View File

@@ -0,0 +1,11 @@
annotation class Ann
annotation class Ann2
annotation class Ann3(val arg: Int, val s: String)
@Ann3(
<!ANNOTATION_USED_AS_ANNOTATION_ARGUMENT!>@Ann3(
<!ANNOTATION_USED_AS_ANNOTATION_ARGUMENT!>@Ann<!> 5, ""
)<!> <!ANNOTATION_USED_AS_ANNOTATION_ARGUMENT!>@Ann2<!> 1, ""
) val a = 0

View File

@@ -15,5 +15,5 @@ class B : A() {
}
fun test(b: B) {
b.<!HIDDEN!>foo<!>("")
b.<!INVISIBLE_REFERENCE!>foo<!>("")
}

View File

@@ -8,5 +8,5 @@ FILE: stringTemplates.kt
public final fun foo(s: R|kotlin/String|): R|kotlin/Unit| {
}
public final fun test(a: R|A|): R|kotlin/Unit| {
R|/foo|(<strcat>(R|<local>/a|.R|kotlin/Any.toString|()))
R|/foo|(<strcat>(R|<local>/a|))
}

View File

@@ -191,63 +191,68 @@ digraph complex_kt {
subgraph cluster_19 {
color=blue
56 [label="Enter block"];
57 [label="Access variable this@R|/firstIsInstanceOrNull|"];
58 [label="Function call: this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<CapturedType(*)>|>|()"];
59 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<kotlin/Any?>|"];
subgraph cluster_20 {
color=blue
60 [label="Enter while loop"];
57 [label="Enter block"];
58 [label="Access variable this@R|/firstIsInstanceOrNull|"];
59 [label="Function call: this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<CapturedType(*)>|>|()"];
60 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<kotlin/Any?>|"];
subgraph cluster_21 {
color=blue
61 [label="Enter loop condition"];
62 [label="Access variable R|<local>/<iterator>|"];
63 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
64 [label="Exit loop condition"];
}
subgraph cluster_22 {
color=blue
65 [label="Enter loop block"];
61 [label="Enter while loop"];
subgraph cluster_22 {
color=blue
62 [label="Enter loop condition"];
63 [label="Access variable R|<local>/<iterator>|"];
64 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
65 [label="Exit loop condition"];
}
subgraph cluster_23 {
color=blue
66 [label="Enter block"];
67 [label="Access variable R|<local>/<iterator>|"];
68 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Any?|>|()"];
69 [label="Variable declaration: lval element: R|kotlin/Any?|"];
66 [label="Enter loop block"];
subgraph cluster_24 {
color=blue
70 [label="Enter when"];
67 [label="Enter block"];
68 [label="Access variable R|<local>/<iterator>|"];
69 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Any?|>|()"];
70 [label="Variable declaration: lval element: R|kotlin/Any?|"];
subgraph cluster_25 {
color=blue
71 [label="Enter when branch condition "];
72 [label="Access variable R|<local>/element|"];
73 [label="Type operator: (R|<local>/element| is R|T|)"];
74 [label="Exit when branch condition"];
71 [label="Enter when"];
subgraph cluster_26 {
color=blue
72 [label="Enter when branch condition "];
73 [label="Access variable R|<local>/element|"];
74 [label="Type operator: (R|<local>/element| is R|T|)"];
75 [label="Exit when branch condition"];
}
76 [label="Synthetic else branch"];
77 [label="Enter when branch result"];
subgraph cluster_27 {
color=blue
78 [label="Enter block"];
79 [label="Access variable R|<local>/element|"];
80 [label="Jump: ^firstIsInstanceOrNull R|<local>/element|"];
81 [label="Stub" style="filled" fillcolor=gray];
82 [label="Exit block" style="filled" fillcolor=gray];
}
83 [label="Exit when branch result" style="filled" fillcolor=gray];
84 [label="Exit when"];
}
75 [label="Synthetic else branch"];
76 [label="Enter when branch result"];
subgraph cluster_26 {
color=blue
77 [label="Enter block"];
78 [label="Access variable R|<local>/element|"];
79 [label="Jump: ^firstIsInstanceOrNull R|<local>/element|"];
80 [label="Stub" style="filled" fillcolor=gray];
81 [label="Exit block" style="filled" fillcolor=gray];
}
82 [label="Exit when branch result" style="filled" fillcolor=gray];
83 [label="Exit when"];
85 [label="Exit block"];
}
84 [label="Exit block"];
86 [label="Exit loop block"];
}
85 [label="Exit loop block"];
87 [label="Exit whileloop"];
}
86 [label="Exit whileloop"];
88 [label="Exit block"];
}
87 [label="Const: Null(null)"];
88 [label="Jump: ^firstIsInstanceOrNull Null(null)"];
89 [label="Stub" style="filled" fillcolor=gray];
90 [label="Exit block" style="filled" fillcolor=gray];
89 [label="Const: Null(null)"];
90 [label="Jump: ^firstIsInstanceOrNull Null(null)"];
91 [label="Stub" style="filled" fillcolor=gray];
92 [label="Exit block" style="filled" fillcolor=gray];
}
91 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red];
93 [label="Exit function firstIsInstanceOrNull" style="filled" fillcolor=red];
}
55 -> {56};
56 -> {57};
@@ -258,8 +263,8 @@ digraph complex_kt {
61 -> {62};
62 -> {63};
63 -> {64};
64 -> {86 65};
65 -> {66};
64 -> {65};
65 -> {87 66};
66 -> {67};
67 -> {68};
68 -> {69};
@@ -268,24 +273,26 @@ digraph complex_kt {
71 -> {72};
72 -> {73};
73 -> {74};
74 -> {76 75};
75 -> {83};
76 -> {77};
74 -> {75};
75 -> {77 76};
76 -> {84};
77 -> {78};
78 -> {79};
79 -> {91};
79 -> {80} [style=dotted];
79 -> {80};
80 -> {93};
80 -> {81} [style=dotted];
81 -> {82} [style=dotted];
82 -> {83} [style=dotted];
83 -> {84};
83 -> {84} [style=dotted];
84 -> {85};
85 -> {61} [color=green style=dashed];
86 -> {87};
85 -> {86};
86 -> {62} [color=green style=dashed];
87 -> {88};
88 -> {91};
88 -> {89} [style=dotted];
89 -> {90} [style=dotted];
88 -> {89};
89 -> {90};
90 -> {93};
90 -> {91} [style=dotted];
91 -> {92} [style=dotted];
92 -> {93} [style=dotted];
}

View File

@@ -25,13 +25,16 @@ FILE: complex.kt
}
public final inline fun <reified T : R|kotlin/Any|> R|kotlin/collections/List<*>|.firstIsInstanceOrNull(): R|T?| {
lval <iterator>: R|kotlin/collections/Iterator<kotlin/Any?>| = this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<CapturedType(*)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval element: R|kotlin/Any?| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Any?|>|()
when () {
(R|<local>/element| is R|T|) -> {
^firstIsInstanceOrNull R|<local>/element|
{
lval <iterator>: R|kotlin/collections/Iterator<kotlin/Any?>| = this@R|/firstIsInstanceOrNull|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<CapturedType(*)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval element: R|kotlin/Any?| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Any?|>|()
when () {
(R|<local>/element| is R|T|) -> {
^firstIsInstanceOrNull R|<local>/element|
}
}
}
}

View File

@@ -127,7 +127,7 @@ digraph jumps_kt {
}
51 [label="Variable declaration: lval y: R|kotlin/Int?|"];
52 [label="Access variable R|<local>/y|"];
53 [label="Function call: R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
53 [label="Function call: R|<local>/y|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
54 [label="Exit block"];
}
55 [label="Exit function test_2" style="filled" fillcolor=red];

View File

@@ -22,7 +22,7 @@ FILE: jumps.kt
}
}
R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/y|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
public final fun test_3(x: R|kotlin/Int?|): R|kotlin/Unit| {
while(Boolean(true)) {

View File

@@ -118,44 +118,49 @@ digraph loops_kt {
subgraph cluster_13 {
color=blue
37 [label="Enter block"];
38 [label="Const: Int(0)"];
39 [label="Const: Int(5)"];
40 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)"];
41 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()"];
42 [label="Variable declaration: lval <iterator>: R|kotlin/collections/IntIterator|"];
subgraph cluster_14 {
color=blue
43 [label="Enter while loop"];
38 [label="Enter block"];
39 [label="Const: Int(0)"];
40 [label="Const: Int(5)"];
41 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...)"];
42 [label="Function call: Int(0).R|kotlin/Int.rangeTo|(...).R|kotlin/ranges/IntProgression.iterator|()"];
43 [label="Variable declaration: lval <iterator>: R|kotlin/collections/IntIterator|"];
subgraph cluster_15 {
color=blue
44 [label="Enter loop condition"];
45 [label="Access variable R|<local>/<iterator>|"];
46 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
47 [label="Exit loop condition"];
}
subgraph cluster_16 {
color=blue
48 [label="Enter loop block"];
44 [label="Enter while loop"];
subgraph cluster_16 {
color=blue
45 [label="Enter loop condition"];
46 [label="Access variable R|<local>/<iterator>|"];
47 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
48 [label="Exit loop condition"];
}
subgraph cluster_17 {
color=blue
49 [label="Enter block"];
50 [label="Access variable R|<local>/<iterator>|"];
51 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()"];
52 [label="Variable declaration: lval i: R|kotlin/Int|"];
53 [label="Access variable R|<local>/x|"];
54 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
55 [label="Variable declaration: lval y: R|kotlin/Boolean|"];
56 [label="Exit block"];
49 [label="Enter loop block"];
subgraph cluster_18 {
color=blue
50 [label="Enter block"];
51 [label="Access variable R|<local>/<iterator>|"];
52 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()"];
53 [label="Variable declaration: lval i: R|kotlin/Int|"];
54 [label="Access variable R|<local>/x|"];
55 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
56 [label="Variable declaration: lval y: R|kotlin/Boolean|"];
57 [label="Exit block"];
}
58 [label="Exit loop block"];
}
57 [label="Exit loop block"];
59 [label="Exit whileloop"];
}
58 [label="Exit whileloop"];
60 [label="Exit block"];
}
59 [label="Access variable R|<local>/x|"];
60 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
61 [label="Exit block"];
61 [label="Access variable R|<local>/x|"];
62 [label="Type operator: (R|<local>/x| is R|kotlin/String|)"];
63 [label="Exit block"];
}
62 [label="Exit function testFor" style="filled" fillcolor=red];
64 [label="Exit function testFor" style="filled" fillcolor=red];
}
36 -> {37};
37 -> {38};
@@ -168,8 +173,8 @@ digraph loops_kt {
44 -> {45};
45 -> {46};
46 -> {47};
47 -> {58 48};
48 -> {49};
47 -> {48};
48 -> {59 49};
49 -> {50};
50 -> {51};
51 -> {52};
@@ -178,226 +183,226 @@ digraph loops_kt {
54 -> {55};
55 -> {56};
56 -> {57};
57 -> {44} [color=green style=dashed];
58 -> {59};
57 -> {58};
58 -> {45} [color=green style=dashed];
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {63};
63 -> {64};
subgraph cluster_18 {
subgraph cluster_19 {
color=red
63 [label="Enter function testWhileTrue" style="filled" fillcolor=red];
subgraph cluster_19 {
65 [label="Enter function testWhileTrue" style="filled" fillcolor=red];
subgraph cluster_20 {
color=blue
64 [label="Enter block"];
subgraph cluster_20 {
66 [label="Enter block"];
subgraph cluster_21 {
color=blue
65 [label="Enter while loop"];
subgraph cluster_21 {
color=blue
66 [label="Enter loop condition"];
67 [label="Const: Boolean(true)"];
68 [label="Exit loop condition"];
}
67 [label="Enter while loop"];
subgraph cluster_22 {
color=blue
69 [label="Enter loop block"];
subgraph cluster_23 {
color=blue
70 [label="Enter block"];
71 [label="Const: Int(1)"];
72 [label="Exit block"];
}
73 [label="Exit loop block"];
68 [label="Enter loop condition"];
69 [label="Const: Boolean(true)"];
70 [label="Exit loop condition"];
}
74 [label="Exit whileloop" style="filled" fillcolor=gray];
subgraph cluster_23 {
color=blue
71 [label="Enter loop block"];
subgraph cluster_24 {
color=blue
72 [label="Enter block"];
73 [label="Const: Int(1)"];
74 [label="Exit block"];
}
75 [label="Exit loop block"];
}
76 [label="Exit whileloop" style="filled" fillcolor=gray];
}
75 [label="Const: Int(1)" style="filled" fillcolor=gray];
76 [label="Exit block" style="filled" fillcolor=gray];
77 [label="Const: Int(1)" style="filled" fillcolor=gray];
78 [label="Exit block" style="filled" fillcolor=gray];
}
77 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray];
79 [label="Exit function testWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
63 -> {64};
64 -> {65};
65 -> {66};
66 -> {67};
67 -> {68};
68 -> {69};
68 -> {74} [style=dotted];
69 -> {70};
70 -> {71};
70 -> {76} [style=dotted];
71 -> {72};
72 -> {73};
73 -> {66} [color=green style=dashed];
74 -> {75} [style=dotted];
75 -> {76} [style=dotted];
73 -> {74};
74 -> {75};
75 -> {68} [color=green style=dashed];
76 -> {77} [style=dotted];
77 -> {78} [style=dotted];
78 -> {79} [style=dotted];
subgraph cluster_24 {
subgraph cluster_25 {
color=red
78 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red];
subgraph cluster_25 {
80 [label="Enter function testWhileTrueWithBreak" style="filled" fillcolor=red];
subgraph cluster_26 {
color=blue
79 [label="Enter block"];
subgraph cluster_26 {
81 [label="Enter block"];
subgraph cluster_27 {
color=blue
80 [label="Enter while loop"];
subgraph cluster_27 {
color=blue
81 [label="Enter loop condition"];
82 [label="Const: Boolean(true)"];
83 [label="Exit loop condition"];
}
82 [label="Enter while loop"];
subgraph cluster_28 {
color=blue
84 [label="Enter loop block"];
subgraph cluster_29 {
83 [label="Enter loop condition"];
84 [label="Const: Boolean(true)"];
85 [label="Exit loop condition"];
}
subgraph cluster_29 {
color=blue
86 [label="Enter loop block"];
subgraph cluster_30 {
color=blue
85 [label="Enter block"];
subgraph cluster_30 {
87 [label="Enter block"];
subgraph cluster_31 {
color=blue
86 [label="Enter when"];
subgraph cluster_31 {
color=blue
87 [label="Enter when branch condition "];
88 [label="Access variable R|<local>/b|"];
89 [label="Exit when branch condition"];
}
90 [label="Synthetic else branch"];
91 [label="Enter when branch result"];
88 [label="Enter when"];
subgraph cluster_32 {
color=blue
92 [label="Enter block"];
93 [label="Jump: break@@@[Boolean(true)] "];
94 [label="Stub" style="filled" fillcolor=gray];
95 [label="Exit block" style="filled" fillcolor=gray];
89 [label="Enter when branch condition "];
90 [label="Access variable R|<local>/b|"];
91 [label="Exit when branch condition"];
}
96 [label="Exit when branch result" style="filled" fillcolor=gray];
97 [label="Exit when"];
92 [label="Synthetic else branch"];
93 [label="Enter when branch result"];
subgraph cluster_33 {
color=blue
94 [label="Enter block"];
95 [label="Jump: break@@@[Boolean(true)] "];
96 [label="Stub" style="filled" fillcolor=gray];
97 [label="Exit block" style="filled" fillcolor=gray];
}
98 [label="Exit when branch result" style="filled" fillcolor=gray];
99 [label="Exit when"];
}
98 [label="Exit block"];
100 [label="Exit block"];
}
99 [label="Exit loop block"];
101 [label="Exit loop block"];
}
100 [label="Exit whileloop"];
102 [label="Exit whileloop"];
}
101 [label="Const: Int(1)"];
102 [label="Exit block"];
103 [label="Const: Int(1)"];
104 [label="Exit block"];
}
103 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red];
105 [label="Exit function testWhileTrueWithBreak" style="filled" fillcolor=red];
}
78 -> {79};
79 -> {80};
80 -> {81};
81 -> {82};
82 -> {83};
83 -> {84};
83 -> {100} [style=dotted];
84 -> {85};
85 -> {86};
85 -> {102} [style=dotted];
86 -> {87};
87 -> {88};
88 -> {89};
89 -> {91 90};
90 -> {97};
91 -> {92};
92 -> {93};
93 -> {100};
93 -> {94} [style=dotted];
94 -> {95} [style=dotted];
89 -> {90};
90 -> {91};
91 -> {93 92};
92 -> {99};
93 -> {94};
94 -> {95};
95 -> {102};
95 -> {96} [style=dotted];
96 -> {97} [style=dotted];
97 -> {98};
98 -> {99};
99 -> {81} [color=green style=dashed];
97 -> {98} [style=dotted];
98 -> {99} [style=dotted];
99 -> {100};
100 -> {101};
101 -> {102};
101 -> {83} [color=green style=dashed];
102 -> {103};
103 -> {104};
104 -> {105};
subgraph cluster_33 {
subgraph cluster_34 {
color=red
104 [label="Enter function testWhileFalse" style="filled" fillcolor=red];
subgraph cluster_34 {
106 [label="Enter function testWhileFalse" style="filled" fillcolor=red];
subgraph cluster_35 {
color=blue
105 [label="Enter block"];
subgraph cluster_35 {
107 [label="Enter block"];
subgraph cluster_36 {
color=blue
106 [label="Enter while loop"];
subgraph cluster_36 {
color=blue
107 [label="Enter loop condition"];
108 [label="Const: Boolean(false)"];
109 [label="Exit loop condition"];
}
108 [label="Enter while loop"];
subgraph cluster_37 {
color=blue
110 [label="Enter loop block" style="filled" fillcolor=gray];
subgraph cluster_38 {
color=blue
111 [label="Enter block" style="filled" fillcolor=gray];
112 [label="Const: Int(1)" style="filled" fillcolor=gray];
113 [label="Exit block" style="filled" fillcolor=gray];
}
114 [label="Exit loop block" style="filled" fillcolor=gray];
109 [label="Enter loop condition"];
110 [label="Const: Boolean(false)"];
111 [label="Exit loop condition"];
}
115 [label="Exit whileloop"];
subgraph cluster_38 {
color=blue
112 [label="Enter loop block" style="filled" fillcolor=gray];
subgraph cluster_39 {
color=blue
113 [label="Enter block" style="filled" fillcolor=gray];
114 [label="Const: Int(1)" style="filled" fillcolor=gray];
115 [label="Exit block" style="filled" fillcolor=gray];
}
116 [label="Exit loop block" style="filled" fillcolor=gray];
}
117 [label="Exit whileloop"];
}
116 [label="Const: Int(1)"];
117 [label="Exit block"];
118 [label="Const: Int(1)"];
119 [label="Exit block"];
}
118 [label="Exit function testWhileFalse" style="filled" fillcolor=red];
120 [label="Exit function testWhileFalse" style="filled" fillcolor=red];
}
104 -> {105};
105 -> {106};
106 -> {107};
107 -> {108};
108 -> {109};
109 -> {115};
109 -> {110} [style=dotted];
110 -> {111} [style=dotted];
109 -> {110};
110 -> {111};
111 -> {117};
111 -> {112} [style=dotted];
112 -> {113} [style=dotted];
113 -> {114} [style=dotted];
114 -> {107} [color=green style=dotted];
115 -> {116};
116 -> {117};
114 -> {115} [style=dotted];
115 -> {116} [style=dotted];
116 -> {109} [color=green style=dotted];
117 -> {118};
subgraph cluster_39 {
color=red
119 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red];
subgraph cluster_40 {
color=blue
120 [label="Enter block"];
subgraph cluster_41 {
color=blue
121 [label="Enter do-while loop"];
subgraph cluster_42 {
color=blue
122 [label="Enter loop block"];
subgraph cluster_43 {
color=blue
123 [label="Enter block"];
124 [label="Const: Int(1)"];
125 [label="Exit block"];
}
126 [label="Exit loop block"];
}
subgraph cluster_44 {
color=blue
127 [label="Enter loop condition"];
128 [label="Const: Boolean(true)"];
129 [label="Exit loop condition"];
}
130 [label="Exit do-whileloop" style="filled" fillcolor=gray];
}
131 [label="Const: Int(1)" style="filled" fillcolor=gray];
132 [label="Exit block" style="filled" fillcolor=gray];
}
133 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
118 -> {119};
119 -> {120};
120 -> {121};
subgraph cluster_40 {
color=red
121 [label="Enter function testDoWhileTrue" style="filled" fillcolor=red];
subgraph cluster_41 {
color=blue
122 [label="Enter block"];
subgraph cluster_42 {
color=blue
123 [label="Enter do-while loop"];
subgraph cluster_43 {
color=blue
124 [label="Enter loop block"];
subgraph cluster_44 {
color=blue
125 [label="Enter block"];
126 [label="Const: Int(1)"];
127 [label="Exit block"];
}
128 [label="Exit loop block"];
}
subgraph cluster_45 {
color=blue
129 [label="Enter loop condition"];
130 [label="Const: Boolean(true)"];
131 [label="Exit loop condition"];
}
132 [label="Exit do-whileloop" style="filled" fillcolor=gray];
}
133 [label="Const: Int(1)" style="filled" fillcolor=gray];
134 [label="Exit block" style="filled" fillcolor=gray];
}
135 [label="Exit function testDoWhileTrue" style="filled" fillcolor=red style="filled" fillcolor=gray];
}
121 -> {122};
122 -> {123};
123 -> {124};
@@ -406,128 +411,128 @@ digraph loops_kt {
126 -> {127};
127 -> {128};
128 -> {129};
129 -> {130} [style=dotted];
129 -> {122} [color=green style=dashed];
130 -> {131} [style=dotted];
129 -> {130};
130 -> {131};
131 -> {132} [style=dotted];
131 -> {124} [color=green style=dashed];
132 -> {133} [style=dotted];
133 -> {134} [style=dotted];
134 -> {135} [style=dotted];
subgraph cluster_45 {
subgraph cluster_46 {
color=red
134 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red];
subgraph cluster_46 {
136 [label="Enter function testDoWhileTrueWithBreak" style="filled" fillcolor=red];
subgraph cluster_47 {
color=blue
135 [label="Enter block"];
subgraph cluster_47 {
137 [label="Enter block"];
subgraph cluster_48 {
color=blue
136 [label="Enter do-while loop"];
subgraph cluster_48 {
138 [label="Enter do-while loop"];
subgraph cluster_49 {
color=blue
137 [label="Enter loop block"];
subgraph cluster_49 {
139 [label="Enter loop block"];
subgraph cluster_50 {
color=blue
138 [label="Enter block"];
subgraph cluster_50 {
140 [label="Enter block"];
subgraph cluster_51 {
color=blue
139 [label="Enter when"];
subgraph cluster_51 {
color=blue
140 [label="Enter when branch condition "];
141 [label="Access variable R|<local>/b|"];
142 [label="Exit when branch condition"];
}
143 [label="Synthetic else branch"];
144 [label="Enter when branch result"];
141 [label="Enter when"];
subgraph cluster_52 {
color=blue
145 [label="Enter block"];
146 [label="Jump: break@@@[Boolean(true)] "];
147 [label="Stub" style="filled" fillcolor=gray];
148 [label="Exit block" style="filled" fillcolor=gray];
142 [label="Enter when branch condition "];
143 [label="Access variable R|<local>/b|"];
144 [label="Exit when branch condition"];
}
149 [label="Exit when branch result" style="filled" fillcolor=gray];
150 [label="Exit when"];
145 [label="Synthetic else branch"];
146 [label="Enter when branch result"];
subgraph cluster_53 {
color=blue
147 [label="Enter block"];
148 [label="Jump: break@@@[Boolean(true)] "];
149 [label="Stub" style="filled" fillcolor=gray];
150 [label="Exit block" style="filled" fillcolor=gray];
}
151 [label="Exit when branch result" style="filled" fillcolor=gray];
152 [label="Exit when"];
}
151 [label="Exit block"];
153 [label="Exit block"];
}
152 [label="Exit loop block"];
154 [label="Exit loop block"];
}
subgraph cluster_53 {
subgraph cluster_54 {
color=blue
153 [label="Enter loop condition"];
154 [label="Const: Boolean(true)"];
155 [label="Exit loop condition"];
155 [label="Enter loop condition"];
156 [label="Const: Boolean(true)"];
157 [label="Exit loop condition"];
}
156 [label="Exit do-whileloop"];
158 [label="Exit do-whileloop"];
}
157 [label="Const: Int(1)"];
158 [label="Exit block"];
159 [label="Const: Int(1)"];
160 [label="Exit block"];
}
159 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red];
161 [label="Exit function testDoWhileTrueWithBreak" style="filled" fillcolor=red];
}
134 -> {135};
135 -> {136};
136 -> {137};
137 -> {138};
138 -> {139};
139 -> {140};
140 -> {141};
141 -> {142};
142 -> {144 143};
143 -> {150};
144 -> {145};
145 -> {146};
146 -> {156};
146 -> {147} [style=dotted];
147 -> {148} [style=dotted];
142 -> {143};
143 -> {144};
144 -> {146 145};
145 -> {152};
146 -> {147};
147 -> {148};
148 -> {158};
148 -> {149} [style=dotted];
149 -> {150} [style=dotted];
150 -> {151};
151 -> {152};
150 -> {151} [style=dotted];
151 -> {152} [style=dotted];
152 -> {153};
153 -> {154};
154 -> {155};
155 -> {156} [style=dotted];
155 -> {137} [color=green style=dashed];
155 -> {156};
156 -> {157};
157 -> {158};
157 -> {158} [style=dotted];
157 -> {139} [color=green style=dashed];
158 -> {159};
subgraph cluster_54 {
color=red
160 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red];
subgraph cluster_55 {
color=blue
161 [label="Enter block"];
subgraph cluster_56 {
color=blue
162 [label="Enter do-while loop"];
subgraph cluster_57 {
color=blue
163 [label="Enter loop block"];
subgraph cluster_58 {
color=blue
164 [label="Enter block"];
165 [label="Const: Int(1)"];
166 [label="Exit block"];
}
167 [label="Exit loop block"];
}
subgraph cluster_59 {
color=blue
168 [label="Enter loop condition"];
169 [label="Const: Boolean(false)"];
170 [label="Exit loop condition"];
}
171 [label="Exit do-whileloop"];
}
172 [label="Const: Int(1)"];
173 [label="Exit block"];
}
174 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red];
}
159 -> {160};
160 -> {161};
161 -> {162};
subgraph cluster_55 {
color=red
162 [label="Enter function testDoWhileFalse" style="filled" fillcolor=red];
subgraph cluster_56 {
color=blue
163 [label="Enter block"];
subgraph cluster_57 {
color=blue
164 [label="Enter do-while loop"];
subgraph cluster_58 {
color=blue
165 [label="Enter loop block"];
subgraph cluster_59 {
color=blue
166 [label="Enter block"];
167 [label="Const: Int(1)"];
168 [label="Exit block"];
}
169 [label="Exit loop block"];
}
subgraph cluster_60 {
color=blue
170 [label="Enter loop condition"];
171 [label="Const: Boolean(false)"];
172 [label="Exit loop condition"];
}
173 [label="Exit do-whileloop"];
}
174 [label="Const: Int(1)"];
175 [label="Exit block"];
}
176 [label="Exit function testDoWhileFalse" style="filled" fillcolor=red];
}
162 -> {163};
163 -> {164};
164 -> {165};
@@ -537,9 +542,11 @@ digraph loops_kt {
168 -> {169};
169 -> {170};
170 -> {171};
170 -> {163} [color=green style=dotted];
171 -> {172};
172 -> {173};
172 -> {165} [color=green style=dotted];
173 -> {174};
174 -> {175};
175 -> {176};
}

View File

@@ -14,10 +14,13 @@ FILE: loops.kt
(R|<local>/x| is R|kotlin/String|)
}
public final fun testFor(x: R|kotlin/Any?|): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
lval y: R|kotlin/Boolean| = (R|<local>/x| is R|kotlin/String|)
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
lval y: R|kotlin/Boolean| = (R|<local>/x| is R|kotlin/String|)
}
}
(R|<local>/x| is R|kotlin/String|)

View File

@@ -11,7 +11,7 @@ FILE: const.kt
public get(): R|kotlin/String|
public final const val f: R|kotlin/Int| = Int(1).R|kotlin/Int.plus|(Int(2)).R|kotlin/Int.times|(Int(3)).R|kotlin/Int.div|(Int(4)).R|kotlin/Int.rem|(Int(5)).R|kotlin/Int.minus|(Int(1))
public get(): R|kotlin/Int|
public final const val g: R|kotlin/String| = <strcat>(String(string ), R|/f|.R|kotlin/Any.toString|())
public final const val g: R|kotlin/String| = <strcat>(String(string ), R|/f|)
public get(): R|kotlin/String|
public final const val h: R|kotlin/String| = String(string).R|kotlin/String.plus|(R|/g|)
public get(): R|kotlin/String|

View File

@@ -0,0 +1,35 @@
FILE: genericContract.kt
public final inline fun <reified T> requreIsInstance(value: R|kotlin/Any|): R|kotlin/Unit|
[R|Contract description]
<
Returns(WILDCARD) -> value is T
>
{
when () {
(R|<local>/value| !is R|T|) -> {
throw R|java/lang/IllegalArgumentException.IllegalArgumentException|()
}
}
}
public final fun test_1(s: R|kotlin/Any|): R|kotlin/Unit| {
R|/requreIsInstance|<R|kotlin/String|>(R|<local>/s|)
R|<local>/s|.R|kotlin/String.length|
}
public final inline fun <reified T> requreIsInstanceOf(value: R|kotlin/Any|, requiredValue: R|T|): R|kotlin/Unit|
[R|Contract description]
<
Returns(WILDCARD) -> value is T
>
{
when () {
(R|<local>/value| !is R|T|) -> {
throw R|java/lang/IllegalArgumentException.IllegalArgumentException|()
}
}
}
public final fun test_2(x: R|kotlin/Any|, s: R|kotlin/String|): R|kotlin/Unit| {
R|/requreIsInstanceOf|<R|kotlin/String|>(R|<local>/x|, R|<local>/s|)
R|<local>/x|.R|kotlin/String.length|
}

View File

@@ -0,0 +1,25 @@
// WITH_STDLIB
import kotlin.contracts.*
inline fun <reified T> requreIsInstance(value: Any) contract [
returns() implies (value is T)
] {
if (value !is T) throw IllegalArgumentException()
}
fun test_1(s: Any) {
requreIsInstance<String>(s)
s.length
}
inline fun <reified T> requreIsInstanceOf(value: Any, requiredValue: T) contract [
returns() implies (value is T)
] {
if (value !is T) throw IllegalArgumentException()
}
fun test_2(x: Any, s: String) {
requreIsInstanceOf(x, s)
x.length
}

View File

@@ -50,5 +50,5 @@ FILE: annotationArgumentMustBeConst.kt
public get(): R|kotlin/Int|
}
@R|Ann1|(vararg(R|/foo|, R|/foo|.R|kotlin/String.plus|(R|/bar|), <strcat>(R|/foo|.R|kotlin/Any.toString|(), String( ), R|/bar|.R|kotlin/Any.toString|()), <strcat>(R|/baz|().R|kotlin/Any.toString|(), String( )))) @R|Ann2|(<implicitArrayOf>(R|/bar|, R|/baz|(), R|/bar|.R|kotlin/Int.plus|(R|/cnst|))) @R|Ann3|(R|/arr|) public final fun test(): R|kotlin/Unit| {
@R|Ann1|(vararg(R|/foo|, R|/foo|.R|kotlin/String.plus|(R|/bar|), <strcat>(R|/foo|, String( ), R|/bar|), <strcat>(R|/baz|(), String( )))) @R|Ann2|(<implicitArrayOf>(R|/bar|, R|/baz|(), R|/bar|.R|kotlin/Int.plus|(R|/cnst|))) @R|Ann3|(R|/arr|) public final fun test(): R|kotlin/Unit| {
}

View File

@@ -2,7 +2,7 @@ fun foo() {
<!LOCAL_ANNOTATION_CLASS_ERROR!>annotation class Ann<!>
@Ann class Local {
<!LOCAL_ANNOTATION_CLASS_ERROR{LT}!>// There should also be NESTED_CLASS_NOT_ALLOWED report here.
<!LOCAL_ANNOTATION_CLASS_ERROR{PSI}!>annotation <!NESTED_CLASS_NOT_ALLOWED!>class Nested<!><!><!>
// There should also be NESTED_CLASS_NOT_ALLOWED report here.
<!LOCAL_ANNOTATION_CLASS_ERROR!>annotation <!NESTED_CLASS_NOT_ALLOWED!>class Nested<!><!>
}
}

View File

@@ -1,3 +1,3 @@
sealed class A
val b = <!HIDDEN!>A<!>()
val b = <!INVISIBLE_REFERENCE!>A<!>()

View File

@@ -21,7 +21,7 @@ val a = <!TYPE_ARGUMENTS_NOT_ALLOWED!>rest<Int><!>.<!UNRESOLVED_REFERENCE!>MyCla
val b = Best.<!UNRESOLVED_REFERENCE!>MyClass<!><String>
class B<E>
class C<F<!SYNTAX{PSI}!><<!><!SYNTAX{PSI}!>Boolean<!><!SYNTAX{PSI}!>><!><!SYNTAX{PSI}!>><!> <!SYNTAX{PSI}!>:<!> <!SYNTAX{PSI}!>B<!><!SYNTAX{PSI}!><<!><!SYNTAX{PSI}!>F<!><!SYNTAX{PSI}!><<!><!SYNTAX{PSI}!>Boolean<!><!SYNTAX{PSI}!>><!><!SYNTAX{PSI}!>><!><!SYNTAX{PSI}!>(<!><!SYNTAX{PSI}!>)<!>
class C<F<!SYNTAX!><<!><!SYNTAX!>Boolean<!><!SYNTAX!>><!><!SYNTAX!>><!> <!SYNTAX!>:<!> <!SYNTAX!>B<!><!SYNTAX!><<!><!SYNTAX!>F<!><!SYNTAX!><<!><!SYNTAX!>Boolean<!><!SYNTAX!>><!><!SYNTAX!>><!><!SYNTAX!>(<!><!SYNTAX!>)<!>
fun <G> gest() {}

View File

@@ -14,7 +14,7 @@ fun test() {
val b1 = B<<!UPPER_BOUND_VIOLATED!>Int<!>>()
val b2 = B<C>()
val b3 = B<<!UPPER_BOUND_VIOLATED!>Any?<!>>()
val b4 = B<<!UNRESOLVED_REFERENCE!>UnexistingType<!>>()<!UNRESOLVED_REFERENCE{PSI}!>NL<!><!SYNTAX{PSI}!><<!>Int<!SYNTAX{PSI}!>><!>()NumberPhile<!SYNTAX{PSI}!><!>
val b4 = B<<!UNRESOLVED_REFERENCE!>UnexistingType<!>>()<!UNRESOLVED_REFERENCE!>NL<!><!SYNTAX!><<!>Int<!SYNTAX!>><!>()NumberPhile<!SYNTAX!><!>
val b5 = B<<!UPPER_BOUND_VIOLATED!>B<<!UNRESOLVED_REFERENCE!>UnexistingType<!>><!>>()
fest<<!UPPER_BOUND_VIOLATED!>Boolean<!>>()
fest<C>()
@@ -40,7 +40,7 @@ fun <K, L : K> rest() {
class NumColl<T : Collection<Number>>
typealias NL<K> = NumColl<List<K>>
val test7 = NL<Int>()<!UNRESOLVED_REFERENCE{PSI}!>NumberPhile<!><!SYNTAX{PSI}!><!>
val test7 = NL<Int>()<!UNRESOLVED_REFERENCE!>NumberPhile<!><!SYNTAX!><!>
val test8 = NL<String>()
class NumberPhile<T: Number>(x: T)

View File

@@ -20,10 +20,13 @@ FILE: enumValues.kt
}
public final fun foo(): R|kotlin/Unit| {
lval values: R|kotlin/Array<MyEnum>| = Q|MyEnum|.R|/MyEnum.values|()
lval <iterator>: R|kotlin/collections/Iterator<MyEnum>| = R|<local>/values|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<MyEnum>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval value: R|MyEnum| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|MyEnum|>|()
R|<local>/value|.R|/MyEnum.bar|()
{
lval <iterator>: R|kotlin/collections/Iterator<MyEnum>| = R|<local>/values|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<MyEnum>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval value: R|MyEnum| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|MyEnum|>|()
R|<local>/value|.R|/MyEnum.bar|()
}
}
lval first: R|MyEnum| = Q|MyEnum|.R|/MyEnum.valueOf|(String(FIRST))

View File

@@ -18,10 +18,10 @@ FILE: errCallable.kt
}
public final fun foo(): R|kotlin/Unit| {
lval x: <ERROR TYPE REF: No result type for initializer> = ::<Unresolved name: Nested>#
lval x: R|ERROR CLASS: Unresolved reference: Nested| = ::<Unresolved reference: Nested>#
}
}
public final fun R|Your|.foo(): R|kotlin/Unit| {
lval x: <ERROR TYPE REF: No result type for initializer> = ::<Unresolved name: Nested>#
lval x: R|ERROR CLASS: Unresolved reference: Nested| = ::<Unresolved reference: Nested>#
}

View File

@@ -17,11 +17,11 @@ FILE: lambda.kt
}
)
R|/itIs|(<L> = itIs@fun <anonymous>(it: R|kotlin/String|): R|kotlin/String| <inline=NoInline> {
^ <strcat>(String(this is ), R|<local>/it|.R|kotlin/Any.toString|(), String( test))
^ <strcat>(String(this is ), R|<local>/it|, String( test))
}
)
R|/multipleArgs|(<L> = multipleArgs@fun <anonymous>(a: R|kotlin/String|, b: R|kotlin/String|): R|kotlin/String| <inline=NoInline> {
^ <strcat>(String(This is test of ), R|<local>/a|.R|kotlin/Any.toString|(), String(, ), R|<local>/b|.R|kotlin/Any.toString|())
^ <strcat>(String(This is test of ), R|<local>/a|, String(, ), R|<local>/b|)
}
)
lval s: R|kotlin/String| = fun <anonymous>(): R|kotlin/String| <inline=Unknown> {

View File

@@ -11,8 +11,8 @@ open class Outer {
class Derived : Outer() {
fun foo() {
Outer.<!HIDDEN!>PrivateNested<!>()
super.<!HIDDEN!>PrivateInner<!>()
Outer.<!INVISIBLE_REFERENCE!>PrivateNested<!>()
super.<!INVISIBLE_REFERENCE!>PrivateInner<!>()
Outer.ProtectedNested()
super.ProtectedInner()
@@ -23,11 +23,11 @@ class Derived : Outer() {
}
fun foo() {
Outer.<!HIDDEN!>PrivateNested<!>()
Outer().<!HIDDEN!>PrivateInner<!>()
Outer.<!INVISIBLE_REFERENCE!>PrivateNested<!>()
Outer().<!INVISIBLE_REFERENCE!>PrivateInner<!>()
Outer.<!HIDDEN!>ProtectedNested<!>()
Outer().<!HIDDEN!>ProtectedInner<!>()
Outer.<!INVISIBLE_REFERENCE!>ProtectedNested<!>()
Outer().<!INVISIBLE_REFERENCE!>ProtectedInner<!>()
Outer.PublicNested()
Outer().PublicInner()

View File

@@ -9,21 +9,21 @@ private class Private {
bar()
Nested()
fromCompanion()
NotCompanion.<!HIDDEN!>foo<!>() // hidden
NotCompanion.<!INVISIBLE_REFERENCE!>foo<!>() // hidden
}
inner class Inner {
fun foo() {
bar()
fromCompanion()
NotCompanion.<!HIDDEN!>foo<!>() // hidden
NotCompanion.<!INVISIBLE_REFERENCE!>foo<!>() // hidden
}
}
private class Nested {
fun foo() {
fromCompanion()
NotCompanion.<!HIDDEN!>foo<!>() // hidden
NotCompanion.<!INVISIBLE_REFERENCE!>foo<!>() // hidden
}
}
@@ -54,7 +54,7 @@ fun withLocals() {
Local().baz()
Local().<!HIDDEN!>bar<!>() // hidden
Local().<!INVISIBLE_REFERENCE!>bar<!>() // hidden
}
fun test() {
@@ -62,14 +62,14 @@ fun test() {
Private().baz()
Private().Inner()
Private().<!HIDDEN!>bar<!>() // hidden
Private.<!HIDDEN!>Nested<!>() // hidden
Private.<!HIDDEN!>fromCompanion<!>() // hidden
Private().<!INVISIBLE_REFERENCE!>bar<!>() // hidden
Private.<!INVISIBLE_REFERENCE!>Nested<!>() // hidden
Private.<!INVISIBLE_REFERENCE!>fromCompanion<!>() // hidden
}
// FILE: second.kt
fun secondTest() {
<!HIDDEN!>foo<!>() // hidden
<!HIDDEN!>Private<!>() // hidden
<!INVISIBLE_REFERENCE!>foo<!>() // hidden
<!INVISIBLE_REFERENCE!>Private<!>() // hidden
}

View File

@@ -31,7 +31,7 @@ class Derived : Protected() {
fun foo() {
bar()
Nested().foo()
Nested().<!HIDDEN!>bar<!>() // hidden
Nested().<!INVISIBLE_REFERENCE!>bar<!>() // hidden
fromCompanion()
protectedFromCompanion()
@@ -48,8 +48,8 @@ fun test() {
Protected().baz()
Protected().Inner()
Protected().<!HIDDEN!>bar<!>() // hidden
Protected.<!HIDDEN!>Nested<!>() // hidden
Protected().<!INVISIBLE_REFERENCE!>bar<!>() // hidden
Protected.<!INVISIBLE_REFERENCE!>Nested<!>() // hidden
}
open class Generic<T>(val x: T) {

View File

@@ -36,7 +36,7 @@ FILE: test.kt
lval bar: R|kotlin/CharSequence?| = R|<local>/x|?.{ $subj$.R|/SomeClass.bar| }
when () {
!=(R|<local>/bar|, Null(null)) -> {
R|<local>/x|.R|/SomeClass.bar|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/CharSequence.length>#
R|<local>/x|.R|/SomeClass.bar|.<Inapplicable(UNSAFE_CALL): kotlin/CharSequence.length>#
}
}

View File

@@ -66,10 +66,13 @@ FILE: CanBeValChecker.kt
public final fun stackOverflowBug(): R|kotlin/Unit| {
lvar a: R|kotlin/Int|
R|<local>/a| = Int(1)
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(10)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
R|kotlin/io/print|(R|<local>/i|)
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(10)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
R|kotlin/io/print|(R|<local>/i|)
}
}
}

View File

@@ -1,7 +1,7 @@
FILE: StringTemplate.kt
public abstract interface IC : R|kotlin/Any| {
public open fun toString(x: R|kotlin/String|): R|kotlin/String| {
^toString <strcat>(String(IC), R|<local>/x|.R|kotlin/Any.toString|())
^toString <strcat>(String(IC), R|<local>/x|)
}
}

View File

@@ -57,7 +57,7 @@ FILE: RedundantExplicitTypeChecker.kt
}
public final fun foo(): R|kotlin/Unit| {
lval s: R|kotlin/String| = <strcat>(String(Hello ), Int(10).R|kotlin/Int.plus|(Int(1)).R|kotlin/Any.toString|())
lval s: R|kotlin/String| = <strcat>(String(Hello ), Int(10).R|kotlin/Int.plus|(Int(1)))
lval str: R|kotlin/String?| = String()
lval o: R|Obj| = Q|Obj|
lval p: R|Point| = R|/PointImpl.PointImpl|(Int(1), Int(2))

View File

@@ -14,7 +14,7 @@ FILE: RedundantSetterParameterTypeChecker.kt
public final var x: R|kotlin/String| = String()
public get(): R|kotlin/String|
public set(param: R|kotlin/String|): R|kotlin/Unit| {
F|/x| = <strcat>(R|<local>/param|.R|kotlin/Any.toString|(), String( ))
F|/x| = <strcat>(R|<local>/param|, String( ))
}
public final class My : R|kotlin/Any| {
public constructor(): R|My| {

View File

@@ -1,12 +1,12 @@
FILE: RedundantSingleExpressionStringTemplateChecker.kt
public final val x: R|kotlin/String| = String(Hello)
public get(): R|kotlin/String|
public final val y: R|kotlin/String| = <strcat>(R|/x|.R|kotlin/Any.toString|())
public final val y: R|kotlin/String| = <strcat>(R|/x|)
public get(): R|kotlin/String|
public final val z: R|kotlin/String| = <strcat>(R|/y|.R|kotlin/Any.hashCode|().R|kotlin/Any.toString|())
public final val z: R|kotlin/String| = <strcat>(R|/y|.R|kotlin/Any.hashCode|())
public get(): R|kotlin/String|
public final fun toString(x: R|kotlin/String|): R|kotlin/String| {
^toString <strcat>(String(IC), R|<local>/x|.R|kotlin/Any.toString|())
^toString <strcat>(String(IC), R|<local>/x|)
}
public final data class ProductGroup : R|kotlin/Any| {
public constructor(short_name: R|kotlin/String|, parent: R|ProductGroup?|): R|ProductGroup| {
@@ -24,7 +24,7 @@ FILE: RedundantSingleExpressionStringTemplateChecker.kt
this@R|/ProductGroup|.R|/ProductGroup.short_name|
}
else -> {
<strcat>(this@R|/ProductGroup|.R|/ProductGroup.parent|.R|/ProductGroup.name|.R|kotlin/Any.toString|(), String( ), this@R|/ProductGroup|.R|/ProductGroup.short_name|.R|kotlin/Any.toString|())
<strcat>(this@R|/ProductGroup|.R|/ProductGroup.parent|.R|/ProductGroup.name|, String( ), this@R|/ProductGroup|.R|/ProductGroup.short_name|)
}
}

View File

@@ -75,7 +75,7 @@ open class J {
}
var buf = 0
private get() = 42
<!GETTER_VISIBILITY_DIFFERS_FROM_PROPERTY_VISIBILITY!>private<!> get() = 42
protected set(value) {
field = value
}

View File

@@ -2,7 +2,7 @@ FILE: NotNullTypeChain.kt
public final val list1: R|kotlin/collections/List<kotlin/Int>| = R|kotlin/collections/listOf|<R|kotlin/Int|>(Int(1))
public get(): R|kotlin/collections/List<kotlin/Int>|
public final val list: R|kotlin/collections/List<kotlin/String>| = R|/list1|.R|kotlin/collections/orEmpty|<R|kotlin/Int|>().R|kotlin/collections/map|<R|kotlin/Int|, R|kotlin/String|>(<L> = map@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/String| <inline=Inline, kind=UNKNOWN> {
^ <strcat>(R|<local>/it|.R|kotlin/Any.toString|())
^ <strcat>(R|<local>/it|)
}
)
public get(): R|kotlin/collections/List<kotlin/String>|

View File

@@ -1,8 +1,11 @@
FILE: NoWarning.kt
public final fun foo(): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/Int.rangeTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
}
}
lval a: R|kotlin/ranges/IntRange| = Int(3).R|kotlin/Int.rangeTo|(Int(4))
@@ -14,9 +17,12 @@ FILE: NoWarning.kt
}
public final fun backward(): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/ranges/downTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/ranges/downTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
}
}
lval a: R|kotlin/ranges/IntProgression| = Int(4).R|kotlin/ranges/downTo|(Int(3))
@@ -28,9 +34,12 @@ FILE: NoWarning.kt
}
public final fun until(): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(2)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(2)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
}
}
lval a: R|kotlin/ranges/IntRange| = Int(3).R|kotlin/ranges/until|(Int(4))

View File

@@ -1,8 +1,11 @@
FILE: Warning.kt
public final fun foo(): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(Int(1)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
}
}
lval a: R|kotlin/ranges/IntRange| = Int(10).R|kotlin/Int.rangeTo|(Int(0))
@@ -14,9 +17,12 @@ FILE: Warning.kt
}
public final fun backward(): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/downTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/downTo|(Int(2)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
}
}
lval a: R|kotlin/ranges/IntProgression| = Int(-3).R|kotlin/ranges/downTo|(Int(4))
@@ -28,9 +34,12 @@ FILE: Warning.kt
}
public final fun until(): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(1)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(1).R|kotlin/ranges/until|(Int(1)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
}
}
lval a: R|kotlin/ranges/IntRange| = Int(4).R|kotlin/ranges/until|(Int(3))

View File

@@ -3,18 +3,21 @@ FILE: manyLocalVariables.kt
lvar a: R|kotlin/Int| = Int(1)
lvar b: R|kotlin/Int| = Int(2)
lvar c: R|kotlin/Int| = Int(3)
lval <iterator>: R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
when () {
==(R|<local>/a|, Int(2)) -> {
R|<local>/b| = R|<local>/c|
R|<local>/c| = R|<local>/a|
}
else -> {
R|<local>/b| = R|<local>/a|
R|<local>/c| = R|<local>/b|
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(0).R|kotlin/Int.rangeTo|(Int(5)).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
when () {
==(R|<local>/a|, Int(2)) -> {
R|<local>/b| = R|<local>/c|
R|<local>/c| = R|<local>/a|
}
else -> {
R|<local>/b| = R|<local>/a|
R|<local>/c| = R|<local>/b|
}
}
}
}

View File

@@ -8,12 +8,15 @@ FILE: fib.kt
lvar current: R|kotlin/Int| = Int(1)
lvar prev: R|kotlin/Int| = Int(1)
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(R|<local>/n|).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
lval temp: R|kotlin/Int| = R|<local>/current|
R|<local>/current| = R|<local>/current|.R|kotlin/Int.plus|(R|<local>/prev|)
R|<local>/prev| = R|<local>/temp|
{
lval <iterator>: R|kotlin/collections/IntIterator| = Int(2).R|kotlin/Int.rangeTo|(R|<local>/n|).R|kotlin/ranges/IntProgression.iterator|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval i: R|kotlin/Int| = R|<local>/<iterator>|.R|kotlin/collections/IntIterator.next|()
lval temp: R|kotlin/Int| = R|<local>/current|
R|<local>/current| = R|<local>/current|.R|kotlin/Int.plus|(R|<local>/prev|)
R|<local>/prev| = R|<local>/temp|
}
}
^fibIterative R|<local>/current|

View File

@@ -0,0 +1,61 @@
FILE: funInterfaceDeclaration.kt
public abstract interface Test1 : R|kotlin/Any| {
public abstract fun foo(): R|kotlin/Unit|
public abstract fun boo(): R|kotlin/Unit|
}
public abstract interface Test2 : R|kotlin/Any| {
}
public abstract interface Test3 : R|kotlin/Any| {
public abstract val a: R|kotlin/Int|
public get(): R|kotlin/Int|
public abstract fun foo(): R|kotlin/Unit|
}
public abstract interface Test4 : R|kotlin/Any| {
public abstract fun <T> foo(a: R|T|): R|kotlin/Unit|
}
public abstract interface Test5 : R|kotlin/Any| {
public abstract fun foo(a: R|kotlin/Int| = Int(5)): R|kotlin/Unit|
}
public abstract interface Test6 : R|kotlin/Any| {
public abstract suspend fun foo(): R|kotlin/Unit|
}
public abstract interface Test7 : R|kotlin/Any| {
public abstract fun foo(): R|kotlin/Unit|
}
public abstract interface Test8 : R|Test7| {
public abstract fun boo(): R|kotlin/Unit|
}
public abstract interface Test9 : R|kotlin/Any| {
public open fun num(m: R|kotlin/Int|): R|kotlin/Int| {
^num R|<local>/m|.R|kotlin/Int.times|(R|<local>/m|)
}
}
public abstract interface Test10 : R|Test9| {
public abstract fun test(): R|kotlin/Unit|
}
public abstract interface Test11 : R|kotlin/Any| {
public abstract val a: R|kotlin/Int|
public get(): R|kotlin/Int|
}
public abstract interface Test12 : R|Test11| {
public abstract fun test(): R|kotlin/Unit|
}
public abstract interface Test14 : R|kotlin/Any| {
public abstract suspend fun test(): R|kotlin/Unit|
}
public abstract interface Test15 : R|Test14| {
}

View File

@@ -0,0 +1,45 @@
// !LANGUAGE: -SuspendFunctionsInFunInterfaces
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Test1{
fun foo()
fun boo()
}
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Test2 {}
fun interface Test3 {
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>val<!> a: Int
fun foo()
}
fun interface Test4{
fun <!FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS!><T><!> foo(a: T)
}
fun interface Test5{
fun foo(<!FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE!>a: Int = 5<!>)
}
fun interface Test6{
<!FUN_INTERFACE_WITH_SUSPEND_FUNCTION!>suspend<!> fun foo()
}
fun interface Test7{
fun foo()
}
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface Test8: Test7{
fun boo()
}
interface Test9 {
fun num(m: Int): Int {
return m * m
}
}
fun interface Test10 : Test9 {
fun test()
}
interface Test11 {
val a: Int
}
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>fun<!> interface Test12 : Test11 {
fun test()
}
interface Test14 {
suspend fun test()
}
<!FUN_INTERFACE_WITH_SUSPEND_FUNCTION!>fun<!> interface Test15 : Test14

View File

@@ -5,18 +5,24 @@ FILE: nestedExtensionFunctionType.kt
R|<local>/f|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/a|)
}
public final fun test_1(a: R|A|, ys: R|kotlin/collections/List<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>|): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>| = R|<local>/ys|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval y: R|(A) -> kotlin/Unit| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|(A) -> kotlin/Unit|>|()
R|<local>/y|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/a|)
{
lval <iterator>: R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>| = R|<local>/ys|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval y: R|(A) -> kotlin/Unit| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|(A) -> kotlin/Unit|>|()
R|<local>/y|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/a|)
}
}
}
public final fun test_2(a: R|A|, vararg zs: @R|kotlin/ExtensionFunctionType|() R|kotlin/Array<out @ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>|): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>| = R|<local>/zs|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<CapturedType(out @ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval z: R|(A) -> kotlin/Unit| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|(A) -> kotlin/Unit|>|()
R|<local>/z|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/a|)
{
lval <iterator>: R|kotlin/collections/Iterator<@ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>>| = R|<local>/zs|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<CapturedType(out @ExtensionFunctionType kotlin/Function1<A, kotlin/Unit>)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval z: R|(A) -> kotlin/Unit| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|(A) -> kotlin/Unit|>|()
R|<local>/z|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(R|<local>/a|)
}
}
}

View File

@@ -26,6 +26,6 @@ open class B<V> : A<Any, V>() {
fun test_1(b: B<Int>, x: Int, inv: Inv<Int>) {
b.take(x)
b.take(<!ARGUMENT_TYPE_MISMATCH!>null<!>)
b.take(<!NULL_FOR_NONNULL_TYPE!>null<!>)
b.takeInv(inv)
}

View File

@@ -0,0 +1,25 @@
FILE: leakedImplicitType.kt
public final class Foo : R|kotlin/Any| {
public constructor(): R|Foo| {
super<R|kotlin/Any|>()
}
public final fun bar(): R|kotlin/Unit| {
}
public final fun f(): R|ERROR CLASS: Unresolved reference: bar| {
^f <Unresolved name: Unresolved>#()::<Unresolved reference: bar>#
}
}
public abstract interface IA : R|kotlin/Any| {
}
public abstract interface IB : R|IA| {
}
public final fun R|IA|.extFun(x: R|IB|): R|kotlin/Unit| {
}
public final fun R|IB|.extFun(x: R|IA|): R|kotlin/Unit| {
}
public final fun testWithExpectedType(): R|kotlin/Unit| {
lval extFun_AA_B: R|IA.(IA) -> kotlin/Unit| = Q|IB|::<Unresolved reference: extFun>#
}

View File

@@ -0,0 +1,18 @@
// ISSUE: KT-46072
// Case 1
class Foo {
fun bar() {}
fun f() = <!UNRESOLVED_REFERENCE!>Unresolved<!>()::bar // Type of Unresolved()::bar is implicit
}
// Case 2
interface IA
interface IB : IA
fun IA.extFun(x: IB) {}
fun IB.extFun(x: IA) {}
fun testWithExpectedType() {
val extFun_AA_B: IA.(IA) -> Unit = IB::<!UNRESOLVED_REFERENCE!>extFun<!> // extFun is unresolved, type of IB::extFun is implicit
}

View File

@@ -40,8 +40,8 @@ FILE: referenceToExtension.kt
}
public final fun test_2(): R|kotlin/Unit| {
lval extensionValRef: <ERROR TYPE REF: No result type for initializer> = Q|GenericTest.B|::<Unresolved name: extensionVal>#
lval extensionFunRef: <ERROR TYPE REF: No result type for initializer> = Q|GenericTest.B|::<Unresolved name: extensionFun>#
lval extensionValRef: R|ERROR CLASS: Unresolved reference: extensionVal| = Q|GenericTest.B|::<Unresolved reference: extensionVal>#
lval extensionFunRef: R|ERROR CLASS: Unresolved reference: extensionFun| = Q|GenericTest.B|::<Unresolved reference: extensionFun>#
}
}

View File

@@ -0,0 +1,13 @@
FILE: referenceToField.kt
public final class A : R|kotlin/Any| {
public constructor(): R|A| {
super<R|kotlin/Any|>()
}
public final val x: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int| {
::F|/A.x|
^ this@R|/A|.F|/A.x|
}
}

View File

@@ -0,0 +1,7 @@
class A {
val x: Int = 1
get() {
::<!UNSUPPORTED!>field<!>
return field
}
}

View File

@@ -2,11 +2,11 @@ fun interface MyRunnable {
fun foo(x: Int): Boolean
}
fun interface WithProperty {
val x: Int
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface WithProperty {
<!FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES!>val<!> x: Int
}
fun interface TwoAbstract : MyRunnable {
<!FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS!>fun<!> interface TwoAbstract : MyRunnable {
fun bar()
}

View File

@@ -202,7 +202,7 @@ digraph bangbang_kt {
78 [label="Exit when"];
}
79 [label="Access variable R|<local>/a|"];
80 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
80 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
81 [label="Exit block"];
}
82 [label="Exit function test_3" style="filled" fillcolor=red];
@@ -331,14 +331,14 @@ digraph bangbang_kt {
color=blue
123 [label="Enter block"];
124 [label="Access variable R|<local>/a|"];
125 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
125 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
126 [label="Exit block"];
}
127 [label="Exit when branch result"];
128 [label="Exit when"];
}
129 [label="Access variable R|<local>/a|"];
130 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
130 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
131 [label="Exit block"];
}
132 [label="Exit function test_5" style="filled" fillcolor=red];

View File

@@ -32,7 +32,7 @@ FILE: bangbang.kt
}
}
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun test_4(a: R|A?|, b: R|kotlin/Boolean|): R|kotlin/Unit| {
when () {
@@ -46,11 +46,11 @@ FILE: bangbang.kt
public final fun test_5(a: R|A?|, b: R|kotlin/Boolean|): R|kotlin/Unit| {
when () {
R|<local>/b| || R|<local>/a|!!.R|/A.foo|() -> {
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun <X : R|A?|> test_6(x: R|X|): R|kotlin/Unit| {
R|<local>/x|!!.R|/A.foo|()

View File

@@ -17,7 +17,7 @@ FILE: booleanElvisBoundSmartcast.kt
R|<local>/a|.R|/A.foo|()
}
else -> {
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}
@@ -25,7 +25,7 @@ FILE: booleanElvisBoundSmartcast.kt
public final fun test_2(a: R|A?|): R|kotlin/Unit| {
when () {
R|<local>/a|?.{ $subj$.R|/A.b| } ?: Boolean(true) -> {
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
else -> {
R|<local>/a|.R|/A.foo|()

View File

@@ -46,7 +46,7 @@ digraph equalsToBoolean_kt {
color=blue
17 [label="Enter block"];
18 [label="Access variable R|<local>/b|"];
19 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
19 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
20 [label="Exit block"];
}
21 [label="Exit when branch result"];
@@ -130,7 +130,7 @@ digraph equalsToBoolean_kt {
color=blue
50 [label="Enter block"];
51 [label="Access variable R|<local>/b|"];
52 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
52 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
53 [label="Exit block"];
}
54 [label="Exit when branch result"];
@@ -205,7 +205,7 @@ digraph equalsToBoolean_kt {
color=blue
77 [label="Enter block"];
78 [label="Access variable R|<local>/b|"];
79 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
79 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
80 [label="Exit block"];
}
81 [label="Exit when branch result"];
@@ -271,7 +271,7 @@ digraph equalsToBoolean_kt {
color=blue
98 [label="Enter block"];
99 [label="Access variable R|<local>/b|"];
100 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
100 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
101 [label="Exit block"];
}
102 [label="Exit when branch result"];
@@ -355,7 +355,7 @@ digraph equalsToBoolean_kt {
color=blue
131 [label="Enter block"];
132 [label="Access variable R|<local>/b|"];
133 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
133 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
134 [label="Exit block"];
}
135 [label="Exit when branch result"];
@@ -421,7 +421,7 @@ digraph equalsToBoolean_kt {
color=blue
152 [label="Enter block"];
153 [label="Access variable R|<local>/b|"];
154 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
154 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
155 [label="Exit block"];
}
156 [label="Exit when branch result"];
@@ -496,7 +496,7 @@ digraph equalsToBoolean_kt {
color=blue
179 [label="Enter block"];
180 [label="Access variable R|<local>/b|"];
181 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
181 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
182 [label="Exit block"];
}
183 [label="Exit when branch result"];
@@ -580,7 +580,7 @@ digraph equalsToBoolean_kt {
color=blue
212 [label="Enter block"];
213 [label="Access variable R|<local>/b|"];
214 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()"];
214 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()"];
215 [label="Exit block"];
}
216 [label="Exit when branch result"];

View File

@@ -12,7 +12,7 @@ FILE: equalsToBoolean.kt
R|<local>/b|.R|kotlin/Boolean.not|()
}
else -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
}
@@ -20,7 +20,7 @@ FILE: equalsToBoolean.kt
public final fun test_2(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
when () {
!=(==(R|<local>/b|, Boolean(true)), Boolean(true)) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
else -> {
R|<local>/b|.R|kotlin/Boolean.not|()
@@ -31,7 +31,7 @@ FILE: equalsToBoolean.kt
public final fun test_3(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
when () {
==(==(R|<local>/b|, Boolean(true)), Boolean(false)) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
else -> {
R|<local>/b|.R|kotlin/Boolean.not|()
@@ -45,7 +45,7 @@ FILE: equalsToBoolean.kt
R|<local>/b|.R|kotlin/Boolean.not|()
}
else -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
}
@@ -53,7 +53,7 @@ FILE: equalsToBoolean.kt
public final fun test_5(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
when () {
==(!=(R|<local>/b|, Boolean(true)), Boolean(true)) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
else -> {
R|<local>/b|.R|kotlin/Boolean.not|()
@@ -67,7 +67,7 @@ FILE: equalsToBoolean.kt
R|<local>/b|.R|kotlin/Boolean.not|()
}
else -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
}
@@ -78,7 +78,7 @@ FILE: equalsToBoolean.kt
R|<local>/b|.R|kotlin/Boolean.not|()
}
else -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
}
@@ -86,7 +86,7 @@ FILE: equalsToBoolean.kt
public final fun test_8(b: R|kotlin/Boolean?|): R|kotlin/Unit| {
when () {
!=(!=(R|<local>/b|, Boolean(true)), Boolean(false)) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Boolean.not>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Boolean.not>#()
}
else -> {
R|<local>/b|.R|kotlin/Boolean.not|()

View File

@@ -267,7 +267,7 @@ digraph jumpFromRhsOfOperator_kt {
101 [label="Exit ||"];
}
102 [label="Access variable R|<local>/a|"];
103 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
103 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
104 [label="Exit block"];
}
105 [label="Exit function test_5" style="filled" fillcolor=red];
@@ -309,7 +309,7 @@ digraph jumpFromRhsOfOperator_kt {
117 [label="Exit &&"];
}
118 [label="Access variable R|<local>/a|"];
119 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
119 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
120 [label="Exit block"];
}
121 [label="Exit function teat_6" style="filled" fillcolor=red];
@@ -364,14 +364,14 @@ digraph jumpFromRhsOfOperator_kt {
color=blue
139 [label="Enter block"];
140 [label="Access variable R|<local>/a|"];
141 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
141 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
142 [label="Exit block"];
}
143 [label="Exit when branch result"];
144 [label="Exit when"];
}
145 [label="Access variable R|<local>/a|"];
146 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
146 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
147 [label="Exit block"];
}
148 [label="Exit function test_7" style="filled" fillcolor=red];
@@ -437,14 +437,14 @@ digraph jumpFromRhsOfOperator_kt {
color=blue
166 [label="Enter block"];
167 [label="Access variable R|<local>/a|"];
168 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
168 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
169 [label="Exit block"];
}
170 [label="Exit when branch result"];
171 [label="Exit when"];
}
172 [label="Access variable R|<local>/a|"];
173 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
173 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
174 [label="Exit block"];
}
175 [label="Exit function test_8" style="filled" fillcolor=red];

View File

@@ -31,27 +31,27 @@ FILE: jumpFromRhsOfOperator.kt
}
public final fun test_5(a: R|A?|): R|kotlin/Unit| {
==(R|<local>/a|, Null(null)) || throw R|java/lang/Exception.Exception|()
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun teat_6(a: R|A?|): R|kotlin/Unit| {
!=(R|<local>/a|, Null(null)) && throw R|java/lang/Exception.Exception|()
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun test_7(a: R|A?|): R|kotlin/Unit| {
when () {
==(R|<local>/a|, Null(null)) || throw R|java/lang/Exception.Exception|() -> {
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun test_8(a: R|A?|): R|kotlin/Unit| {
when () {
!=(R|<local>/a|, Null(null)) && throw R|java/lang/Exception.Exception|() -> {
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}

View File

@@ -10,17 +10,20 @@ FILE: boundSmartcastsInBranches.kt
}
public final fun test_0(list: R|kotlin/collections/List<A>|): R|kotlin/Unit| {
lvar goodA: R|A?| = Null(null)
lval <iterator>: R|kotlin/collections/Iterator<A>| = R|<local>/list|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<A>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval a: R|A| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|A|>|()
when () {
==(R|<local>/goodA|, Null(null)) -> {
R|<local>/goodA| = R|<local>/a|
continue@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()]
{
lval <iterator>: R|kotlin/collections/Iterator<A>| = R|<local>/list|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<A>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval a: R|A| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|A|>|()
when () {
==(R|<local>/goodA|, Null(null)) -> {
R|<local>/goodA| = R|<local>/a|
continue@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()]
}
}
R|<local>/goodA|.R|/A.s|
}
R|<local>/goodA|.R|/A.s|
}
}
@@ -132,23 +135,23 @@ FILE: boundSmartcastsInBranches.kt
when () {
!=(R|<local>/x|, Null(null)) -> {
R|<local>/x|.R|kotlin/String.length|
R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/y|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
R|<local>/z|.R|kotlin/String.length|
}
}
when () {
!=(R|<local>/y|, Null(null)) -> {
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/x|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
R|<local>/y|.R|kotlin/String.length|
R|<local>/z|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/z|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}
}
when () {
!=(R|<local>/z|, Null(null)) -> {
R|<local>/x|.R|kotlin/String.length|
R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/y|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
R|<local>/z|.R|kotlin/String.length|
}
}

View File

@@ -136,9 +136,9 @@ digraph equalsAndIdentity_kt {
color=blue
50 [label="Enter block"];
51 [label="Access variable R|<local>/x|"];
52 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
52 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
53 [label="Access variable R|<local>/y|"];
54 [label="Function call: R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
54 [label="Function call: R|<local>/y|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
55 [label="Exit block"];
}
56 [label="Exit when branch result"];
@@ -161,9 +161,9 @@ digraph equalsAndIdentity_kt {
color=blue
66 [label="Enter block"];
67 [label="Access variable R|<local>/x|"];
68 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
68 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
69 [label="Access variable R|<local>/y|"];
70 [label="Function call: R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
70 [label="Function call: R|<local>/y|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
71 [label="Exit block"];
}
72 [label="Exit when branch result"];

View File

@@ -22,15 +22,15 @@ FILE: equalsAndIdentity.kt
public final fun test_2(x: R|A?|, y: R|A?|): R|kotlin/Unit| {
when () {
==(R|<local>/x|, R|<local>/y|) -> {
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
R|<local>/y|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}
when () {
===(R|<local>/x|, R|<local>/y|) -> {
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/y|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
R|<local>/y|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}

View File

@@ -4,7 +4,7 @@ fun a(): Int {
if (c == null ||
0 < c // FE 1.0: smart cast impossible, see KT-10240
) c = 0
return c ?: 0
return c <!USELESS_ELVIS!>?: 0<!>
}
var c: Int = 0

View File

@@ -239,7 +239,7 @@ digraph nullability_kt {
color=blue
76 [label="Enter block"];
77 [label="Access variable R|<local>/x|"];
78 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
78 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
79 [label="Exit block"];
}
80 [label="Exit when branch result"];
@@ -255,7 +255,7 @@ digraph nullability_kt {
87 [label="Exit when"];
}
88 [label="Access variable R|<local>/x|"];
89 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
89 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
90 [label="Exit block"];
}
91 [label="Exit function test_1" style="filled" fillcolor=red];
@@ -323,14 +323,14 @@ digraph nullability_kt {
color=blue
109 [label="Enter block"];
110 [label="Access variable R|<local>/x|"];
111 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
111 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
112 [label="Exit block"];
}
113 [label="Exit when branch result"];
114 [label="Exit when"];
}
115 [label="Access variable R|<local>/x|"];
116 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
116 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
117 [label="Exit block"];
}
118 [label="Exit function test_2" style="filled" fillcolor=red];
@@ -492,11 +492,11 @@ digraph nullability_kt {
176 [label="Access variable R|/Q.data|"];
177 [label="Access variable R|<local>/q|"];
178 [label="Access variable R|/Q.data|"];
179 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
179 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
180 [label="Access variable R|<local>/q|"];
181 [label="Access variable R|/Q.data|"];
182 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
183 [label="Function call: R|<local>/q|.R|/Q.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()"];
182 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
183 [label="Function call: R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()"];
184 [label="Exit block"];
}
185 [label="Exit when branch result"];
@@ -566,11 +566,11 @@ digraph nullability_kt {
208 [label="Access variable R|/Q.data|"];
209 [label="Access variable R|<local>/q|"];
210 [label="Access variable R|/Q.data|"];
211 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
211 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
212 [label="Access variable R|<local>/q|"];
213 [label="Access variable R|/Q.data|"];
214 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
215 [label="Function call: R|<local>/q|.R|/Q.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()"];
214 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
215 [label="Function call: R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()"];
216 [label="Exit block"];
}
217 [label="Exit function test_6" style="filled" fillcolor=red];
@@ -640,11 +640,11 @@ digraph nullability_kt {
239 [label="Function call: R|<local>/q|.R|/Q.fdata|()"];
240 [label="Access variable R|<local>/q|"];
241 [label="Function call: R|<local>/q|.R|/Q.fdata|()"];
242 [label="Function call: R|<local>/q|.R|/Q.fdata|().<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.fs>#()"];
242 [label="Function call: R|<local>/q|.R|/Q.fdata|().<Inapplicable(UNSAFE_CALL): /MyData.fs>#()"];
243 [label="Access variable R|<local>/q|"];
244 [label="Function call: R|<local>/q|.R|/Q.fdata|()"];
245 [label="Function call: R|<local>/q|.R|/Q.fdata|().<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.fs>#()"];
246 [label="Function call: R|<local>/q|.R|/Q.fdata|().<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.fs>#().R|kotlin/Int.inc|()"];
245 [label="Function call: R|<local>/q|.R|/Q.fdata|().<Inapplicable(UNSAFE_CALL): /MyData.fs>#()"];
246 [label="Function call: R|<local>/q|.R|/Q.fdata|().<Inapplicable(UNSAFE_CALL): /MyData.fs>#().R|kotlin/Int.inc|()"];
247 [label="Exit block"];
}
248 [label="Exit when branch result"];
@@ -769,7 +769,7 @@ digraph nullability_kt {
285 [label="Exit when"];
}
286 [label="Access variable R|<local>/b|"];
287 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
287 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
subgraph cluster_66 {
color=blue
288 [label="Enter when"];
@@ -794,7 +794,7 @@ digraph nullability_kt {
301 [label="Exit when"];
}
302 [label="Access variable R|<local>/b|"];
303 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
303 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
subgraph cluster_69 {
color=blue
304 [label="Enter when"];
@@ -819,7 +819,7 @@ digraph nullability_kt {
317 [label="Exit when"];
}
318 [label="Access variable R|<local>/b|"];
319 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
319 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
subgraph cluster_72 {
color=blue
320 [label="Enter when"];
@@ -844,7 +844,7 @@ digraph nullability_kt {
333 [label="Exit when"];
}
334 [label="Access variable R|<local>/b|"];
335 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
335 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
336 [label="Exit block"];
}
337 [label="Exit function test_9" style="filled" fillcolor=red];
@@ -940,14 +940,14 @@ digraph nullability_kt {
color=blue
348 [label="Enter block"];
349 [label="Access variable R|<local>/b|"];
350 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
350 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
351 [label="Exit block"];
}
352 [label="Exit when branch result"];
353 [label="Exit when"];
}
354 [label="Access variable R|<local>/b|"];
355 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
355 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
subgraph cluster_80 {
color=blue
356 [label="Enter when"];
@@ -965,14 +965,14 @@ digraph nullability_kt {
color=blue
364 [label="Enter block"];
365 [label="Access variable R|<local>/b|"];
366 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
366 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
367 [label="Exit block"];
}
368 [label="Exit when branch result"];
369 [label="Exit when"];
}
370 [label="Access variable R|<local>/b|"];
371 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
371 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
subgraph cluster_83 {
color=blue
372 [label="Enter when"];
@@ -990,14 +990,14 @@ digraph nullability_kt {
color=blue
380 [label="Enter block"];
381 [label="Access variable R|<local>/b|"];
382 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
382 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
383 [label="Exit block"];
}
384 [label="Exit when branch result"];
385 [label="Exit when"];
}
386 [label="Access variable R|<local>/b|"];
387 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
387 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
subgraph cluster_86 {
color=blue
388 [label="Enter when"];
@@ -1015,14 +1015,14 @@ digraph nullability_kt {
color=blue
396 [label="Enter block"];
397 [label="Access variable R|<local>/b|"];
398 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
398 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
399 [label="Exit block"];
}
400 [label="Exit when branch result"];
401 [label="Exit when"];
}
402 [label="Access variable R|<local>/b|"];
403 [label="Function call: R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()"];
403 [label="Function call: R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()"];
404 [label="Exit block"];
}
405 [label="Exit function test_10" style="filled" fillcolor=red];
@@ -1139,11 +1139,11 @@ digraph nullability_kt {
436 [label="Access variable R|/QImpl.data|"];
437 [label="Access variable R|<local>/q2|"];
438 [label="Access variable R|/QImpl.data|"];
439 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
439 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
440 [label="Access variable R|<local>/q2|"];
441 [label="Access variable R|/QImpl.data|"];
442 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
443 [label="Function call: R|<local>/q2|.R|/QImpl.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()"];
442 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
443 [label="Function call: R|<local>/q2|.R|/QImpl.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()"];
subgraph cluster_94 {
color=blue
444 [label="Enter when"];
@@ -1280,11 +1280,11 @@ digraph nullability_kt {
490 [label="Access variable R|/QImplWithCustomGetter.data|"];
491 [label="Access variable R|<local>/q|"];
492 [label="Access variable R|/QImplWithCustomGetter.data|"];
493 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
493 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
494 [label="Access variable R|<local>/q|"];
495 [label="Access variable R|/QImplWithCustomGetter.data|"];
496 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
497 [label="Function call: R|<local>/q|.R|/QImplWithCustomGetter.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()"];
496 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
497 [label="Function call: R|<local>/q|.R|/QImplWithCustomGetter.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()"];
498 [label="Exit block"];
}
499 [label="Exit when branch result"];
@@ -1363,11 +1363,11 @@ digraph nullability_kt {
524 [label="Access variable R|/QImplMutable.data|"];
525 [label="Access variable R|<local>/q|"];
526 [label="Access variable R|/QImplMutable.data|"];
527 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
527 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
528 [label="Access variable R|<local>/q|"];
529 [label="Access variable R|/QImplMutable.data|"];
530 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#"];
531 [label="Function call: R|<local>/q|.R|/QImplMutable.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()"];
530 [label="Access variable <Inapplicable(UNSAFE_CALL): /MyData.s>#"];
531 [label="Function call: R|<local>/q|.R|/QImplMutable.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()"];
532 [label="Exit block"];
}
533 [label="Exit when branch result"];

View File

@@ -67,23 +67,23 @@ FILE: nullability.kt
R|<local>/x|.R|/A.foo|()
}
else -> {
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
}
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun test_2(x: R|A?|): R|kotlin/Unit| {
when () {
==(R|<local>/x|, Null(null)) -> {
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
else -> {
R|<local>/x|.R|/A.foo|()
}
}
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}
public final fun test_3(x: R|A?|): R|kotlin/Unit| {
R|<local>/x| ?: ^test_3 Unit
@@ -102,8 +102,8 @@ FILE: nullability.kt
when () {
!=(R|<local>/q|?.{ $subj$.R|/Q.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> {
R|<local>/q|.R|/Q.data|
R|<local>/q|.R|/Q.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#
R|<local>/q|.R|/Q.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()
R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#
R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()
}
}
@@ -111,15 +111,15 @@ FILE: nullability.kt
public final fun test_6(q: R|Q?|): R|kotlin/Unit| {
R|<local>/q|?.{ $subj$.R|/Q.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() } ?: ^test_6 Unit
R|<local>/q|.R|/Q.data|
R|<local>/q|.R|/Q.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#
R|<local>/q|.R|/Q.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()
R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#
R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()
}
public final fun test_7(q: R|Q?|): R|kotlin/Unit| {
when () {
!=(R|<local>/q|?.{ $subj$.R|/Q.fdata|() }?.{ $subj$.R|/MyData.fs|() }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> {
R|<local>/q|.R|/Q.fdata|()
R|<local>/q|.R|/Q.fdata|().<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.fs>#()
R|<local>/q|.R|/Q.fdata|().<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.fs>#().R|kotlin/Int.inc|()
R|<local>/q|.R|/Q.fdata|().<Inapplicable(UNSAFE_CALL): /MyData.fs>#()
R|<local>/q|.R|/Q.fdata|().<Inapplicable(UNSAFE_CALL): /MyData.fs>#().R|kotlin/Int.inc|()
}
}
@@ -139,58 +139,58 @@ FILE: nullability.kt
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
when () {
===(R|<local>/a|, R|<local>/b|) -> {
R|<local>/b|.R|kotlin/Int.inc|()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
when () {
==(R|<local>/b|, R|<local>/a|) -> {
R|<local>/b|.R|kotlin/Int.inc|()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
when () {
===(R|<local>/b|, R|<local>/a|) -> {
R|<local>/b|.R|kotlin/Int.inc|()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
public final fun test_10(a: R|kotlin/Int?|, b: R|kotlin/Int?|): R|kotlin/Unit| {
when () {
==(R|<local>/a|, R|<local>/b|) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
when () {
===(R|<local>/a|, R|<local>/b|) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
when () {
==(R|<local>/b|, R|<local>/a|) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
when () {
===(R|<local>/b|, R|<local>/a|) -> {
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
}
R|<local>/b|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/Int.inc>#()
R|<local>/b|.<Inapplicable(UNSAFE_CALL): kotlin/Int.inc>#()
}
public final fun test_11(q: R|QImpl?|, q2: R|QImpl|): R|kotlin/Unit| {
when () {
@@ -199,8 +199,8 @@ FILE: nullability.kt
R|<local>/q|.R|/QImpl.data|.R|/MyData.s|
R|<local>/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|()
R|<local>/q2|.R|/QImpl.data|
R|<local>/q2|.R|/QImpl.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#
R|<local>/q2|.R|/QImpl.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()
R|<local>/q2|.R|/QImpl.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#
R|<local>/q2|.R|/QImpl.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()
when () {
!=(R|<local>/q2|.R|/QImpl.data|, Null(null)) -> {
R|<local>/q2|.R|/QImpl.data|.R|/MyData.s|
@@ -216,8 +216,8 @@ FILE: nullability.kt
when () {
!=(R|<local>/q|?.{ $subj$.R|/QImplWithCustomGetter.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> {
R|<local>/q|.R|/QImplWithCustomGetter.data|
R|<local>/q|.R|/QImplWithCustomGetter.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#
R|<local>/q|.R|/QImplWithCustomGetter.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()
R|<local>/q|.R|/QImplWithCustomGetter.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#
R|<local>/q|.R|/QImplWithCustomGetter.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()
}
}
@@ -226,8 +226,8 @@ FILE: nullability.kt
when () {
!=(R|<local>/q|?.{ $subj$.R|/QImplMutable.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> {
R|<local>/q|.R|/QImplMutable.data|
R|<local>/q|.R|/QImplMutable.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#
R|<local>/q|.R|/QImplMutable.data|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /MyData.s>#.R|kotlin/Int.inc|()
R|<local>/q|.R|/QImplMutable.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#
R|<local>/q|.R|/QImplMutable.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#.R|kotlin/Int.inc|()
}
}

View File

@@ -22,6 +22,6 @@ fun test_3(a: Any?, b: Boolean) {
fun test_4(a: Any?, b: Boolean) {
if (a is String || b) {
a<!UNSAFE_CALL!>.<!>foo() // Should be Bad
a.<!INAPPLICABLE_CANDIDATE!>foo<!>() // Should be Bad
}
}

View File

@@ -54,7 +54,7 @@ digraph safeCallAndEqualityToBool_kt {
color=blue
21 [label="Enter block"];
22 [label="Access variable R|<local>/s|"];
23 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#"];
23 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
24 [label="Exit block"];
}
25 [label="Exit when branch result"];
@@ -131,7 +131,7 @@ digraph safeCallAndEqualityToBool_kt {
color=blue
49 [label="Enter block"];
50 [label="Access variable R|<local>/s|"];
51 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#"];
51 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
52 [label="Exit block"];
}
53 [label="Exit when branch result"];
@@ -217,7 +217,7 @@ digraph safeCallAndEqualityToBool_kt {
color=blue
83 [label="Enter block"];
84 [label="Access variable R|<local>/s|"];
85 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#"];
85 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
86 [label="Exit block"];
}
87 [label="Exit when branch result"];
@@ -294,7 +294,7 @@ digraph safeCallAndEqualityToBool_kt {
color=blue
111 [label="Enter block"];
112 [label="Access variable R|<local>/s|"];
113 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#"];
113 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
114 [label="Exit block"];
}
115 [label="Exit when branch result"];

View File

@@ -8,7 +8,7 @@ FILE: safeCallAndEqualityToBool.kt
R|<local>/s|.R|kotlin/String.length|
}
else -> {
R|<local>/s|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/s|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}
}
@@ -19,7 +19,7 @@ FILE: safeCallAndEqualityToBool.kt
R|<local>/s|.R|kotlin/String.length|
}
else -> {
R|<local>/s|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/s|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}
}
@@ -27,7 +27,7 @@ FILE: safeCallAndEqualityToBool.kt
public final fun test_3(s: R|kotlin/String?|): R|kotlin/Unit| {
when () {
!=(R|<local>/s|?.{ $subj$.R|/check|() }, Boolean(true)) -> {
R|<local>/s|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/s|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}
else -> {
R|<local>/s|.R|kotlin/String.length|
@@ -38,7 +38,7 @@ FILE: safeCallAndEqualityToBool.kt
public final fun test_4(s: R|kotlin/String?|): R|kotlin/Unit| {
when () {
!=(R|<local>/s|?.{ $subj$.R|/check|() }, Boolean(false)) -> {
R|<local>/s|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/s|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}
else -> {
R|<local>/s|.R|kotlin/String.length|

View File

@@ -53,7 +53,7 @@ digraph safeCalls_kt {
19 [label="Function call: $subj$.R|/foo|(...)"];
20 [label="Exit safe call"];
21 [label="Access variable R|<local>/x|"];
22 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#"];
22 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
23 [label="Exit block"];
}
24 [label="Exit function test" style="filled" fillcolor=red];
@@ -208,7 +208,7 @@ digraph safeCalls_kt {
78 [label="Function call: $subj$.R|/A.bool|()"];
79 [label="Exit safe call"];
80 [label="Access variable R|<local>/x|"];
81 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.id>#()"];
81 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.id>#()"];
82 [label="Exit block"];
}
83 [label="Exit function test_4" style="filled" fillcolor=red];
@@ -272,7 +272,7 @@ digraph safeCalls_kt {
101 [label="Function call: $subj$.R|/boo|(...)"];
102 [label="Exit safe call"];
103 [label="Access variable R|<local>/x|"];
104 [label="Function call: R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.id>#()"];
104 [label="Function call: R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.id>#()"];
105 [label="Exit block"];
}
106 [label="Exit function test_5" style="filled" fillcolor=red];

View File

@@ -6,7 +6,7 @@ FILE: safeCalls.kt
}
public final fun test(x: R|kotlin/String?|): R|kotlin/Unit| {
R|<local>/x|?.{ $subj$.R|/foo|(==(R|<local>/x|.R|kotlin/String.length|, Int(1))) }
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/x|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}
public abstract interface A : R|kotlin/Any| {
public abstract fun bar(a: R|A|): R|kotlin/String|
@@ -28,7 +28,7 @@ FILE: safeCalls.kt
}
public final fun test_4(x: R|A?|): R|kotlin/Unit| {
R|<local>/x|?.{ $subj$.R|/A.id|() }?.{ $subj$.R|/A.bool|() }
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.id>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.id>#()
}
public final fun R|kotlin/Any?|.boo(b: R|kotlin/Boolean|): R|kotlin/Unit| {
}
@@ -37,5 +37,5 @@ FILE: safeCalls.kt
^test_5 Unit
}
) }?.{ $subj$.R|/boo|(R|<local>/x|.R|/A.bool|()) }
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.id>#()
R|<local>/x|.<Inapplicable(UNSAFE_CALL): /A.id>#()
}

View File

@@ -166,83 +166,88 @@ digraph smartcastToNothing_kt {
52 [label="Enter block"];
53 [label="Const: Null(null)"];
54 [label="Variable declaration: lvar s: R|A?|"];
55 [label="Access variable R|<local>/results|"];
56 [label="Function call: R|<local>/results|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Nothing>|>|()"];
57 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<kotlin/Nothing>|"];
subgraph cluster_16 {
color=blue
58 [label="Enter while loop"];
55 [label="Enter block"];
56 [label="Access variable R|<local>/results|"];
57 [label="Function call: R|<local>/results|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Nothing>|>|()"];
58 [label="Variable declaration: lval <iterator>: R|kotlin/collections/Iterator<kotlin/Nothing>|"];
subgraph cluster_17 {
color=blue
59 [label="Enter loop condition"];
60 [label="Access variable R|<local>/<iterator>|"];
61 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
62 [label="Exit loop condition"];
}
subgraph cluster_18 {
color=blue
63 [label="Enter loop block"];
59 [label="Enter while loop"];
subgraph cluster_18 {
color=blue
60 [label="Enter loop condition"];
61 [label="Access variable R|<local>/<iterator>|"];
62 [label="Function call: R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()"];
63 [label="Exit loop condition"];
}
subgraph cluster_19 {
color=blue
64 [label="Enter block"];
65 [label="Access variable R|<local>/<iterator>|"];
66 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Nothing|>|()"];
67 [label="Stub" style="filled" fillcolor=gray];
68 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray];
69 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
70 [label="Stub" style="filled" fillcolor=gray];
71 [label="Assignment: R|<local>/s|" style="filled" fillcolor=gray];
64 [label="Enter loop block"];
subgraph cluster_20 {
color=blue
72 [label="Enter when" style="filled" fillcolor=gray];
65 [label="Enter block"];
66 [label="Access variable R|<local>/<iterator>|"];
67 [label="Function call: R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Nothing|>|()"];
68 [label="Stub" style="filled" fillcolor=gray];
69 [label="Variable declaration: lval result: R|kotlin/Nothing|" style="filled" fillcolor=gray];
70 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
71 [label="Stub" style="filled" fillcolor=gray];
72 [label="Assignment: R|<local>/s|" style="filled" fillcolor=gray];
subgraph cluster_21 {
color=blue
73 [label="Enter when branch condition " style="filled" fillcolor=gray];
74 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
75 [label="Stub" style="filled" fillcolor=gray];
76 [label="Access variable <Unresolved name: b>#" style="filled" fillcolor=gray];
77 [label="Exit when branch condition" style="filled" fillcolor=gray];
73 [label="Enter when" style="filled" fillcolor=gray];
subgraph cluster_22 {
color=blue
74 [label="Enter when branch condition " style="filled" fillcolor=gray];
75 [label="Access variable R|<local>/result|" style="filled" fillcolor=gray];
76 [label="Stub" style="filled" fillcolor=gray];
77 [label="Access variable <Unresolved name: b>#" style="filled" fillcolor=gray];
78 [label="Exit when branch condition" style="filled" fillcolor=gray];
}
79 [label="Synthetic else branch" style="filled" fillcolor=gray];
80 [label="Enter when branch result" style="filled" fillcolor=gray];
subgraph cluster_23 {
color=blue
81 [label="Enter block" style="filled" fillcolor=gray];
82 [label="Jump: break@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray];
83 [label="Stub" style="filled" fillcolor=gray];
84 [label="Exit block" style="filled" fillcolor=gray];
}
85 [label="Exit when branch result" style="filled" fillcolor=gray];
86 [label="Exit when" style="filled" fillcolor=gray];
}
78 [label="Synthetic else branch" style="filled" fillcolor=gray];
79 [label="Enter when branch result" style="filled" fillcolor=gray];
subgraph cluster_22 {
color=blue
80 [label="Enter block" style="filled" fillcolor=gray];
81 [label="Jump: break@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()] " style="filled" fillcolor=gray];
82 [label="Stub" style="filled" fillcolor=gray];
83 [label="Exit block" style="filled" fillcolor=gray];
}
84 [label="Exit when branch result" style="filled" fillcolor=gray];
85 [label="Exit when" style="filled" fillcolor=gray];
87 [label="Exit block" style="filled" fillcolor=gray];
}
86 [label="Exit block" style="filled" fillcolor=gray];
88 [label="Exit loop block" style="filled" fillcolor=gray];
}
87 [label="Exit loop block" style="filled" fillcolor=gray];
89 [label="Exit whileloop"];
}
88 [label="Exit whileloop"];
90 [label="Exit block"];
}
89 [label="Access variable R|<local>/s|"];
90 [label="Enter safe call"];
91 [label="Postponed enter to lambda"];
subgraph cluster_23 {
91 [label="Access variable R|<local>/s|"];
92 [label="Enter safe call"];
93 [label="Postponed enter to lambda"];
subgraph cluster_24 {
color=blue
98 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_24 {
100 [label="Enter function anonymousFunction" style="filled" fillcolor=red];
subgraph cluster_25 {
color=blue
99 [label="Enter block"];
100 [label="Access variable R|<local>/it|"];
101 [label="Access variable R|/A.a|"];
102 [label="Exit block"];
101 [label="Enter block"];
102 [label="Access variable R|<local>/it|"];
103 [label="Access variable R|/A.a|"];
104 [label="Exit block"];
}
103 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
105 [label="Exit function anonymousFunction" style="filled" fillcolor=red];
}
92 [label="Call arguments union" style="filled" fillcolor=yellow];
93 [label="Postponed exit from lambda"];
94 [label="Function call: $subj$.R|kotlin/let|<R|A|, R|kotlin/Int|>(...)"];
95 [label="Exit safe call"];
96 [label="Exit block"];
94 [label="Call arguments union" style="filled" fillcolor=yellow];
95 [label="Postponed exit from lambda"];
96 [label="Function call: $subj$.R|kotlin/let|<R|A|, R|kotlin/Int|>(...)"];
97 [label="Exit safe call"];
98 [label="Exit block"];
}
97 [label="Exit function test_0" style="filled" fillcolor=red];
99 [label="Exit function test_0" style="filled" fillcolor=red];
}
51 -> {52};
52 -> {53};
@@ -255,52 +260,54 @@ digraph smartcastToNothing_kt {
59 -> {60};
60 -> {61};
61 -> {62};
62 -> {88 63};
63 -> {64};
62 -> {63};
63 -> {89 64};
64 -> {65};
65 -> {66};
66 -> {97} [label=onUncaughtException];
66 -> {67} [style=dotted];
66 -> {67};
67 -> {99} [label=onUncaughtException];
67 -> {68} [style=dotted];
68 -> {69} [style=dotted];
69 -> {70} [style=dotted];
69 -> {97} [style=dotted] [label=onUncaughtException];
70 -> {71} [style=dotted];
70 -> {99} [style=dotted] [label=onUncaughtException];
71 -> {72} [style=dotted];
72 -> {73} [style=dotted];
73 -> {74} [style=dotted];
74 -> {75} [style=dotted];
74 -> {97} [style=dotted] [label=onUncaughtException];
75 -> {76} [style=dotted];
75 -> {99} [style=dotted] [label=onUncaughtException];
76 -> {77} [style=dotted];
77 -> {79 78} [style=dotted];
78 -> {85} [style=dotted];
79 -> {80} [style=dotted];
77 -> {78} [style=dotted];
78 -> {80 79} [style=dotted];
79 -> {86} [style=dotted];
80 -> {81} [style=dotted];
81 -> {88 82} [style=dotted];
82 -> {83} [style=dotted];
81 -> {82} [style=dotted];
82 -> {89 83} [style=dotted];
83 -> {84} [style=dotted];
84 -> {85} [style=dotted];
85 -> {86} [style=dotted];
86 -> {87} [style=dotted];
87 -> {59} [color=green style=dotted];
88 -> {89};
89 -> {90 95};
87 -> {88} [style=dotted];
88 -> {60} [color=green style=dotted];
89 -> {90};
90 -> {91};
91 -> {98};
91 -> {93} [color=red];
91 -> {98} [style=dashed];
92 -> {94} [color=red];
93 -> {94} [color=green];
94 -> {95};
95 -> {96};
91 -> {92 97};
92 -> {93};
93 -> {100};
93 -> {95} [color=red];
93 -> {100} [style=dashed];
94 -> {96} [color=red];
95 -> {96} [color=green];
96 -> {97};
97 -> {98};
98 -> {99};
99 -> {100};
100 -> {101};
101 -> {102};
102 -> {103};
103 -> {92} [color=red];
103 -> {93} [color=green];
103 -> {104};
104 -> {105};
105 -> {94} [color=red];
105 -> {95} [color=green];
}

View File

@@ -30,14 +30,17 @@ FILE: smartcastToNothing.kt
}
public final fun test_0(results: R|kotlin/collections/List<kotlin/Nothing>|): R|kotlin/Unit| {
lvar s: R|A?| = Null(null)
lval <iterator>: R|kotlin/collections/Iterator<kotlin/Nothing>| = R|<local>/results|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Nothing>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval result: R|kotlin/Nothing| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Nothing|>|()
R|<local>/s| = R|<local>/result|
when () {
R|<local>/result|.<Unresolved name: b># -> {
break@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()]
{
lval <iterator>: R|kotlin/collections/Iterator<kotlin/Nothing>| = R|<local>/results|.R|SubstitutionOverride<kotlin/collections/List.iterator: R|kotlin/collections/Iterator<kotlin/Nothing>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval result: R|kotlin/Nothing| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/Nothing|>|()
R|<local>/s| = R|<local>/result|
when () {
R|<local>/result|.<Unresolved name: b># -> {
break@@@[R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()]
}
}
}
}

View File

@@ -77,7 +77,7 @@ digraph delayedAssignment_kt {
32 [label="Exit when"];
}
33 [label="Access variable R|<local>/a|"];
34 [label="Function call: R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()"];
34 [label="Function call: R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()"];
35 [label="Exit block"];
}
36 [label="Exit function test" style="filled" fillcolor=red];

View File

@@ -20,5 +20,5 @@ FILE: delayedAssignment.kt
}
}
R|<local>/a|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /A.foo>#()
R|<local>/a|.<Inapplicable(UNSAFE_CALL): /A.foo>#()
}

View File

@@ -103,7 +103,7 @@ digraph smartcastAfterReassignment_kt {
40 [label="Const: Null(null)"];
41 [label="Assignment: R|<local>/x|"];
42 [label="Access variable R|<local>/x|"];
43 [label="Access variable <Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#"];
43 [label="Access variable <Inapplicable(UNSAFE_CALL): kotlin/String.length>#"];
44 [label="Exit block"];
}
45 [label="Exit function test_3" style="filled" fillcolor=red];

View File

@@ -19,5 +19,5 @@ FILE: smartcastAfterReassignment.kt
R|<local>/x| = String()
R|<local>/x|.R|kotlin/String.length|
R|<local>/x| = Null(null)
R|<local>/x|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): kotlin/String.length>#
R|<local>/x|.<Inapplicable(UNSAFE_CALL): kotlin/String.length>#
}

View File

@@ -14,5 +14,5 @@ class Test5<T, B> {
fun <Z> topLevelFun() {
<!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>class Test8<!> : Error()
val obj = <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS{LT}!><!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS{PSI}!>object<!> : Throwable() {}<!>
val obj = <!INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS!>object<!> : Throwable() {}
}

View File

@@ -9,18 +9,24 @@ FILE: varargInPrimaryConstructor.kt
}
public final fun test_1(foo: R|Foo|): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/Iterator<kotlin/String>| = R|<local>/foo|.R|/Foo.strings|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<CapturedType(out kotlin/String)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval s: R|kotlin/String| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/String|>|()
R|<local>/s|.R|kotlin/String.length|
{
lval <iterator>: R|kotlin/collections/Iterator<kotlin/String>| = R|<local>/foo|.R|/Foo.strings|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<CapturedType(out kotlin/String)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval s: R|kotlin/String| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/String|>|()
R|<local>/s|.R|kotlin/String.length|
}
}
}
public final fun test_2(vararg strings: R|kotlin/Array<out kotlin/String>|): R|kotlin/Unit| {
lval <iterator>: R|kotlin/collections/Iterator<kotlin/String>| = R|<local>/strings|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<CapturedType(out kotlin/String)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval s: R|kotlin/String| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/String|>|()
R|<local>/s|.R|kotlin/String.length|
{
lval <iterator>: R|kotlin/collections/Iterator<kotlin/String>| = R|<local>/strings|.R|SubstitutionOverride<kotlin/Array.iterator: R|kotlin/collections/Iterator<CapturedType(out kotlin/String)>|>|()
while(R|<local>/<iterator>|.R|kotlin/collections/Iterator.hasNext|()) {
lval s: R|kotlin/String| = R|<local>/<iterator>|.R|SubstitutionOverride<kotlin/collections/Iterator.next: R|kotlin/String|>|()
R|<local>/s|.R|kotlin/String.length|
}
}
}

View File

@@ -2,12 +2,12 @@ class A {
companion object Comp {}
fun foo() {
<!HIDDEN!>Comp<!>()
<!INVISIBLE_REFERENCE!>Comp<!>()
}
}
object B {
private val x = <!HIDDEN!>B<!>()
private val x = <!INVISIBLE_REFERENCE!>B<!>()
}
class D {

View File

@@ -19,5 +19,5 @@ abstract class A {
// FILE: main.kt
fun test(b: B): String {
return b <!HIDDEN!>foo<!> "hello" // should be an error
return b <!INVISIBLE_REFERENCE!>foo<!> "hello" // should be an error
}

View File

@@ -13,7 +13,7 @@ FILE: beyoundCalls.kt
}
public final fun foo(): R|kotlin/Unit| {
lval x: R|(kotlin/String) -> kotlin/Int| = ::R|/bar|
lval y: <ERROR TYPE REF: No result type for initializer> = ::<Unresolved reference: bar>#
lval y: R|ERROR CLASS: Ambiguity: bar, [/bar, /bar]| = ::<Ambiguity: bar, [/bar, /bar]>#
lval z: R|kotlin/reflect/KFunction1<kotlin/String, kotlin/Int>| = ::R|/baz|
lval w: R|(kotlin/String) -> kotlin/Int| = ::R|/foobaz<kotlin/String, kotlin/Int>|
::R|/baz|

View File

@@ -6,7 +6,7 @@ fun <T, R> foobaz(x: T): R = TODO()
fun foo() {
val x: (String) -> Int = ::bar
val y = ::<!UNRESOLVED_REFERENCE!>bar<!>
val y = ::<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!>
val z = ::baz
val w: (String) -> Int = ::foobaz

View File

@@ -6,5 +6,5 @@ FILE: ambiguityWhenNoApplicableCallableReferenceCandidate.kt
public final fun <T> bar(f: R|(T) -> kotlin/Unit|): R|kotlin/Unit| {
}
public final fun test(): R|kotlin/Unit| {
R|/bar|<R|kotlin/Any?|>(::<Unresolved reference: foo>#)
R|/bar|<R|kotlin/Any?|>(::<Ambiguity: foo, [/foo, /foo]>#)
}

View File

@@ -4,5 +4,5 @@ fun foo(y: String) {}
fun <T> bar(f: (T) -> Unit) {}
fun test() {
bar(::<!UNRESOLVED_REFERENCE!>foo<!>)
bar(::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>)
}

View File

@@ -37,7 +37,7 @@ FILE: chooseCallableReferenceDependingOnInferredReceiver.kt
lval a: R|A| = R|/bar|<R|A|>(::R|/A.foo|)
lval b: R|B| = R|/bar|<R|B|>(::R|/B.foo|)
lval t3: R|B| = R|/bar|<R|B|>(::R|/B.baz|)
^ R|/bar|<R|kotlin/Nothing|>(::<Unresolved reference: foo>#)
^ R|/bar|<R|kotlin/Nothing|>(::<Ambiguity: foo, [/B.foo, /B.foo]>#)
}
)
}

View File

@@ -25,7 +25,7 @@ fun test() {
val t3 = bar(::baz)
bar(::<!UNRESOLVED_REFERENCE!>foo<!>)
bar(::<!OVERLOAD_RESOLUTION_AMBIGUITY!>foo<!>)
}
}
}

View File

@@ -21,5 +21,5 @@ FILE: eagerAndPostponedCallableReferences.kt
lval a4: R|B| = R|/foo|<R|B|>(::R|/multiple|, ::R|/singleB|)
lval a5: R|A| = R|/foo|<R|A|>(::R|/singleA|, ::R|/singleA|)
lval a6: R|it(A & B)| = R|/foo|<R|it(A & B)|>(::R|/singleA|, ::R|/singleB|)
R|/foo|<R|kotlin/Nothing|>(::<Unresolved reference: multiple>#, ::<Unresolved reference: multiple>#)
R|/foo|<R|kotlin/Nothing|>(::<Ambiguity: multiple, [/multiple, /multiple]>#, ::<Ambiguity: multiple, [/multiple, /multiple]>#)
}

Some files were not shown because too many files have changed in this diff Show More