Compare commits

...

97 Commits

Author SHA1 Message Date
Nikolay Krasko
ef6995bd85 Fix too frequent check for compiler modification 2016-04-29 14:59:34 +02:00
Nikolay Krasko
517a9e13c4 Write Action: Add write action for template finish processor (KT-11418) 2016-04-28 20:02:08 +03:00
Nikolay Krasko
063ab78b98 Add write action for shorten references in finish template after building call (KT-12056)
Write action was removed in idea 146

 #KT-12056 Fixed
2016-04-28 16:35:19 +03:00
Nikolay Krasko
6ad10aa51d Add write action for shortening references in templates (KT-11418)
Write action was removed in idea 146.

#KT-11418 Fixed
2016-04-28 16:34:18 +03:00
Nikolay Krasko
e4efbd3b9d Update until version for new idea build numbering 2016-04-28 16:33:26 +03:00
Yan Zhulanow
de3dcebff9 Fix EA-79598: getNode() in JspxImportListImpl returns null (cherry picked from commit 047828b) 2016-03-28 14:46:22 +03:00
Mikhail Glukhikh
5b1213c5d1 Changelog: 1.0.1-2 2016-03-25 17:19:56 +03:00
Michael Bogdanov
662df527c7 Fix for KT-11590: IllegalAccessError: SAM adapter generated with invalid accessibility for inline function
#KT-11590 Fixed
(cherry picked from commit d0aac74)
2016-03-24 15:32:37 +01:00
Michael Bogdanov
2a507e881b Fix for KT-11584: Regression in 1.0.1: incorrect comparison of Long! with integer constant
#KT-11584 Fixed
(cherry picked from commit a851bb0)
2016-03-24 09:02:31 +01:00
Mikhail Glukhikh
659112c56a Changelog: 1.0.1-1 + minor update to 1.0.1 2016-03-22 17:56:36 +03:00
Michael Bogdanov
b4649ba28c Fix for KT-11478: "Couldn't inline method call" error
#KT-11478 Fixed
(cherry picked from commit b95e27f)
2016-03-18 11:53:42 +01:00
Denis Zharkov
405991fde7 Fix common supertype calculation
Use star-projections instead of 'out Any?' in corner cases

 #KT-11468 Fixed
2016-03-17 16:15:43 +03:00
Mikhail Glukhikh
7d131edc49 KT-9434 added to Changelog 2016-03-15 19:01:28 +03:00
Alexey Tsvetkov
9104f7348b Fix NoSuchMethodError with Gradle 2.12
#KT-11351 fixed
2016-03-15 18:06:32 +03:00
Mikhail Glukhikh
ffd6197f2b Minor: FILE directives fixed in two tests
(cherry picked from commit 7232c5c)
2016-03-14 15:53:35 +03:00
Mikhail Glukhikh
d6a3aa10a4 KT-10752 added to Changelog 2016-03-14 14:22:21 +03:00
Mikhail Glukhikh
5d7727cf66 Strictfp on a class is now a warning #KT-11109 Fixed
(cherry picked from commit f76efb6)
2016-03-12 21:28:56 +03:00
Mikhail Glukhikh
68bf0be332 Minor 2016-03-11 17:17:28 +03:00
Mikhail Glukhikh
c8be8e8498 Changelog update 2016-03-11 17:10:52 +03:00
Mikhail Glukhikh
1e16d0ef3e Changelog for 1.0.1 2016-03-11 16:25:02 +03:00
Ilya Gorbunov
b9712f1d49 kotlin.test: Make inline methods 'todo' and 'currentStackTrace' @InlineOnly not to loose stack trace.
Comment out assertion for line number in 1.0.1 since the feature it relies on will be available only in 1.0.2.
#KT-11348 Fixed
(cherry picked from commit 92003f6)
2016-03-11 13:38:10 +03:00
Ilya Gorbunov
d262346261 kotlin.test: Mark reified assertFailsWith with InlineOnly to preserve stack traces.
(cherry picked from commit bf536af)
2016-03-11 13:37:47 +03:00
Ilya Gorbunov
331cde9a98 Minor: correct file name
(cherry picked from commit 119eceb)
2016-03-11 13:19:54 +03:00
Pavel V. Talanov
b1ebc0b4e8 Minor, FunctionCodegen: add additional logging on missing function descriptor
Trying to diagnose light class building failures
2016-03-10 19:51:05 +03:00
Pavel V. Talanov
03f6bf6a56 Refactor, minor: extract exception logging to an util object 2016-03-10 19:51:03 +03:00
Pavel V. Talanov
9e6d2b3b03 Add KtPsiFactory#createFileWithLightClassSupport
Allows to create light classes for KtFile built from text
2016-03-10 19:43:44 +03:00
Pavel V. Talanov
be2165a3f0 Refactor: Provide API to create KtLightClassForFacade by synthetic file 2016-03-10 19:43:42 +03:00
Pavel V. Talanov
b93371ba96 Minor: remove obsolete properties from KtLightClassForFacade 2016-03-10 19:43:40 +03:00
Dmitry Jemerov
5ecef132c4 use Kotlin icon for Gradle framework support provider
(cherry picked from commit 3626e90)
2016-03-08 17:32:52 +01:00
Dmitry Jemerov
0edced305c use regular Kotlin icon to represent Kotlin run configurations, leave old LAUNCH icon only for REPL
#KT-11041 Fixed
(cherry picked from commit ad48ff6)
2016-03-08 17:32:42 +01:00
Dmitry Jemerov
accc152ff2 use 16x16 icons for framework types and library presentations
(cherry picked from commit 94fc588)
2016-03-08 17:32:32 +01:00
Denis Zharkov
2c595194f1 Fix bridge generation for special builtin override
Use method itself signature as common bridge delegate

 #KT-11285 Fixed

Conflicts:
	compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java
2016-03-07 09:52:01 +03:00
Nikolay Krasko
61394521e9 Revert "Consider only pinned builds for bootstrapping"
This reverts commit db117dfebf.
2016-03-04 20:49:28 +03:00
Nikolay Krasko
db117dfebf Consider only pinned builds for bootstrapping 2016-03-04 20:17:56 +03:00
Nikolay Krasko
58c589c781 Do not depend on MOVE_SEARCH_FOR_REFERENCES_FOR_FILE global setting
Always search for references if something is under source root and disable search otherwise.

 #KT-11277 Fixed
2016-03-04 19:44:39 +03:00
Nikolay Krasko
2eb5eeb884 Don't intercept move when there're no kotlin files
#KT-11277 Fixed
2016-03-04 19:44:32 +03:00
Pavel V. Talanov
d49b3b75ee Fix typechecker in case of "for ((a, b) in) { }"
Fixes NDFDE
2016-03-04 16:56:16 +03:00
Pavel V. Talanov
37c74d4160 Parameters of function types are always considered local 2016-03-04 16:56:13 +03:00
Pavel V. Talanov
155f043a52 Add additional check to AbstractPsiCheckerTest
Check that KtDeclaration.resolveToDescriptor() utility does not throw
2016-03-04 16:56:11 +03:00
Pavel V. Talanov
29327e77a0 Throw ISE earlier on passing certain types of declaration to ResolveSession#resolveToDescriptor() 2016-03-04 16:56:10 +03:00
Michael Bogdanov
f478a417ec Write additional type parameters for DefaultImpls methods, fix for KT-11121: BadClassFile exception for interface implemented generic properties
#KT-11121 Fixed

(cherry picked from commit 534a3a11d6)

Conflicts:
	compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java
	compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java
2016-03-04 14:16:08 +03:00
Nikolay Krasko
274ba38616 New project wizard with Gradle and Kotlin creates build.gradle with absent version (KT-11213)
#KT-11213 Fixed
2016-03-03 17:32:08 +03:00
Valentin Kipyatkov
e297bd3879 Enhanced constructor descriptor should not loose its source!
#KT-11256 Fixed
(cherry picked from commit 5aca50b)
2016-03-02 21:46:31 +03:00
Valentin Kipyatkov
6211386ab3 More diagnostic for EA-75975
(cherry picked from commit 508e193)
2016-03-02 21:46:23 +03:00
Valentin Kipyatkov
50a340f09d Fixed EA-70945
(cherry picked from commit 135ec78)
2016-03-02 21:46:15 +03:00
Dmitry Jemerov
2ab4965ee9 don't crash on startup in case of corrupted plugin installation
#KT-11230 Fixed
(cherry picked from commit 386f224)
2016-03-02 18:19:46 +01:00
Ilya Chernikov
03e17c02d8 Fixing daemon memory test on windows by increasing the expected threshold
(cherry picked from commit c39cec4)
2016-03-02 19:03:39 +03:00
Dmitry Petrov
6701cc61ff Do not use 'dup' for postfix increment/decrement: can't do it with collection element in general.
KT-11190, KT-11191, KT-11192, KT-11200, KT-11206
(cherry picked from commit e9b4608)
2016-03-02 14:16:33 +03:00
Mikhail Glukhikh
027ee64f88 Enable override version back 2016-03-02 14:04:16 +03:00
Dmitry Petrov
c5caf592c6 Do not use 'dup' for postfix increment/decrement: can't do it with collection element in general.
KT-11190, KT-11191, KT-11192, KT-11200, KT-11206
(cherry picked from commit e9b4608)
2016-03-02 13:39:44 +03:00
Dmitry Petrov
84eb074fb6 KT-11203: report errors on read-write operations for elements of collections with inconsistent get&set signatures
(cherry picked from commit 6f922ff)
2016-03-02 13:39:40 +03:00
Dmitry Jemerov
2b659dde13 correctly detect Gradle modules (previous code, besides being crazy overcomplicated, didn't always work because module.getModuleFile() returns null immediately after a project has been imported from Gradle and before it has been saved)
(cherry picked from commit 207c5e1)
2016-03-02 11:19:02 +01:00
Mikhail Glukhikh
10d46ed791 Temporary disable override version 2016-03-02 11:14:18 +03:00
Michael Bogdanov
75f68f2cb7 Internal visibility to TestGroup 2016-03-01 19:42:45 +03:00
Nikolay Krasko
4b17f1f7f3 Refactoring: rename file 2016-03-01 19:20:05 +03:00
Nikolay Krasko
e417290da8 Refactoring: extract methods from JSLibraryStdPresentationProvider 2016-03-01 19:20:04 +03:00
Nikolay Krasko
246fac37bd Refactoring: extract methods from JavaRuntimePresentationProvider 2016-03-01 19:20:02 +03:00
Nikolay Krasko
099067615a J2K: LibraryPresentationProviderUtil convert 2016-03-01 19:20:01 +03:00
Nikolay Krasko
679b87444a J2K: LibraryPresentationProviderUtil rename 2016-03-01 19:20:00 +03:00
Nikolay Krasko
becbc367d0 Don't detect libraries in maven, gradle and ide systems as runtime libraries
#KT-11072 Fixed
 #KT-10918 Fixed
2016-03-01 19:19:59 +03:00
Nikolay Krasko
0f8cb3cb24 Minor: drop deprecated methods and remove warnings in library presentation providers 2016-03-01 19:19:58 +03:00
Nikolay Krasko
02614fb060 Configure Kotlin in Project: "All modules containing Kotlin files" lists modules even not containing those files (KT-10831)
#KT-10831 Fixed
2016-03-01 19:19:57 +03:00
Natalia Ukhorskaya
735ff553aa Rearrange Colors page for Kotlin
(cherry picked from commit 7b1afa1)
2016-03-01 10:59:11 +03:00
Natalia Ukhorskaya
3d9cc57eec Highlight super and this as keywords
(cherry picked from commit e0cb0eb)
2016-03-01 10:56:26 +03:00
Natalia Ukhorskaya
0e7dbb6359 Change some colors in Darcula after refactoring of colors in IDEA
(cherry picked from commit d361aca)
2016-03-01 10:56:20 +03:00
Jake Wharton
c6ca60e5c4 Include source folders from registered source-generating tasks.
This includes the output directories from tasks which generate Java code which were registered with registerJavaGeneratingTask().
(cherry picked from commit 0d6ec35)
2016-03-01 10:55:16 +03:00
Michael Bogdanov
56c4101cda Fix for KT-11117: Android Kotlin DEX transformation error when I use arrayOf as an anonymous object property
#KT-11117 Fixed
(cherry picked from commit 16afe74)
2016-02-29 12:59:47 +03:00
Ilya Gorbunov
a7f28916b6 Minor: improve wording in the deprecation message.
(cherry picked from commit a100ffd)
2016-02-27 00:32:40 +03:00
Pavel V. Talanov
18002cef3c Revert 06215ca932
It led to parameter names missing in parameter info and completion for compiled java code used from kotlin
See KT-11039
2016-02-26 14:37:09 +03:00
Nikolay Krasko
372f9bd3dd Print kotlin compiler version in build script where withKotlin tag is used 2016-02-25 20:07:34 +03:00
Michael Bogdanov
69b42f4716 Prohibited @Strictfp annotation on classes (it's not supported yet), Fix for KT-11109: Strictfp annotation do nothing when applied to class
#KT-11109 Fixed
(cherry picked from commit 1b94904)
2016-02-25 18:08:40 +03:00
Michael Bogdanov
c9d76638b8 Fix for KT-11163: Incorrect codegen in case of custom compareTo on primitives
#KT-11163 Fixed
(cherry picked from commit 582b1c5)
2016-02-25 10:17:10 +03:00
Alexander Udalov
5447227e6d Fix NCDFE on primitive iterators during boxing optimization
The real fix is in ProgressionIteratorBasicValue's constructor, other changes
are refactorings

 #KT-11153 Fixed
2016-02-22 19:49:59 +03:00
Ilya Gorbunov
cf2c67b7d7 Mark CollectionAssertions as deprecated due to their experimental status.
(cherry picked from commit acc6cc5)
2016-02-21 03:42:01 +03:00
Zalim Bashorov
072bf93a56 New IC: don't fail on unsupported difference kinds and process SUPERTYPE_ID_LIST correctly
(cherry picked from commit 05eff90)
2016-02-19 19:12:40 +03:00
Michael Bogdanov
83005f06aa Fix for KT-11081: Reified type parameters are lost in anonymous object in inline function when using default value parameters
#KT-11081 Fixed
(cherry picked from commit 405c21a)
2016-02-19 14:22:59 +03:00
Alexander Udalov
6daed3b5a5 Fix visibility flags for lambda classes in InnerClasses attribute 2016-02-19 12:53:05 +03:00
Ilya Chernikov
ad193125e8 fixing test after changing cleanup scheme - first it is now required to rebuild sources, and therefore consumed memory is increased 2016-02-18 21:34:07 +01:00
Ilya Chernikov
2fef9e310a performing cleanup (and memory usage reporting) only if kotlin compiler was actually called, should fix e.g. KT-10127 2016-02-18 21:34:07 +01:00
Alexey Tsvetkov
dae98d699a Call System.gc only when when log level is debug, fixes KT-11022 2016-02-18 21:34:07 +01:00
Natalia Ukhorskaya
f699e9ae9b Replace deprecated usages of CodeInsightColors 2016-02-18 18:39:55 +03:00
Ilya Gorbunov
cc27486815 Create at most one wrapper sequence for adjacent drop/take operations on sequences.
Based on PR #814 by Sargun Vohra
#KT-10821 Fixed
(cherry picked from commit 24edbc3)
2016-02-18 17:40:23 +03:00
nik
07debfa751 until-build set to 146.9999 to make Kotlin plugin compatible with new IDEA builds
(cherry picked from commit c69d332)
2016-02-18 12:44:18 +01:00
Denis Zharkov
212f1e3e32 Optimize completion for overridden descriptors 2016-02-16 12:03:58 +03:00
Denis Zharkov
c3437055ee Run slow flexible type assertions only in test mode 2016-02-16 12:03:58 +03:00
Denis Zharkov
fad588a602 Drop unnecessary call to substituted 'overriddenDescriptors' 2016-02-16 12:03:58 +03:00
Denis Zharkov
71612edf1d Do not run enhancement for fake overrides with one overridden 2016-02-16 12:03:58 +03:00
Denis Zharkov
7f931cce03 Optimize ErasedOverridabilityCondition
Do not start substitution if some basic conditions are failed
2016-02-16 12:03:58 +03:00
Denis Zharkov
e5d7ade4b3 Optimize SamAdapterOverridabilityCondition
Do not calculate it for non-static members,
because SAM adapters only exist in static scope now
2016-02-16 12:03:58 +03:00
Denis Zharkov
faff2579ec Optimize external overridability conditions
- Skip ones that can lead only to success after first success
- And vice versa
2016-02-16 12:03:57 +03:00
Denis Zharkov
edef244c2d Memoize 'JavaTypeClassifierImpl.isRaw' result 2016-02-16 12:03:57 +03:00
Denis Zharkov
3387327bc0 Optimize ResolvedCallImpl for case of empty pararameter set 2016-02-16 12:03:57 +03:00
Dmitry Jemerov
7847a020ba trim -release- from plugin version number when checking whether the runtime is outdated
(cherry picked from commit 2a8e1af)
2016-02-15 16:31:20 +01:00
Dmitry Jemerov
45798475e9 K
(cherry picked from commit 8549ec7)
2016-02-15 16:30:52 +01:00
Pavel V. Talanov
6114362904 Fix "<" or ">" in member name leading to exception 2016-02-15 13:39:17 +03:00
Pavel V. Talanov
fd876a3547 Fix stub/ast mismatch for old binaries (rc-1036) in newer versions of plugin 2016-02-15 12:46:34 +03:00
Stanislav Erokhin
958f5a4ab3 Use last successful build in 1.0.1 as bootstrap. Enable force version increment. 2016-02-12 20:03:07 +03:00
227 changed files with 3126 additions and 752 deletions

118
Changelog.md Normal file
View File

@@ -0,0 +1,118 @@
# CHANGELOG
<!-- Find: ([^\[/])(KT-\d+) -->
<!-- Replace: $1[$2](https://youtrack.jetbrains.com/issue/$2) -->
## 1.0.1-2
### Compiler
- [KT-11584](https://youtrack.jetbrains.com/issue/KT-11584), [KT-11514](https://youtrack.jetbrains.com/issue/KT-11514) Correct comparison of Long! / Double! with integer constant
- [KT-11590](https://youtrack.jetbrains.com/issue/KT-11590) SAM adapter for inline function corrected
## 1.0.1-1
### Compiler
- [KT-11468](https://youtrack.jetbrains.com/issue/KT-11468) More correct use-site / declaration-site variance combination handling
- [KT-11478](https://youtrack.jetbrains.com/issue/KT-11478) "Couldn't inline method call" internal compiler error fixed
## 1.0.1
### Compiler
Analysis & diagnostics issues fixed:
- [KT-2277](https://youtrack.jetbrains.com/issue/KT-2277) Local function declarations are now checked for overload conflicts
- [KT-3602](https://youtrack.jetbrains.com/issue/KT-3602) Special diagnostic is reported now on nullable for range
- [KT-10775](https://youtrack.jetbrains.com/issue/KT-10775) No compilation exception for empty when
- [KT-10952](https://youtrack.jetbrains.com/issue/KT-10952) False deprecation warnings removed
- [KT-10934](https://youtrack.jetbrains.com/issue/KT-10934) Type inference improved for whens
- [KT-10902](https://youtrack.jetbrains.com/issue/KT-10902) Redeclaration is reported for top-level property vs classifier conflict
- [KT-9985](https://youtrack.jetbrains.com/issue/KT-9985) Correct handling of safe call arguments in generic functions
- [KT-10856](https://youtrack.jetbrains.com/issue/KT-10856) Diagnostic about projected out member is reported correctly on calls with smart cast receiver
- [KT-5190](https://youtrack.jetbrains.com/issue/KT-5190) Calls of Java 8 Stream.collect
- [KT-11109](https://youtrack.jetbrains.com/issue/KT-11109) Warning is reported on Strictfp annotation on a class because it's not supported yet
- [KT-10686](https://youtrack.jetbrains.com/issue/KT-10686) Support generic constructors defined in Java
- [KT-6958](https://youtrack.jetbrains.com/issue/KT-6958) Fixed resolution for overloaded functions with extension lambdas
- [KT-10765](https://youtrack.jetbrains.com/issue/KT-10765) Correct handling of overload conflict between constructor and function in JPS
- [KT-10752](https://youtrack.jetbrains.com/issue/KT-10752) If inferred type for an expression refers to a non-accessible Java class, it's a compiler error to prevent IAE in runtime
- [KT-7415](https://youtrack.jetbrains.com/issue/KT-7415) Approximation of captured types in signatures
- [KT-10913](https://youtrack.jetbrains.com/issue/KT-10913), [KT-10186](https://youtrack.jetbrains.com/issue/KT-10186), [KT-5198](https://youtrack.jetbrains.com/issue/KT-5198) False “unreachable code” fixed for various situations
- Minor: [KT-3680](https://youtrack.jetbrains.com/issue/KT-3680), [KT-9702](https://youtrack.jetbrains.com/issue/KT-9702), [KT-8776](https://youtrack.jetbrains.com/issue/KT-8776), [KT-6745](https://youtrack.jetbrains.com/issue/KT-6745), [KT-10919](https://youtrack.jetbrains.com/issue/KT-10919), [KT-9548](https://youtrack.jetbrains.com/issue/KT-9548)
JVM code generation issues fixed:
- [KT-11153](https://youtrack.jetbrains.com/issue/KT-11153) NoClassDefFoundError is fixed on primitive iterators during boxing optimization
- [KT-7319](https://youtrack.jetbrains.com/issue/KT-7319) Correct parameter names for @JvmOverloads-generated methods
- [KT-10425](https://youtrack.jetbrains.com/issue/KT-10425) Non-const values of member properties are not inlined now
- [KT-11163](https://youtrack.jetbrains.com/issue/KT-11163) Correct calls of custom compareTo on primitives
- [KT-11081](https://youtrack.jetbrains.com/issue/KT-11081) Reified type parameters are correctly stored in anonymous objects
- [KT-11121](https://youtrack.jetbrains.com/issue/KT-11121) Generic properties generation is fixed for interfaces
- [KT-11285](https://youtrack.jetbrains.com/issue/KT-11285), [KT-10958](https://youtrack.jetbrains.com/issue/KT-10958) Special bridge generation refined
- [KT-10313](https://youtrack.jetbrains.com/issue/KT-10313), [KT-11190](https://youtrack.jetbrains.com/issue/KT-11190), [KT-11192](https://youtrack.jetbrains.com/issue/KT-11192), [KT-11130](https://youtrack.jetbrains.com/issue/KT-11130) Diagnostics and bytecode fixed for various operations with Long
- [KT-11203](https://youtrack.jetbrains.com/issue/KT-11203), [KT-11191](https://youtrack.jetbrains.com/issue/KT-11191), [KT-11206](https://youtrack.jetbrains.com/issue/KT-11206), [KT-8505](https://youtrack.jetbrains.com/issue/KT-8505), [KT-11203](https://youtrack.jetbrains.com/issue/KT-11203) Handling of increment / decrement for collection elements with user-defined get / set fixed
- [KT-9739](https://youtrack.jetbrains.com/issue/KT-9739) Backticked names with spaces are generated correctly
JS translator issues fixed:
- [KT-7683](https://youtrack.jetbrains.com/issue/KT-7683), [KT-11027](https://youtrack.jetbrains.com/issue/KT-11027) correct handling of in / !in inside when expressions
### Standard library
- [KT-10579](https://youtrack.jetbrains.com/issue/KT-10579) Improved performance of sum() and average() for arrays
- [KT-10821](https://youtrack.jetbrains.com/issue/KT-10821) Improved performance of drop() / take() for sequences
### IDE
New features:
- Compatibility with IDEA 2016
- Kotlin Education Plugin (for IDEA 2016)
- [KT-9752](https://youtrack.jetbrains.com/issue/KT-9752) More usable file chooser for "Move declaration to another file"
- [KT-9697](https://youtrack.jetbrains.com/issue/KT-9697) Move method to companion object and back
General issues fixed:
- [KT-11277](https://youtrack.jetbrains.com/issue/KT-11277) Correct moving of Java classes from project view
- [KT-11256](https://youtrack.jetbrains.com/issue/KT-11256) Navigate Declaration fixed for Java classes with @NotNull parameter in constructor
- [KT-10553](https://youtrack.jetbrains.com/issue/KT-10553) A warning provided when Refactor / Move result is not compilable due to visibility problems
- [KT-11039](https://youtrack.jetbrains.com/issue/KT-11039) Parameter names are now not missing in parameter info and completion for compiled java code used from kotlin
- [KT-10204](https://youtrack.jetbrains.com/issue/KT-10204) Highlight usages in file is working now for function parameter
- [KT-10954](https://youtrack.jetbrains.com/issue/KT-10954) Introduce Parameter (Ctrl+Alt+P) fixed when default value is a simple name reference
- [KT-10776](https://youtrack.jetbrains.com/issue/KT-10776) Intentions: "Convert to lambda expression" works now for empty function body
- [KT-10815](https://youtrack.jetbrains.com/issue/KT-10815) Generate equals() and hashCode() is no more suggested for interfaces
- [KT-10818](https://youtrack.jetbrains.com/issue/KT-10818) "Initialize with constructor parameter" fixed
- [KT-8876](https://youtrack.jetbrains.com/issue/KT-8876) "Convert member to extension" now removes modality modifiers (open / final)
- [KT-10800](https://youtrack.jetbrains.com/issue/KT-10800) Create enum entry now adds comma after a new entry
- [KT-10552](https://youtrack.jetbrains.com/issue/KT-10552) Pull Members Up now takes visibility conflicts into account
- [KT-10978](https://youtrack.jetbrains.com/issue/KT-10978) Partially fixed, completion for JOOQ became ~ 10 times faster
- [KT-10940](https://youtrack.jetbrains.com/issue/KT-10940) Reference search optimized for convention functions
- [KT-9026](https://youtrack.jetbrains.com/issue/KT-9026) Editor no more locks up during scala file viewing
- [KT-11142](https://youtrack.jetbrains.com/issue/KT-11142), [KT-11276](https://youtrack.jetbrains.com/issue/KT-11276) Darkula scheme appearance corrected for Kotlin
- Minor: [KT-10778](https://youtrack.jetbrains.com/issue/KT-10778), [KT-10763](https://youtrack.jetbrains.com/issue/KT-10763), [KT-10908](https://youtrack.jetbrains.com/issue/KT-10908), [KT-10345](https://youtrack.jetbrains.com/issue/KT-10345), [KT-10696](https://youtrack.jetbrains.com/issue/KT-10696), [KT-11041](https://youtrack.jetbrains.com/issue/KT-11041), [KT-9434](https://youtrack.jetbrains.com/issue/KT-9434)
Configuration issues fixed:
- [KT-11213](https://youtrack.jetbrains.com/issue/KT-11213) Kotlin plugin version corrected in build.gradle
- [KT-10918](https://youtrack.jetbrains.com/issue/KT-10918) "Update Kotlin runtime" action does not try to update the runtime coming in from Gradle
- [KT-11072](https://youtrack.jetbrains.com/issue/KT-11072) Libraries in maven, gradle and ide systems are never more detected as runtime libraries
- [KT-10489](https://youtrack.jetbrains.com/issue/KT-10489) Configuration messages are aggregated into one notification
- [KT-10831](https://youtrack.jetbrains.com/issue/KT-10831) Configure Kotlin in Project: "All modules containing Kotlin files" does not list modules not containing Kotlin files
- [KT-10366](https://youtrack.jetbrains.com/issue/KT-10366) Gradle import: no fake "Configure Kotlin" notification on project creating
Debugger issues fixed:
- [KT-10827](https://youtrack.jetbrains.com/issue/KT-10827) Fixed debugger stepping for inline calls
- [KT-10780](https://youtrack.jetbrains.com/issue/KT-10780) Breakpoints in a lazy property work correctly
- [KT-10634](https://youtrack.jetbrains.com/issue/KT-10634) Watches can now use private overloaded functions
- [KT-10611](https://youtrack.jetbrains.com/issue/KT-10611) Line breakpoints now can be created inside lambda in init block
- [KT-10673](https://youtrack.jetbrains.com/issue/KT-10673) Breakpoints inside lambda are no more ignored in presence of crossinline function parameter
- [KT-11318](https://youtrack.jetbrains.com/issue/KT-11318) Stepping inside for each is optimized
- [KT-3873](https://youtrack.jetbrains.com/issue/KT-3873) Editing code while standing on breakpoint is optimized
- [KT-7261](https://youtrack.jetbrains.com/issue/KT-7261), [KT-7266](https://youtrack.jetbrains.com/issue/KT-7266), [KT-10672](https://youtrack.jetbrains.com/issue/KT-10672) Evaluate expression applicability corrected
### Tools
- [KT-7943](https://youtrack.jetbrains.com/issue/KT-7943), [KT-10127](https://youtrack.jetbrains.com/issue/KT-10127) Overhead removed in Kotlin Gradle Plugin
- [KT-11351](https://youtrack.jetbrains.com/issue/KT-11351) Fixed NoSuchMethodError with Gradle 2.12

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -156,15 +156,6 @@ private abstract class DifferenceCalculator() {
}
private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: ProtoMapValue) : DifferenceCalculator() {
companion object {
private val CLASS_SIGNATURE_ENUMS = EnumSet.of(
ProtoBufClassKind.FLAGS,
ProtoBufClassKind.FQ_NAME,
ProtoBufClassKind.TYPE_PARAMETER_LIST,
ProtoBufClassKind.SUPERTYPE_LIST
)
}
val oldClassData = JvmProtoBufUtil.readClassDataFrom(oldData.bytes, oldData.strings)
val newClassData = JvmProtoBufUtil.readClassDataFrom(newData.bytes, newData.strings)
@@ -223,11 +214,17 @@ private class DifferenceCalculatorForClass(oldData: ProtoMapValue, newData: Prot
ProtoBufClassKind.TYPE_TABLE -> {
// TODO
}
in CLASS_SIGNATURE_ENUMS -> {
ProtoBufClassKind.FLAGS,
ProtoBufClassKind.FQ_NAME,
ProtoBufClassKind.TYPE_PARAMETER_LIST,
ProtoBufClassKind.SUPERTYPE_LIST,
ProtoBufClassKind.SUPERTYPE_ID_LIST-> {
isClassAffected = true
areSubclassesAffected = true
}
else -> throw IllegalArgumentException("Unsupported kind: $kind")
ProtoBufClassKind.CLASS_MODULE_NAME -> {
// TODO
}
}
}
@@ -262,7 +259,8 @@ private class DifferenceCalculatorForPackageFacade(oldData: ProtoMapValue, newDa
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getFunctionList))
ProtoBufPackageKind.PROPERTY_LIST ->
names.addAll(calcDifferenceForNonPrivateMembers(ProtoBuf.Package::getPropertyList))
ProtoBufPackageKind.TYPE_TABLE -> {
ProtoBufPackageKind.TYPE_TABLE,
ProtoBufPackageKind.PACKAGE_MODULE_NAME -> {
// TODO
}
else -> throw IllegalArgumentException("Unsupported kind: $kind")

View File

@@ -551,7 +551,9 @@
<javac2 destdir="${output}/classes/compiler" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-compiler"/>
<withKotlin modulename="kotlin-compiler">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/jvm/internal/.*"/>
<skip pattern="kotlin/Metadata"/>
<src refid="compilerSources.path"/>
@@ -609,7 +611,9 @@
<javac2 destdir="${output}/classes/kotlin-build-common" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-build-common"/>
<withKotlin modulename="kotlin-build-common">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/jvm/internal/.*"/>
<src>
<pathelement path="build-common/src"/>
@@ -682,7 +686,9 @@
<target name="android-compiler-plugin">
<cleandir dir="${output}/classes/android-compiler-plugin"/>
<javac2 destdir="${output}/classes/android-compiler-plugin" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false">
<withKotlin modulename="kotlin-android-compiler-plugin"/>
<withKotlin modulename="kotlin-android-compiler-plugin">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/jvm/internal/.*"/>
<skip pattern="kotlin/Metadata"/>
<src>
@@ -707,7 +713,9 @@
<cleandir dir="${output}/classes/ant"/>
<javac2 destdir="${output}/classes/ant" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-ant-tools"/>
<withKotlin modulename="kotlin-ant-tools">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/jvm/internal/.*"/>
<skip pattern="kotlin/Metadata"/>
<src>
@@ -1057,7 +1065,9 @@
<javac2 destdir="${output}/classes/idea-analysis" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"
source="${java.target}" target="${java.target}">
<withKotlin modulename="kotlin-for-upsource"/>
<withKotlin modulename="kotlin-for-upsource">
<compilerarg value="-version"/>
</withKotlin>
<skip pattern="kotlin/jvm/internal/.*"/>
<skip pattern="kotlin/Metadata"/>
<src>

View File

@@ -255,7 +255,10 @@ public class AsmUtil {
For other cases use getVisibilityAccessFlag(MemberDescriptor descriptor)
Classes in byte code should be public or package private
*/
public static int getVisibilityAccessFlagForClass(ClassDescriptor descriptor) {
public static int getVisibilityAccessFlagForClass(@NotNull ClassDescriptor descriptor) {
if (descriptor instanceof SyntheticClassDescriptorForLambda) {
return getVisibilityAccessFlagForAnonymous(descriptor);
}
if (descriptor.getVisibility() == Visibilities.PUBLIC ||
// TODO: should be package private, but for now Kotlin's reflection can't access members of such classes
descriptor.getVisibility() == Visibilities.LOCAL ||
@@ -265,12 +268,17 @@ public class AsmUtil {
return NO_FLAG_PACKAGE_PRIVATE;
}
public static int getVisibilityAccessFlagForAnonymous(@NotNull ClassDescriptor descriptor) {
private static int getVisibilityAccessFlagForAnonymous(@NotNull ClassDescriptor descriptor) {
return InlineUtil.isInlineOrContainingInline(descriptor.getContainingDeclaration()) ? ACC_PUBLIC : NO_FLAG_PACKAGE_PRIVATE;
}
public static int calculateInnerClassAccessFlags(@NotNull ClassDescriptor innerClass) {
int visibility = (innerClass.getVisibility() == Visibilities.LOCAL) ? ACC_PUBLIC : getVisibilityAccessFlag(innerClass);
int visibility =
innerClass instanceof SyntheticClassDescriptorForLambda
? getVisibilityAccessFlagForAnonymous(innerClass)
: innerClass.getVisibility() == Visibilities.LOCAL
? ACC_PUBLIC
: getVisibilityAccessFlag(innerClass);
return visibility |
innerAccessFlagsForModalityAndKind(innerClass) |
(innerClass.isInner() ? 0 : ACC_STATIC);
@@ -549,22 +557,31 @@ public class AsmUtil {
}
public static void genIncrement(Type expectedType, int myDelta, InstructionAdapter v) {
if (expectedType == Type.LONG_TYPE) {
v.lconst(myDelta);
numConst(myDelta, expectedType, v);
v.add(expectedType);
}
public static void numConst(int value, Type type, InstructionAdapter v) {
if (type == Type.FLOAT_TYPE) {
v.fconst(value);
}
else if (expectedType == Type.FLOAT_TYPE) {
v.fconst(myDelta);
else if (type == Type.DOUBLE_TYPE) {
v.dconst(value);
}
else if (expectedType == Type.DOUBLE_TYPE) {
v.dconst(myDelta);
else if (type == Type.LONG_TYPE) {
v.lconst(value);
}
else if (type == Type.CHAR_TYPE || type == Type.BYTE_TYPE || type == Type.SHORT_TYPE || type == Type.INT_TYPE) {
v.iconst(value);
}
else {
v.iconst(myDelta);
v.add(Type.INT_TYPE);
StackValue.coerce(Type.INT_TYPE, expectedType, v);
return;
throw new IllegalArgumentException("Primitive numeric type expected, got: " + type);
}
v.add(expectedType);
}
public static void genIncrement(Type expectedType, Type baseType, int myDelta, InstructionAdapter v) {
genIncrement(baseType, myDelta, v);
StackValue.coerce(baseType, expectedType, v);
}
public static void swap(InstructionAdapter v, Type stackTop, Type afterTop) {

View File

@@ -126,7 +126,7 @@ public class ClosureCodegen extends MemberCodegen<KtElement> {
this.asmType = typeMapper.mapClass(classDescriptor);
visibilityFlag = AsmUtil.getVisibilityAccessFlagForAnonymous(classDescriptor);
visibilityFlag = AsmUtil.getVisibilityAccessFlagForClass(classDescriptor);
}
@Override

View File

@@ -0,0 +1,31 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen
import com.intellij.openapi.diagnostic.Logger
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.psi.psiUtil.getElementTextWithContext
object ExceptionLogger {
@JvmStatic
fun logDescriptorNotFound(problemDescription: String, psi: PsiElement): AssertionError {
LOG.error(problemDescription, psi.getElementTextWithContext())
throw AssertionError(problemDescription)
}
private val LOG = Logger.getInstance(ExceptionLogger::class.java)
}

View File

@@ -37,6 +37,7 @@ import org.jetbrains.kotlin.codegen.binding.CodegenBinding;
import org.jetbrains.kotlin.codegen.context.*;
import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension;
import org.jetbrains.kotlin.codegen.inline.*;
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicCallable;
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethod;
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods;
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicPropertyGetter;
@@ -2270,7 +2271,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
final Type asmType =
state.getSamWrapperClasses().getSamWrapperClass(samType, expression.getContainingKtFile(), getParentCodegen());
state.getSamWrapperClasses().getSamWrapperClass(samType, expression.getContainingKtFile(), this);
return StackValue.operation(asmType, new Function1<InstructionAdapter, Unit>() {
@Override
@@ -3085,7 +3086,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
StackValue rightValue;
Type leftType = expressionType(left);
Type rightType = expressionType(right);
if (isPrimitive(leftType) && isPrimitive(rightType)) {
Callable callable = resolveToCallable((FunctionDescriptor) resolvedCall.getResultingDescriptor(), false, resolvedCall);
if (isPrimitive(leftType) && isPrimitive(rightType) && callable instanceof IntrinsicCallable) {
type = comparisonOperandType(leftType, rightType);
leftValue = gen(left);
rightValue = gen(right);
@@ -3263,26 +3265,31 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
return StackValue.operation(asmBaseType, new Function1<InstructionAdapter, Unit>() {
@Override
public Unit invoke(InstructionAdapter v) {
StackValue value = gen(expression.getBaseExpression());
value = StackValue.complexWriteReadReceiver(value);
StackValue value = StackValue.complexWriteReadReceiver(gen(expression.getBaseExpression()));
Type type = expressionType(expression.getBaseExpression());
value.put(type, v); // old value
value.put(asmBaseType, v);
AsmUtil.dup(v, asmBaseType);
value.dup(v, true);
StackValue previousValue = StackValue.local(myFrameMap.enterTemp(asmBaseType), asmBaseType);
previousValue.store(StackValue.onStack(asmBaseType), v);
Type storeType;
if (isPrimitiveNumberClassDescriptor && AsmUtil.isPrimitive(asmBaseType)) {
genIncrement(asmResultType, increment, v);
storeType = type;
genIncrement(asmResultType, asmBaseType, increment, v);
storeType = asmBaseType;
}
else {
StackValue result = invokeFunction(resolvedCall, StackValue.onStack(type));
StackValue result = invokeFunction(resolvedCall, StackValue.onStack(asmBaseType));
result.put(result.type, v);
storeType = result.type;
}
value.store(StackValue.onStack(storeType), v, true);
previousValue.put(asmBaseType, v);
myFrameMap.leaveTemp(asmBaseType);
return Unit.INSTANCE;
}
});

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,8 +106,9 @@ public class FunctionCodegen {
public void gen(@NotNull KtNamedFunction function) {
SimpleFunctionDescriptor functionDescriptor = bindingContext.get(BindingContext.FUNCTION, function);
assert functionDescriptor != null : "No descriptor for function " + function.getText() + "\n" +
"in " + function.getContainingFile().getVirtualFile();
if (functionDescriptor == null) {
throw ExceptionLogger.logDescriptorNotFound("No descriptor for function " + function.getName(), function);
}
if (owner.getContextKind() != OwnerKind.DEFAULT_IMPLS || function.hasBody()) {
generateMethod(JvmDeclarationOriginKt.OtherOrigin(function, functionDescriptor), functionDescriptor,
@@ -789,6 +790,9 @@ public class FunctionCodegen {
if (receiverParameter != null) {
frameMap.enter(receiverParameter, state.getTypeMapper().mapType(receiverParameter));
}
else {
frameMap.enterTemp(parameter.getAsmType());
}
}
else if (parameter.getKind() != JvmMethodParameterKind.VALUE) {
frameMap.enterTemp(parameter.getAsmType());

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -99,9 +99,9 @@ public class PropertyCodegen {
public void gen(@NotNull KtProperty property) {
VariableDescriptor variableDescriptor = bindingContext.get(BindingContext.VARIABLE, property);
if (!(variableDescriptor instanceof PropertyDescriptor)) {
String problem = "Property " + property.getName() + " should have a property descriptor: " + variableDescriptor;
LOG.error(problem, PsiUtilsKt.getElementTextWithContext(property));
throw new AssertionError(problem);
throw ExceptionLogger.logDescriptorNotFound(
"Property " + property.getName() + " should have a property descriptor: " + variableDescriptor, property
);
}
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) variableDescriptor;

View File

@@ -66,7 +66,7 @@ class PropertyReferenceCodegen(
v.defineClass(
element,
V1_6,
ACC_FINAL or ACC_SUPER or AsmUtil.getVisibilityAccessFlagForAnonymous(classDescriptor),
ACC_FINAL or ACC_SUPER or AsmUtil.getVisibilityAccessFlagForClass(classDescriptor),
asmType.internalName,
null,
superAsmType.internalName,

View File

@@ -29,6 +29,7 @@ import org.jetbrains.kotlin.psi.*;
import org.jetbrains.kotlin.resolve.DescriptorUtils;
import org.jetbrains.kotlin.types.KotlinType;
import java.util.Arrays;
import java.util.List;
import static org.jetbrains.kotlin.builtins.KotlinBuiltIns.RANGES_PACKAGE_FQ_NAME;
@@ -38,15 +39,9 @@ public class RangeCodegenUtil {
private static final ImmutableMap<FqName, PrimitiveType> RANGE_TO_ELEMENT_TYPE;
private static final ImmutableMap<FqName, PrimitiveType> PROGRESSION_TO_ELEMENT_TYPE;
private static PrimitiveType[] supportedRangeTypes() {
return new PrimitiveType[] {
PrimitiveType.CHAR,
PrimitiveType.INT,
PrimitiveType.LONG,
// deprecated:
PrimitiveType.BYTE,
PrimitiveType.SHORT,
};
@NotNull
public static List<PrimitiveType> supportedRangeTypes() {
return Arrays.asList(PrimitiveType.CHAR, PrimitiveType.INT, PrimitiveType.LONG);
}
static {

View File

@@ -1,49 +0,0 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen;
import com.google.common.collect.Maps;
import com.intellij.openapi.util.Factory;
import com.intellij.openapi.util.Pair;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.org.objectweb.asm.Type;
import java.util.Map;
public class SamWrapperClasses {
private final GenerationState state;
private final Map<Pair<SamType, KtFile>, Type> samInterfaceToWrapperClass = Maps.newHashMap();
public SamWrapperClasses(@NotNull GenerationState state) {
this.state = state;
}
@NotNull
public Type getSamWrapperClass(@NotNull final SamType samType, @NotNull final KtFile file, @NotNull final MemberCodegen<?> parentCodegen) {
return ContainerUtil.getOrCreate(samInterfaceToWrapperClass, Pair.create(samType, file),
new Factory<Type>() {
@Override
public Type create() {
return new SamWrapperCodegen(state, samType, parentCodegen).genWrapper(file);
}
});
}
}

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.codegen.state.GenerationState
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.resolve.inline.InlineUtil
import org.jetbrains.org.objectweb.asm.Type
class SamWrapperClasses(private val state: GenerationState) {
private data class WrapperKey(val samType: SamType, val file: KtFile, val insideInline: Boolean)
private val samInterfaceToWrapperClass = hashMapOf<WrapperKey, Type>()
fun getSamWrapperClass(samType: SamType, file: KtFile, expressionCodegen: ExpressionCodegen): Type {
val isInsideInline = InlineUtil.isInlineOrContainingInline(expressionCodegen.context.contextDescriptor)
return samInterfaceToWrapperClass.getOrPut(WrapperKey(samType, file, isInsideInline)) {
SamWrapperCodegen(state, samType, expressionCodegen.parentCodegen, isInsideInline).genWrapper(file)
}
}
}

View File

@@ -49,17 +49,27 @@ public class SamWrapperCodegen {
private static final String FUNCTION_FIELD_NAME = "function";
private final GenerationState state;
private final boolean isInsideInline;
private final JetTypeMapper typeMapper;
private final SamType samType;
private final MemberCodegen<?> parentCodegen;
private final int visibility;
public SamWrapperCodegen(@NotNull GenerationState state, @NotNull SamType samType, @NotNull MemberCodegen<?> parentCodegen) {
public SamWrapperCodegen(
@NotNull GenerationState state,
@NotNull SamType samType,
@NotNull MemberCodegen<?> parentCodegen,
boolean isInsideInline
) {
this.state = state;
this.isInsideInline = isInsideInline;
this.typeMapper = state.getTypeMapper();
this.samType = samType;
this.parentCodegen = parentCodegen;
visibility = isInsideInline ? ACC_PUBLIC : NO_FLAG_PACKAGE_PRIVATE;
}
@NotNull
public Type genWrapper(@NotNull KtFile file) {
// Name for generated class, in form of whatever$1
FqName fqName = getWrapperName(file);
@@ -88,7 +98,7 @@ public class SamWrapperCodegen {
ClassBuilder cv = state.getFactory().newVisitor(JvmDeclarationOriginKt.OtherOrigin(erasedInterfaceFunction), asmType, file);
cv.defineClass(file,
V1_6,
ACC_FINAL | ACC_SUPER,
ACC_FINAL | ACC_SUPER | visibility,
asmType.getInternalName(),
null,
OBJECT_TYPE.getInternalName(),
@@ -118,7 +128,7 @@ public class SamWrapperCodegen {
private void generateConstructor(Type ownerType, Type functionType, ClassBuilder cv) {
MethodVisitor mv = cv.newMethod(JvmDeclarationOriginKt.OtherOrigin(samType.getJavaClassDescriptor()),
NO_FLAG_PACKAGE_PRIVATE, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, functionType), null, null);
visibility, "<init>", Type.getMethodDescriptor(Type.VOID_TYPE, functionType), null, null);
if (state.getClassBuilderMode() == ClassBuilderMode.FULL) {
mv.visitCode();
@@ -177,9 +187,10 @@ public class SamWrapperCodegen {
int hash = PackagePartClassUtils.getPathHashCode(containingFile.getVirtualFile()) * 31 +
DescriptorUtils.getFqNameSafe(descriptor).hashCode();
String shortName = String.format(
"%s$sam$%s$%08x",
"%s$sam$%s%s$%08x",
fileClassFqName.shortName().asString(),
descriptor.getName().asString(),
(isInsideInline ? "$i" : ""),
hash
);
return fileClassFqName.parent().child(Name.identifier(shortName));

View File

@@ -0,0 +1,38 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen
import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.impl.ClassDescriptorImpl
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.resolve.source.toSourceElement
import org.jetbrains.kotlin.types.KotlinType
class SyntheticClassDescriptorForLambda(
containingDeclaration: DeclarationDescriptor,
name: Name,
supertypes: Collection<KotlinType>,
element: KtElement
) : ClassDescriptorImpl(containingDeclaration, name, Modality.FINAL, ClassKind.CLASS, supertypes, element.toSourceElement()) {
init {
initialize(MemberScope.Empty, emptySet(), null)
}
}

View File

@@ -24,10 +24,7 @@ import kotlin.jvm.functions.Function1;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.cfg.WhenChecker;
import org.jetbrains.kotlin.codegen.AsmUtil;
import org.jetbrains.kotlin.codegen.JvmRuntimeTypes;
import org.jetbrains.kotlin.codegen.SamCodegenUtil;
import org.jetbrains.kotlin.codegen.SamType;
import org.jetbrains.kotlin.codegen.*;
import org.jetbrains.kotlin.codegen.state.GenerationState;
import org.jetbrains.kotlin.codegen.when.SwitchCodegenUtil;
import org.jetbrains.kotlin.codegen.when.WhenByEnumsMapping;
@@ -94,15 +91,12 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
@NotNull String name
) {
String simpleName = name.substring(name.lastIndexOf('/') + 1);
ClassDescriptorImpl classDescriptor = new ClassDescriptorImpl(
ClassDescriptor classDescriptor = new SyntheticClassDescriptorForLambda(
correctContainerForLambda(callableDescriptor, element),
Name.special("<closure-" + simpleName + ">"),
Modality.FINAL,
ClassKind.CLASS,
supertypes,
KotlinSourceElementKt.toSourceElement(element)
element
);
classDescriptor.initialize(MemberScope.Empty.INSTANCE, Collections.<ConstructorDescriptor>emptySet(), null);
bindingTrace.record(CLASS_FOR_CALLABLE, callableDescriptor, classDescriptor);
return classDescriptor;

View File

@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.calls.callUtil.getParentCall
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeAsSequence
import org.jetbrains.kotlin.utils.addIfNotNull
import org.jetbrains.kotlin.utils.singletonOrEmptyList
import java.util.*
@@ -75,10 +76,6 @@ object BuiltinSpecialBridgesUtil {
val commonBridges = reachableDeclarations.mapTo(LinkedHashSet<Signature>(), signatureByDescriptor)
commonBridges.removeAll(specialBridgesSignaturesInSuperClass + specialBridge?.from.singletonOrEmptyList())
val superImplementationDescriptor = findSuperImplementationForStubDelegation(function, fake)
if (superImplementationDescriptor != null || !fake || functionHandle.isAbstract) {
commonBridges.remove(methodItself)
}
if (fake) {
for (overridden in function.overriddenDescriptors.map { it.original }) {
@@ -88,13 +85,28 @@ object BuiltinSpecialBridgesUtil {
}
}
val bridges: MutableSet<BridgeForBuiltinSpecial<Signature>> =
(commonBridges.map { BridgeForBuiltinSpecial(it, specialBridgeSignature) } + specialBridge.singletonOrEmptyList()).toMutableSet()
val bridges: MutableSet<BridgeForBuiltinSpecial<Signature>> = mutableSetOf()
// Can be null if special builtin is final (e.g. 'name' in Enum)
// because there should be no stubs for override in subclasses
val superImplementationDescriptor = findSuperImplementationForStubDelegation(function, fake)
if (superImplementationDescriptor != null) {
bridges.add(BridgeForBuiltinSpecial(methodItself, signatureByDescriptor(superImplementationDescriptor), isDelegateToSuper = true))
}
if (commonBridges.remove(methodItself)) {
if (superImplementationDescriptor == null && fake && !functionHandle.isAbstract && methodItself != specialBridgeSignature) {
// The only case when superImplementationDescriptor, but method is fake and not abstract is enum members
// They have superImplementationDescriptor null because they are final
// generate non-synthetic bridge 'getOrdinal()' to 'ordinal()' (see test enumAsOrdinaled.kt)
bridges.add(BridgeForBuiltinSpecial(methodItself, specialBridgeSignature, isSpecial = false, isDelegateToSuper = false))
}
}
bridges.addAll(commonBridges.map { BridgeForBuiltinSpecial(it, methodItself) })
bridges.addIfNotNull(specialBridge)
return bridges
}

View File

@@ -285,7 +285,8 @@ public class MethodInliner {
super.visitMethodInsn(opcode, changeOwnerForExternalPackage(owner, opcode), name, desc, itf);
}
}
else if (ReifiedTypeInliner.isNeedClassReificationMarker(new MethodInsnNode(opcode, owner, name, desc, false))) {
else if (ReifiedTypeInliner.isNeedClassReificationMarker(new MethodInsnNode(opcode, owner, name, desc, false)) &&
!isDefaultCompilation()) {
// we will put it if needed in anew processing
}
else {
@@ -372,7 +373,7 @@ public class MethodInliner {
) {
if (isInliningLambda || InlineCodegenUtil.GENERATE_SMAP) {
String varSuffix = inliningContext.isRoot() &&
!((RootInliningContext) inliningContext).isDefaultCompilation &&
!isDefaultCompilation() &&
!InlineCodegenUtil.isFakeLocalVariableForInline(name) ?
INLINE_FUN_VAR_SUFFIX : "";
String varName = !varSuffix.isEmpty() && name.equals("this") ? name + "_" : name;
@@ -440,7 +441,7 @@ public class MethodInliner {
if (frame != null) {
if (ReifiedTypeInliner.isNeedClassReificationMarker(cur)) {
awaitClassReification = true;
awaitClassReification = !isDefaultCompilation();
}
else if (cur.getType() == AbstractInsnNode.METHOD_INSN) {
if (InlineCodegenUtil.isFinallyStart(cur)) {
@@ -804,4 +805,7 @@ public class MethodInliner {
}
private boolean isDefaultCompilation() {
return inliningContext.isRoot() && ((RootInliningContext) inliningContext).isDefaultCompilation;
}
}

View File

@@ -239,7 +239,9 @@ class SMAP(val fileMappings: List<FileMapping>) {
val sourceInfo: SourceInfo
init {
val defaultMapping = default.lineMappings.single()
//val defaultMapping = default.lineMappings.single()
//temporary workaround for KT-11478 ("Couldn't inline method call" error)
val defaultMapping = default.lineMappings.first()
sourceInfo = SourceInfo(default.name, default.path, defaultMapping.source + defaultMapping.range - 1)
}

View File

@@ -20,38 +20,39 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns.COLLECTIONS_PACKAGE_FQ_NAME
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.codegen.Callable
import org.jetbrains.kotlin.codegen.CallableMethod
import org.jetbrains.kotlin.fileClasses.internalNameWithoutInnerClasses
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
class IteratorNext : IntrinsicMethod() {
private fun getIteratorName(returnType: Type): String {
return when (returnType) {
Type.CHAR_TYPE -> "Char"
Type.BOOLEAN_TYPE -> "Boolean"
Type.BYTE_TYPE -> "Byte"
Type.SHORT_TYPE -> "Short"
Type.INT_TYPE -> "Int"
Type.LONG_TYPE -> "Long"
Type.FLOAT_TYPE -> "Float"
Type.DOUBLE_TYPE -> "Double"
else -> throw UnsupportedOperationException("Can't get correct name for iterator from type: " + returnType)
}
}
override fun toCallable(method: CallableMethod): Callable {
val type = AsmUtil.unboxType(method.returnType)
return object : IntrinsicCallable(type, listOf(), AsmTypes.OBJECT_TYPE, null) {
override fun invokeIntrinsic(v: InstructionAdapter) {
val name = getIteratorName(returnType)
val primitiveClassName = getKotlinPrimitiveClassName(returnType)
v.invokevirtual(
COLLECTIONS_PACKAGE_FQ_NAME.child(Name.identifier(name + "Iterator")) .asString().replace('.', '/'),
"next$name",
getPrimitiveIteratorType(primitiveClassName).internalName,
"next${primitiveClassName.asString()}",
"()" + returnType.descriptor,
false
)
}
}
}
companion object {
// Type.CHAR_TYPE -> "Char"
private fun getKotlinPrimitiveClassName(type: Type): Name {
return JvmPrimitiveType.get(type.className).primitiveType.typeName
}
// "Char" -> type for kotlin.collections.CharIterator
fun getPrimitiveIteratorType(primitiveClassName: Name): Type {
val iteratorName = Name.identifier(primitiveClassName.asString() + "Iterator")
return Type.getObjectType(COLLECTIONS_PACKAGE_FQ_NAME.child(iteratorName).internalNameWithoutInnerClasses)
}
}
}

View File

@@ -18,6 +18,11 @@ package org.jetbrains.kotlin.codegen.optimization.boxing;
import com.google.common.collect.ImmutableMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.builtins.PrimitiveType;
import org.jetbrains.kotlin.codegen.RangeCodegenUtil;
import org.jetbrains.kotlin.codegen.intrinsics.IteratorNext;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType;
import org.jetbrains.org.objectweb.asm.Type;
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue;
@@ -25,15 +30,11 @@ public class ProgressionIteratorBasicValue extends BasicValue {
private final static ImmutableMap<String, Type> VALUES_TYPENAME_TO_TYPE;
static {
VALUES_TYPENAME_TO_TYPE = ImmutableMap.<String, Type>builder().
put("Byte", Type.BYTE_TYPE).
put("Char", Type.CHAR_TYPE).
put("Short", Type.SHORT_TYPE).
put("Int", Type.INT_TYPE).
put("Long", Type.LONG_TYPE).
put("Float", Type.FLOAT_TYPE).
put("Double", Type.DOUBLE_TYPE).
build();
ImmutableMap.Builder<String, Type> builder = ImmutableMap.builder();
for (PrimitiveType primitiveType : RangeCodegenUtil.supportedRangeTypes()) {
builder.put(primitiveType.getTypeName().asString(), Type.getType(JvmPrimitiveType.get(primitiveType).getDesc()));
}
VALUES_TYPENAME_TO_TYPE = builder.build();
}
@NotNull
@@ -47,19 +48,16 @@ public class ProgressionIteratorBasicValue extends BasicValue {
private final String valuesPrimitiveTypeName;
public ProgressionIteratorBasicValue(@NotNull String valuesPrimitiveTypeName) {
super(Type.getObjectType("kotlin/" + valuesPrimitiveTypeName + "Iterator"));
super(IteratorNext.Companion.getPrimitiveIteratorType(Name.identifier(valuesPrimitiveTypeName)));
this.valuesPrimitiveType = getValuesType(valuesPrimitiveTypeName);
this.valuesPrimitiveTypeName = valuesPrimitiveTypeName;
}
@NotNull
public Type getValuesPrimitiveType() {
return valuesPrimitiveType;
}
public String getValuesPrimitiveTypeName() {
return valuesPrimitiveTypeName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
@@ -75,7 +73,7 @@ public class ProgressionIteratorBasicValue extends BasicValue {
@NotNull
public String getNextMethodName() {
return "next" + getValuesPrimitiveTypeName();
return "next" + valuesPrimitiveTypeName;
}
@NotNull

View File

@@ -1024,10 +1024,25 @@ public class JetTypeMapper {
writeVoidReturn(sw);
}
else {
writeFormalTypeParameters(getDirectMember(f).getTypeParameters(), sw);
CallableMemberDescriptor directMember = getDirectMember(f);
KotlinType thisIfNeeded = null;
if (OwnerKind.DEFAULT_IMPLS == kind) {
ReceiverTypeAndTypeParameters receiverTypeAndTypeParameters = TypeMapperUtilsKt.patchTypeParametersForDefaultImplMethod(directMember);
writeFormalTypeParameters(CollectionsKt.plus(receiverTypeAndTypeParameters.getTypeParameters(), directMember.getTypeParameters()), sw);
thisIfNeeded = receiverTypeAndTypeParameters.getReceiverType();
}
else {
writeFormalTypeParameters(directMember.getTypeParameters(), sw);
if (isAccessor(f) && f.getDispatchReceiverParameter() != null) {
thisIfNeeded = ((ClassDescriptor) f.getContainingDeclaration()).getDefaultType();
}
}
sw.writeParametersStart();
writeThisIfNeeded(f, kind, sw);
if (thisIfNeeded != null) {
writeParameter(sw, JvmMethodParameterKind.THIS, thisIfNeeded, f);
}
ReceiverParameterDescriptor receiverParameter = f.getExtensionReceiverParameter();
if (receiverParameter != null) {
@@ -1181,33 +1196,6 @@ public class JetTypeMapper {
return sw.makeJavaGenericSignature();
}
private void writeThisIfNeeded(
@NotNull CallableMemberDescriptor descriptor,
@NotNull OwnerKind kind,
@NotNull BothSignatureWriter sw
) {
ClassDescriptor thisType;
if (kind == OwnerKind.DEFAULT_IMPLS) {
thisType = getTraitImplThisParameterClass((ClassDescriptor) descriptor.getContainingDeclaration());
}
else if (isAccessor(descriptor) && descriptor.getDispatchReceiverParameter() != null) {
thisType = (ClassDescriptor) descriptor.getContainingDeclaration();
}
else return;
writeParameter(sw, JvmMethodParameterKind.THIS, thisType.getDefaultType(), descriptor);
}
@NotNull
private static ClassDescriptor getTraitImplThisParameterClass(@NotNull ClassDescriptor traitDescriptor) {
for (ClassDescriptor descriptor : DescriptorUtils.getSuperclassDescriptors(traitDescriptor)) {
if (descriptor.getKind() != ClassKind.INTERFACE) {
return descriptor;
}
}
return traitDescriptor;
}
public void writeFormalTypeParameters(@NotNull List<TypeParameterDescriptor> typeParameters, @NotNull BothSignatureWriter sw) {
for (TypeParameterDescriptor typeParameter : typeParameters) {
writeFormalTypeParameter(typeParameter, sw);

View File

@@ -0,0 +1,81 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.codegen.state
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
import org.jetbrains.kotlin.descriptors.impl.TypeParameterDescriptorImpl
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.typeUtil.asTypeProjection
class ReceiverTypeAndTypeParameters(val receiverType: KotlinType, val typeParameters: List<TypeParameterDescriptor>)
fun patchTypeParametersForDefaultImplMethod(function: CallableMemberDescriptor): ReceiverTypeAndTypeParameters {
val classDescriptor = function.containingDeclaration as ClassDescriptor
val functionTypeParameterNames = function.typeParameters.map { it.name.asString() }
val interfaceTypeParameters = classDescriptor.declaredTypeParameters
val conflictedTypeParameters = interfaceTypeParameters.filter { it.name.asString() in functionTypeParameterNames }
if (conflictedTypeParameters.isEmpty())
return ReceiverTypeAndTypeParameters(classDescriptor.defaultType, interfaceTypeParameters)
val existingNames = (functionTypeParameterNames + interfaceTypeParameters.map { it.name.asString() }).toMutableSet()
val mappingForInterfaceTypeParameters = conflictedTypeParameters.associateBy ({ it }) {
typeParameter ->
val newNamePrefix = typeParameter.name.asString() + "_I"
val newName = newNamePrefix + generateSequence(1) { x -> x + 1 }.first {
index -> (newNamePrefix + index) !in existingNames
}
existingNames.add(newName)
function.createTypeParameterWithNewName(typeParameter, newName)
}
val substitution = TypeConstructorSubstitution.createByParametersMap(mappingForInterfaceTypeParameters.mapValues {
it.value.defaultType.asTypeProjection()
})
val substitutor = TypeSubstitutor.create(substitution)
val additionalTypeParameters = interfaceTypeParameters.map { typeParameter ->
mappingForInterfaceTypeParameters[typeParameter] ?: typeParameter
}
var resultTypeParameters = mutableListOf<TypeParameterDescriptor>()
DescriptorSubstitutor.substituteTypeParameters(additionalTypeParameters, substitution, classDescriptor, resultTypeParameters)
return ReceiverTypeAndTypeParameters(substitutor.substitute(classDescriptor.defaultType, Variance.INVARIANT)!!, resultTypeParameters)
}
fun CallableMemberDescriptor.createTypeParameterWithNewName(descriptor: TypeParameterDescriptor, newName: String): TypeParameterDescriptorImpl {
val newDescriptor = TypeParameterDescriptorImpl.createForFurtherModification(
this,
descriptor.annotations,
descriptor.isReified,
descriptor.variance,
Name.identifier(newName),
descriptor.index,
descriptor.source)
descriptor.upperBounds.forEach {
newDescriptor.addUpperBound(it)
}
newDescriptor.setInitialized()
return newDescriptor
}

View File

@@ -64,7 +64,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
.flatMap { it.walk().filter(::isClasspathFile) }
.map { FileId(it, it.lastModified(), it.md5Digest()) }
.toList()
val nowMs = TimeUnit.MILLISECONDS.toMillis(System.nanoTime())
val nowMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
lastUpdate.set(nowMs)
lastDigestUpdate.set(nowMs)
}
@@ -80,7 +80,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
val isChanged: Boolean get() {
if (lastChangedStatus.get()) return true
val nowMs = TimeUnit.MILLISECONDS.toMillis(System.nanoTime())
val nowMs = TimeUnit.NANOSECONDS.toMillis(System.nanoTime())
if (nowMs - lastUpdate.get() < checkPeriod) return false
val checkDigest = nowMs - lastDigestUpdate.get() > digestCheckPeriod
@@ -106,7 +106,7 @@ class LazyClasspathWatcher(classpath: Iterable<String>,
true // io error considered as change
}
} != null
lastUpdate.set(TimeUnit.MILLISECONDS.toMillis(System.nanoTime()))
lastUpdate.set(TimeUnit.NANOSECONDS.toMillis(System.nanoTime()))
if (checkDigest) lastDigestUpdate.set(lastUpdate.get())
return changed

View File

@@ -46,15 +46,16 @@ public class SamAdapterOverridabilityCondition implements ExternalOverridability
return subOriginal == null ? Result.UNKNOWN : Result.INCOMPATIBLE; // DECLARATION can override anything
}
OverridingUtil.OverrideCompatibilityInfo basicResult = OverridingUtil.DEFAULT
.isOverridableByWithoutExternalConditions(superDescriptor, subDescriptor, /* checkReturnType = */ false);
if (basicResult.getResult() != OverridingUtil.OverrideCompatibilityInfo.Result.OVERRIDABLE) return Result.UNKNOWN;
// inheritor if SYNTHESIZED can override inheritor of SYNTHESIZED if their originals have same erasure
return equalErasure(superOriginal, subOriginal) ? Result.UNKNOWN : Result.INCOMPATIBLE;
}
@NotNull
@Override
public Contract getContract() {
return Contract.CONFLICTS_ONLY;
}
private static boolean equalErasure(@NotNull FunctionDescriptor fun1, @NotNull FunctionDescriptor fun2) {
List<ValueParameterDescriptor> parameters1 = fun1.getValueParameters();
List<ValueParameterDescriptor> parameters2 = fun2.getValueParameters();
@@ -87,6 +88,8 @@ public class SamAdapterOverridabilityCondition implements ExternalOverridability
// if function is or overrides declaration, returns null; otherwise, return original of sam adapter with substituted type parameters
@Nullable
private static SimpleFunctionDescriptor getOriginalOfSamAdapterFunction(@NotNull SimpleFunctionDescriptor callable) {
if (callable.getDispatchReceiverParameter() != null) return null;
DeclarationDescriptor containingDeclaration = callable.getContainingDeclaration();
if (!(containingDeclaration instanceof ClassDescriptor)) {
return null;

View File

@@ -27,10 +27,12 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl<PsiClassType> implement
private static class ResolutionResult {
private final JavaClassifier classifier;
private final JavaTypeSubstitutor substitutor;
private final boolean isRaw;
private ResolutionResult(@Nullable JavaClassifier classifier, @NotNull JavaTypeSubstitutor substitutor) {
private ResolutionResult(@Nullable JavaClassifier classifier, @NotNull JavaTypeSubstitutor substitutor, boolean isRaw) {
this.classifier = classifier;
this.substitutor = substitutor;
this.isRaw = isRaw;
}
}
@@ -61,8 +63,8 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl<PsiClassType> implement
PsiSubstitutor substitutor = result.getSubstitutor();
resolutionResult = new ResolutionResult(
psiClass == null ? null : JavaClassifierImpl.create(psiClass),
new JavaTypeSubstitutorImpl(convertSubstitutionMap(substitutor.getSubstitutionMap()))
);
new JavaTypeSubstitutorImpl(convertSubstitutionMap(substitutor.getSubstitutionMap())),
PsiClassType.isRaw(result));
}
}
@@ -102,7 +104,8 @@ public class JavaClassifierTypeImpl extends JavaTypeImpl<PsiClassType> implement
@Override
public boolean isRaw() {
return getPsi().isRaw();
resolve();
return resolutionResult.isRaw;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.load.java.structure.impl;
import com.intellij.psi.PsiAnnotationOwner;
import com.intellij.psi.PsiParameter;
import com.intellij.psi.impl.compiled.ClsParameterImpl;
import com.intellij.psi.impl.java.stubs.impl.PsiParameterStubImpl;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.descriptors.Visibilities;
@@ -86,7 +85,7 @@ public class JavaValueParameterImpl extends JavaElementImpl<PsiParameter>
@Nullable
public Name getName() {
PsiParameter psi = getPsi();
if (isParameterWithAutoGeneratedName(psi)) {
if (psi instanceof ClsParameterImpl && ((ClsParameterImpl) psi).isAutoGeneratedName()) {
return null;
}
@@ -94,11 +93,6 @@ public class JavaValueParameterImpl extends JavaElementImpl<PsiParameter>
return name == null ? null : Name.identifier(name);
}
private static boolean isParameterWithAutoGeneratedName(PsiParameter psi) {
// see com.intellij.psi.impl.compiled.ClsParameterImpl.calcName()
return psi instanceof ClsParameterImpl && ((PsiParameterStubImpl) ((ClsParameterImpl) psi).getStub()).isAutoGeneratedName();
}
@Override
@NotNull
public JavaType getType() {

View File

@@ -0,0 +1,43 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.resolve.jvm.checkers
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.diagnostics.DiagnosticSink
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DeclarationChecker
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
import org.jetbrains.kotlin.resolve.annotations.findStrictfpAnnotation
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
class StrictfpApplicabilityChecker : DeclarationChecker {
override fun check(
declaration: KtDeclaration,
descriptor: DeclarationDescriptor,
diagnosticHolder: DiagnosticSink,
bindingContext: BindingContext
) {
val annotation = descriptor.findStrictfpAnnotation() ?: return
if (declaration is KtClassOrObject && descriptor is ClassDescriptor) {
val annotationEntry = DescriptorToSourceUtils.getSourceFromAnnotation(annotation) ?: return
diagnosticHolder.report(ErrorsJvm.STRICTFP_ON_CLASS.on(annotationEntry))
}
}
}

View File

@@ -104,6 +104,8 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension {
MAP.put(ErrorsJvm.JVM_SYNTHETIC_ON_DELEGATE, "''@JvmSynthetic'' annotation cannot be used on delegated properties");
MAP.put(ErrorsJvm.STRICTFP_ON_CLASS, "''@Strictfp'' annotation on classes is unsupported yet");
MAP.put(ErrorsJvm.SUPER_CALL_WITH_DEFAULT_PARAMETERS, "Super-calls with default arguments are not allowed. Please specify all arguments of ''super.{0}'' explicitly", Renderers.TO_STRING);
}

View File

@@ -53,6 +53,8 @@ public interface ErrorsJvm {
DiagnosticFactory0<KtAnnotationEntry> JVM_SYNTHETIC_ON_DELEGATE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> STRICTFP_ON_CLASS = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<KtAnnotationEntry> VOLATILE_ON_VALUE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> VOLATILE_ON_DELEGATE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtAnnotationEntry> SYNCHRONIZED_ON_ABSTRACT = DiagnosticFactory0.create(ERROR);

View File

@@ -42,7 +42,8 @@ object JvmPlatformConfigurator : PlatformConfigurator(
OverloadsAnnotationChecker(),
JvmFieldApplicabilityChecker(),
TypeParameterBoundIsNotArrayChecker(),
JvmSyntheticApplicabilityChecker()
JvmSyntheticApplicabilityChecker(),
StrictfpApplicabilityChecker()
),
additionalCallCheckers = listOf(

View File

@@ -21,10 +21,10 @@ import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
fun FunctionDescriptor.hasJavaOriginInHierarchy(): Boolean {
return if (overriddenDescriptors.isEmpty())
return if (original.overriddenDescriptors.isEmpty())
containingDeclaration is JavaClassDescriptor
else
overriddenDescriptors.any { it.hasJavaOriginInHierarchy() }
original.overriddenDescriptors.any { it.hasJavaOriginInHierarchy() }
}
fun Visibility.isVisibleOutside() = this != Visibilities.PRIVATE && this != Visibilities.PRIVATE_TO_THIS && this != Visibilities.INVISIBLE_FAKE

View File

@@ -48,7 +48,7 @@ abstract class KtNamedDeclarationNotStubbed extends KtDeclarationImpl implements
@Override
public Name getNameAsName() {
String name = getName();
return name != null ? Name.guess(name) : null;
return name != null ? Name.identifier(name) : null;
}
@Override

View File

@@ -63,7 +63,7 @@ abstract class KtNamedDeclarationStub<T extends KotlinStubWithFqName<?>> extends
@Override
public Name getNameAsName() {
String name = getName();
return name != null ? Name.guess(name) : null;
return name != null ? Name.identifier(name) : null;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -187,6 +187,12 @@ class KtPsiFactory(private val project: Project) {
return file
}
fun createFileWithLightClassSupport(fileName: String, text: String, contextToAnalyzeIn: PsiElement): KtFile {
val file = createPhysicalFile(fileName, text)
file.analysisContext = contextToAnalyzeIn
return file
}
fun createPhysicalFile(fileName: String, text: String): KtFile {
return PsiFileFactory.getInstance(project).createFileFromText(fileName, KotlinFileType.INSTANCE, text, LocalTimeCounter.currentTime(), true) as KtFile
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -782,6 +782,11 @@ public class KtPsiUtil {
declaration = PsiTreeUtil.getParentOfType(declaration, KtNamedDeclaration.class);
}
else if (declaration instanceof KtParameter) {
KtFunctionType functionType = PsiTreeUtil.getParentOfType(declaration, KtFunctionType.class);
if (functionType != null) {
return functionType;
}
PsiElement parent = declaration.getParent();
// val/var parameter of primary constructor should be considered as local according to containing class

View File

@@ -39,6 +39,11 @@ fun DeclarationDescriptor.hasJvmSyntheticAnnotation() = findJvmSyntheticAnnotati
fun DeclarationDescriptor.findJvmSyntheticAnnotation() =
DescriptorUtils.getAnnotationByFqName(annotations, JVM_SYNTHETIC_ANNOTATION_FQ_NAME)
private val STRICTFP_ANNOTATION_FQ_NAME = FqName("kotlin.jvm.Strictfp")
fun DeclarationDescriptor.findStrictfpAnnotation() =
DescriptorUtils.getAnnotationByFqName(annotations, STRICTFP_ANNOTATION_FQ_NAME)
fun CallableDescriptor.isPlatformStaticInObjectOrClass(): Boolean =
isPlatformStaticIn { DescriptorUtils.isNonCompanionObject(it) || DescriptorUtils.isClassOrEnumClass(it) }

View File

@@ -81,10 +81,13 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
private final ExplicitReceiverKind explicitReceiverKind;
private final TypeSubstitutor knownTypeParametersSubstitutor;
private final Map<TypeParameterDescriptor, KotlinType> typeArguments = Maps.newLinkedHashMap();
private final Map<ValueParameterDescriptor, ResolvedValueArgument> valueArguments = Maps.newLinkedHashMap();
@NotNull
private final Map<TypeParameterDescriptor, KotlinType> typeArguments;
@NotNull
private final Map<ValueParameterDescriptor, ResolvedValueArgument> valueArguments;
private final MutableDataFlowInfoForArguments dataFlowInfoForArguments;
private final Map<ValueArgument, ArgumentMatchImpl> argumentToParameterMap = Maps.newHashMap();
@NotNull
private final Map<ValueArgument, ArgumentMatchImpl> argumentToParameterMap;
private DelegatingBindingTrace trace;
private TracingStrategy tracing;
@@ -109,6 +112,9 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
this.trace = trace;
this.tracing = tracing;
this.dataFlowInfoForArguments = dataFlowInfoForArguments;
this.typeArguments = createTypeArgumentsMap(candidateDescriptor);
this.valueArguments = createValueArgumentsMap(candidateDescriptor);
this.argumentToParameterMap = createArgumentsToParameterMap(candidateDescriptor);
}
public ResolvedCallImpl(
@@ -131,6 +137,30 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
this.trace = trace;
this.tracing = tracing;
this.dataFlowInfoForArguments = dataFlowInfoForArguments;
this.typeArguments = createTypeArgumentsMap(candidateDescriptor);
this.valueArguments = createValueArgumentsMap(candidateDescriptor);
this.argumentToParameterMap = createArgumentsToParameterMap(candidateDescriptor);
}
@NotNull
private static Map<ValueParameterDescriptor, ResolvedValueArgument> createValueArgumentsMap(CallableDescriptor descriptor) {
return descriptor.getValueParameters().isEmpty()
? Collections.<ValueParameterDescriptor, ResolvedValueArgument>emptyMap()
: Maps.<ValueParameterDescriptor, ResolvedValueArgument>newLinkedHashMap();
}
@NotNull
private static Map<ValueArgument, ArgumentMatchImpl> createArgumentsToParameterMap(CallableDescriptor descriptor) {
return descriptor.getValueParameters().isEmpty()
? Collections.<ValueArgument, ArgumentMatchImpl>emptyMap()
: Maps.<ValueArgument, ArgumentMatchImpl>newHashMap();
}
@NotNull
private static Map<TypeParameterDescriptor, KotlinType> createTypeArgumentsMap(CallableDescriptor descriptor) {
return descriptor.getTypeParameters().isEmpty()
? Collections.<TypeParameterDescriptor, KotlinType>emptyMap()
: Maps.<TypeParameterDescriptor, KotlinType>newLinkedHashMap();
}
@Override
@@ -194,6 +224,8 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
}
}
if (candidateDescriptor.getValueParameters().isEmpty()) return;
List<ValueParameterDescriptor> substitutedParameters = resultingDescriptor.getValueParameters();
Collection<Map.Entry<ValueParameterDescriptor, ResolvedValueArgument>> valueArgumentsBeforeSubstitution =

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -294,12 +294,22 @@ public class ResolveSession implements KotlinCodeAnalyzer, LazyClassContext {
@Override
@NotNull
public DeclarationDescriptor resolveToDescriptor(@NotNull KtDeclaration declaration) {
if (!areDescriptorsCreatedForDeclaration(declaration)) {
throw new IllegalStateException(
"No descriptors are created for declarations of type " + declaration.getClass().getSimpleName()
+ "\n. Change the caller accordingly"
);
}
if (!KtPsiUtil.isLocal(declaration)) {
return lazyDeclarationResolver.resolveToDescriptor(declaration);
}
return localDescriptorResolver.resolveLocalDeclaration(declaration);
}
public static boolean areDescriptorsCreatedForDeclaration(@NotNull KtDeclaration declaration) {
return !(declaration instanceof KtAnonymousInitializer || declaration instanceof KtDestructuringDeclaration);
}
@NotNull
public Annotations getFileAnnotations(@NotNull KtFile file) {
return fileAnnotations.invoke(file);

View File

@@ -256,8 +256,8 @@ public class CommonSupertypes {
if (recursionDepth >= maxDepth) {
// If recursion is too deep, we cut it by taking <out Any?> as an ultimate supertype argument
// Example: class A : Base<A>; class B : Base<B>, commonSuperType(A, B) = Base<out Any?>
return new TypeProjectionImpl(OUT_VARIANCE, DescriptorUtilsKt.getBuiltIns(parameterDescriptor).getNullableAnyType());
// Example: class A : Base<A>; class B : Base<B>, commonSuperType(A, B) = Base<*>
return TypeUtils.makeStarProjection(parameterDescriptor);
}
Set<KotlinType> ins = new HashSet<KotlinType>();
@@ -312,14 +312,13 @@ public class CommonSupertypes {
assert !ins.isEmpty() : "In projections is empty for parameter " + parameterDescriptor + ", type projections " + typeProjections;
KotlinType intersection = TypeIntersector.intersectTypes(KotlinTypeChecker.DEFAULT, ins);
if (intersection == null) {
return new TypeProjectionImpl(OUT_VARIANCE, findCommonSupertype(parameterDescriptor.getUpperBounds(), recursionDepth + 1, maxDepth));
return TypeUtils.makeStarProjection(parameterDescriptor);
}
Variance projectionKind = variance == IN_VARIANCE ? Variance.INVARIANT : IN_VARIANCE;
return new TypeProjectionImpl(projectionKind, intersection);
}
else {
Variance projectionKind = variance == OUT_VARIANCE ? Variance.INVARIANT : OUT_VARIANCE;
return new TypeProjectionImpl(projectionKind, findCommonSupertype(parameterDescriptor.getUpperBounds(), recursionDepth + 1, maxDepth));
return TypeUtils.makeStarProjection(parameterDescriptor);
}
}

View File

@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.types.expressions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.intellij.psi.PsiElement;
import com.intellij.psi.tree.IElementType;
@@ -861,7 +862,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
TemporaryBindingTrace temporaryBindingTrace = TemporaryBindingTrace.create(
context.trace, "trace to resolve array access set method for unary expression", expression);
ExpressionTypingContext newContext = context.replaceBindingTrace(temporaryBindingTrace);
resolveArrayAccessSetMethod((KtArrayAccessExpression) baseExpression, stubExpression, newContext, context.trace);
resolveImplicitArrayAccessSetMethod((KtArrayAccessExpression) baseExpression, stubExpression, newContext, context.trace);
}
// Resolve the operation reference
@@ -1610,7 +1611,17 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
@NotNull ExpressionTypingContext context,
@NotNull BindingTrace traceForResolveResult
) {
return resolveArrayAccessSpecialMethod(arrayAccessExpression, rightHandSide, context, traceForResolveResult, false);
return resolveArrayAccessSpecialMethod(arrayAccessExpression, rightHandSide, context, traceForResolveResult, false, false);
}
@NotNull
/*package*/ KotlinTypeInfo resolveImplicitArrayAccessSetMethod(
@NotNull KtArrayAccessExpression arrayAccessExpression,
@NotNull KtExpression rightHandSide,
@NotNull ExpressionTypingContext context,
@NotNull BindingTrace traceForResolveResult
) {
return resolveArrayAccessSpecialMethod(arrayAccessExpression, rightHandSide, context, traceForResolveResult, false, true);
}
@NotNull
@@ -1618,7 +1629,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
@NotNull KtArrayAccessExpression arrayAccessExpression,
@NotNull ExpressionTypingContext context
) {
return resolveArrayAccessSpecialMethod(arrayAccessExpression, null, context, context.trace, true);
return resolveArrayAccessSpecialMethod(arrayAccessExpression, null, context, context.trace, true, false);
}
@NotNull
@@ -1627,7 +1638,8 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
@Nullable KtExpression rightHandSide, //only for 'set' method
@NotNull ExpressionTypingContext oldContext,
@NotNull BindingTrace traceForResolveResult,
boolean isGet
boolean isGet,
boolean isImplicit
) {
KtExpression arrayExpression = arrayAccessExpression.getArrayExpression();
if (arrayExpression == null) return TypeInfoFactoryKt.noTypeInfo(oldContext);
@@ -1658,7 +1670,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
resultTypeInfo = facade.getTypeInfo(rightHandSide, context);
}
if (!functionResults.isSingleResult()) {
if ((isImplicit && !functionResults.isSuccess()) || !functionResults.isSingleResult()) {
traceForResolveResult.report(isGet ? NO_GET_METHOD.on(arrayAccessExpression) : NO_SET_METHOD.on(arrayAccessExpression));
return resultTypeInfo.clearType();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -414,7 +414,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
}
else {
KtDestructuringDeclaration multiParameter = expression.getDestructuringParameter();
if (multiParameter != null && loopRange != null) {
if (multiParameter != null) {
KotlinType elementType = expectedParameterType == null ? ErrorUtils.createErrorType("Loop range has no type") : expectedParameterType;
TransientReceiver iteratorNextAsReceiver = new TransientReceiver(elementType);
components.annotationResolver.resolveAnnotationsWithArguments(loopScope, multiParameter.getModifierList(), context.trace);

View File

@@ -261,7 +261,7 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
if (left instanceof KtArrayAccessExpression) {
ExpressionTypingContext contextForResolve = context.replaceScope(scope).replaceBindingTrace(TemporaryBindingTrace.create(
context.trace, "trace to resolve array set method for assignment", expression));
basic.resolveArrayAccessSetMethod((KtArrayAccessExpression) left, right, contextForResolve, context.trace);
basic.resolveImplicitArrayAccessSetMethod((KtArrayAccessExpression) left, right, contextForResolve, context.trace);
}
rightInfo = facade.getTypeInfo(right, context.replaceDataFlowInfo(leftInfo.getDataFlowInfo()));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,10 +39,8 @@ import javax.swing.Icon
class KtLightClassForFacade private constructor(
manager: PsiManager,
private val facadeClassFqName: FqName,
private val searchScope: GlobalSearchScope,
private val lightClassDataCache: CachedValue<KotlinFacadeLightClassData>,
files: Collection<KtFile>,
private val deprecated: Boolean
files: Collection<KtFile>
) : KtWrappingLightClass(manager), KtJavaMirrorMarker {
private data class StubCacheKey(val fqName: FqName, val searchScope: GlobalSearchScope)
@@ -51,7 +49,7 @@ class KtLightClassForFacade private constructor(
private inner class FacadeCacheData {
val cache = object : SLRUCache<StubCacheKey, CachedValue<KotlinFacadeLightClassData>>(20, 30) {
override fun createValue(key: StubCacheKey): CachedValue<KotlinFacadeLightClassData> {
val stubProvider = LightClassDataProviderForFileFacade(project, key.fqName, key.searchScope)
val stubProvider = LightClassDataProviderForFileFacade.ByProjectSource(project, key.fqName, key.searchScope)
return CachedValuesManager.getManager(project).createCachedValue<KotlinFacadeLightClassData>(stubProvider, /*trackValue = */false)
}
}
@@ -102,7 +100,7 @@ class KtLightClassForFacade private constructor(
override fun hasModifierProperty(@NonNls name: String) = modifierList.hasModifierProperty(name)
override fun isDeprecated() = deprecated
override fun isDeprecated() = false
override fun isInterface() = false
@@ -146,7 +144,7 @@ class KtLightClassForFacade private constructor(
override fun isValid() = files.all { it.isValid && fileHasTopLevelCallables(it) }
override fun copy() = KtLightClassForFacade(getManager(), facadeClassFqName, searchScope, lightClassDataCache, files, deprecated)
override fun copy() = KtLightClassForFacade(getManager(), facadeClassFqName, lightClassDataCache, files)
override fun getDelegate(): PsiClass {
val psiClass = LightClassUtil.findClass(facadeClassFqName, lightClassDataCache.value.javaFileStub)
@@ -199,7 +197,20 @@ class KtLightClassForFacade private constructor(
assert(files.isNotEmpty()) { "No files for facade $facadeClassFqName" }
val lightClassDataCache = FacadeStubCache.getInstance(manager.project).get(facadeClassFqName, searchScope)
return KtLightClassForFacade(manager, facadeClassFqName, searchScope, lightClassDataCache, files, false)
return KtLightClassForFacade(manager, facadeClassFqName, lightClassDataCache, files)
}
fun createForSyntheticFile(
manager: PsiManager,
facadeClassFqName: FqName,
file: KtFile
): KtLightClassForFacade {
// TODO: refactor, using cached value doesn't make sense for this case
val cachedValue = CachedValuesManager.getManager(manager.project).
createCachedValue<KotlinFacadeLightClassData>(
LightClassDataProviderForFileFacade.ByFile(manager.project, facadeClassFqName, file), /*trackValue = */false
)
return KtLightClassForFacade(manager, facadeClassFqName, cachedValue, listOf(file))
}
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -281,12 +281,9 @@ class LightClassDataProviderForClassOrObject(private val classOrObject: KtClassO
}
}
class LightClassDataProviderForFileFacade(
private val project: Project, private val facadeFqName: FqName, private val searchScope: GlobalSearchScope
sealed class LightClassDataProviderForFileFacade private constructor(
protected val project: Project, protected val facadeFqName: FqName
) : LightClassDataProvider<KotlinFacadeLightClassData>(project) {
override val files: Collection<KtFile>
get() = LightClassGenerationSupport.getInstance(project).findFilesForFacade(facadeFqName, searchScope)
override val packageFqName: FqName
get() = facadeFqName.parent()
@@ -342,6 +339,26 @@ class LightClassDataProviderForFileFacade(
override fun toString(): String {
return this.javaClass.name + " for $facadeFqName"
}
// create delegate by relevant files in project source using LightClassGenerationSupport
class ByProjectSource(
project: Project,
facadeFqName: FqName,
private val searchScope: GlobalSearchScope
) : LightClassDataProviderForFileFacade(project, facadeFqName) {
override val files: Collection<KtFile>
get() = LightClassGenerationSupport.getInstance(project).findFilesForFacade(facadeFqName, searchScope)
}
// create delegate by single file
class ByFile(
project: Project,
facadeFqName: FqName,
private val file: KtFile
) : LightClassDataProviderForFileFacade(project, facadeFqName) {
override val files: Collection<KtFile>
get() = listOf(file)
}
}

View File

@@ -0,0 +1,18 @@
class A(val value: String)
fun A.test(): String {
val o = object {
val z: String
init {
val x = value + "K"
z = x
}
}
return o.z
}
// METHOD : Kt11117Kt$test$o$1.<init>(LA;)V
// VARIABLE : NAME=x TYPE=Ljava/lang/String; INDEX=2
// VARIABLE : NAME=this TYPE=LKt11117Kt$test$o$1; INDEX=0
// VARIABLE : NAME=$receiver TYPE=LA; INDEX=1

View File

@@ -0,0 +1,12 @@
operator fun Int.compareTo(c: Char) = 0
fun foo(x: Int, y: Char): String {
if (x < y) {
throw Error()
}
return "${y}K"
}
fun box(): String {
return foo(42, 'O')
}

View File

@@ -0,0 +1,16 @@
class A(val value: String)
fun A.test(): String {
val o = object {
val z: String
init {
val x = value + "K"
z = x
}
}
return o.z
}
fun box(): String {
return A("O").test()
}

View File

@@ -0,0 +1,13 @@
object Map1 {
operator fun get(i: Int, j: Int) = Map2
}
object Map2 {
operator fun get(i: Int, j: Int) = 0
operator fun set(i: Int, j: Int, newValue: Int) {}
}
fun box(): String {
Map1[0, 0][0, 0]++
return "OK"
}

View File

@@ -0,0 +1,11 @@
object A {
operator fun get(i: Int) = 1
operator fun set(i: Int, j: Int) {}
operator fun set(i: Int, x: Any) { throw Exception() }
}
fun box(): String {
A[0]++
A[0] += 1
return "OK"
}

View File

@@ -0,0 +1,11 @@
interface In<in E>
class En<T> : In<T>
class A : In<A>
fun <T> select(x: T, y: T): T = x ?: y
// This test just checks that no internal error happens in backend
// Return type should be In<*> nor In<out Any?>
fun foobar(e: En<*>) = select(A(), e)
fun box() = "OK"

View File

@@ -0,0 +1,9 @@
interface In<in E>
class A : In<A>
class B : In<B>
fun <T> select(x: T, y: T) = x ?: y
// This test just checks that no internal error happens in backend
fun foobar(a: A, b: B) = select(a, b)
fun box() = "OK"

View File

@@ -0,0 +1,26 @@
import java.util.*
open class Base<Target : DatabaseEntity>() : HashSet<Target>() {
override fun remove(element: Target): Boolean {
return true
}
}
class Derived : Base<Issue>() {
// common "synthetic bridge override fun remove(element: DatabaseEntity): Boolean" should call
// `INVOKEVIRTUAL remove(Issue)`
// instead of `INVOKEVIRTUAL remove(OBJECT)`
override fun remove(element: Issue): Boolean {
return super.remove(element)
}
}
open class DatabaseEntity
class Issue: DatabaseEntity()
fun box(): String {
val sprintIssues = Derived()
if (!sprintIssues.remove(Issue())) return "Fail"
return "OK"
}

View File

@@ -0,0 +1,10 @@
import test.*
fun box(): String {
var result = "fail"
makeRunnable<String> { result = "OK" }.run()
return result
}

View File

@@ -0,0 +1,5 @@
package test
inline fun <reified T> makeRunnable(noinline lambda: ()->Unit) : Runnable {
return Runnable(lambda)
}

View File

@@ -0,0 +1,17 @@
import test.*
fun specifyOptionalArgument() = typeWithMessage<List<Int>>("Hello")
fun useDefault() = typeWithMessage<List<Int>>()
fun box(): String {
val specifyOptionalArgument = specifyOptionalArgument()
val useDefault = useDefault()
if (useDefault != specifyOptionalArgument) return "fail: $useDefault != $specifyOptionalArgument"
val type = typeWithMessage<List<Int>>("")
if (type != " test.TypeRef<java.util.List<? extends java.lang.Integer>>") return "fail 2: $type"
return "OK"
}

View File

@@ -0,0 +1,21 @@
package test
open class TypeRef<T> {
val type = target()
private fun target(): String {
val thisClass = this.javaClass
val superClass = thisClass.genericSuperclass
return superClass.toString()
}
}
inline fun <reified T> typeWithMessage(message: String = "Hello"): String {
val type = object : TypeRef<T>() {}
val target = type.type
return message + " " + target
}

View File

@@ -0,0 +1,58 @@
import test.*
fun box(): String {
var result = "fail"
annotatedWith { result = "OK"; true }
return result
}
inline fun test(z: () -> Unit) {
z()
}
// FILE: 2.smap
//PROBLEM of KT-11478 in additional line mapping for default source (so 'single' was replaces with 'first' in SMAP class init):
//*L
//1#1,15:1
//17#1:19
//SMAP
//severalMappingsForDefaultFile.1.kt
//Kotlin
//*S Kotlin
//*F
//+ 1 severalMappingsForDefaultFile.1.kt
//SeveralMappingsForDefaultFile_1Kt
//+ 2 severalMappingsForDefaultFile.2.kt
//test/SeveralMappingsForDefaultFile_2Kt
//*L
//1#1,58:1
//8#2:59
//4#2:60
//*E
//
//SMAP
//severalMappingsForDefaultFile.2.kt
//Kotlin
//*S Kotlin
//*F
//+ 1 severalMappingsForDefaultFile.2.kt
//test/SeveralMappingsForDefaultFile_2Kt$annotatedWith2$1
//+ 2 severalMappingsForDefaultFile.2.kt
//test/SeveralMappingsForDefaultFile_2Kt
//+ 3 severalMappingsForDefaultFile.1.kt
//SeveralMappingsForDefaultFile_1Kt
//*L
//1#1,13:1
//26#1:27
//12#2,2:14
//4#2,11:14
//8#2:25
//14#2,12:14
//6#3:26
//*E

View File

@@ -0,0 +1,13 @@
package test
inline fun annotatedWith2(crossinline predicate: () -> Boolean) =
{ any { predicate() } }()
inline fun annotatedWith(crossinline predicate: () -> Boolean) =
annotatedWith2 { predicate() }
inline fun any(s: () -> Boolean) {
s()
}

View File

@@ -0,0 +1,3 @@
class JavaClass {
public static Long get() { return 2364137526064485012L; }
}

View File

@@ -0,0 +1,5 @@
import JavaClass
fun box(): String {
return if (JavaClass.get() > 0) "OK" else "fail"
}

View File

@@ -0,0 +1,13 @@
public class J {
public static int test1() {
A<String, B<String>> x = new X<String, B<String>>("O", new B<String>("K"));
return A.DefaultImpls.test1(x, 1, 1.0);
}
public static A<String, B<String>> test2(){
X<String, B<String>> x = new X<String, B<String>>("O", new B<String>("K"));
return A.DefaultImpls.test2(x, 1);
}
}

View File

@@ -0,0 +1,26 @@
class B<T>(val value: T)
interface A<T, Y : B<T>> {
fun <T, L> test1(p: T, z: L): T {
return p
}
fun <L> test2(p: L): A<T, Y> {
return this
}
}
class X<T, Y : B<T>>(val p1: T, val p2: Y) : A<T, Y> {
}
fun box(): String {
val test1 = J.test1()
if (test1 != 1) return "fail 1: $test1 != 1"
val test2: X<String, B<String>> = J.test2() as X<String, B<String>>
return test2.p1 + test2.p2.value
}

View File

@@ -23,6 +23,11 @@ fun box() : String {
assertEquals(result7, 100)
assertEquals(result8, 100)
val result9 = (0..10).reduce { total, next -> total + next }
val result10 = (0L..10L).reduce { total, next -> total + next }
assertEquals(result9, 55)
assertEquals(result10, 55L)
return "OK"
}

View File

@@ -0,0 +1,69 @@
fun box(): String {
val aByte: Array<Byte> = arrayOf<Byte>(1)
val bByte: ByteArray = byteArrayOf(1)
val aShort: Array<Short> = arrayOf<Short>(1)
val bShort: ShortArray = shortArrayOf(1)
val aInt: Array<Int> = arrayOf<Int>(1)
val bInt: IntArray = intArrayOf(1)
val aLong: Array<Long> = arrayOf<Long>(1)
val bLong: LongArray = longArrayOf(1)
val aFloat: Array<Float> = arrayOf<Float>(1.0f)
val bFloat: FloatArray = floatArrayOf(1.0f)
val aDouble: Array<Double> = arrayOf<Double>(1.0)
val bDouble: DoubleArray = doubleArrayOf(1.0)
aByte[0]--
bByte[0]--
if (aByte[0] != bByte[0]) return "Failed post-decrement Byte: ${aByte[0]} != ${bByte[0]}"
aByte[0]++
bByte[0]++
if (aByte[0] != bByte[0]) return "Failed post-increment Byte: ${aByte[0]} != ${bByte[0]}"
aShort[0]--
bShort[0]--
if (aShort[0] != bShort[0]) return "Failed post-decrement Short: ${aShort[0]} != ${bShort[0]}"
aShort[0]++
bShort[0]++
if (aShort[0] != bShort[0]) return "Failed post-increment Short: ${aShort[0]} != ${bShort[0]}"
aInt[0]--
bInt[0]--
if (aInt[0] != bInt[0]) return "Failed post-decrement Int: ${aInt[0]} != ${bInt[0]}"
aInt[0]++
bInt[0]++
if (aInt[0] != bInt[0]) return "Failed post-increment Int: ${aInt[0]} != ${bInt[0]}"
aLong[0]--
bLong[0]--
if (aLong[0] != bLong[0]) return "Failed post-decrement Long: ${aLong[0]} != ${bLong[0]}"
aLong[0]++
bLong[0]++
if (aLong[0] != bLong[0]) return "Failed post-increment Long: ${aLong[0]} != ${bLong[0]}"
aFloat[0]++
bFloat[0]++
if (aFloat[0] != bFloat[0]) return "Failed post-increment Float: ${aFloat[0]} != ${bFloat[0]}"
aFloat[0]--
bFloat[0]--
if (aFloat[0] != bFloat[0]) return "Failed post-decrement Float: ${aFloat[0]} != ${bFloat[0]}"
aDouble[0]++
bDouble[0]++
if (aDouble[0] != bDouble[0]) return "Failed post-increment Double: ${aDouble[0]} != ${bDouble[0]}"
aDouble[0]--
bDouble[0]--
if (aDouble[0] != bDouble[0]) return "Failed post-decrement Double: ${aDouble[0]} != ${bDouble[0]}"
return "OK"
}

View File

@@ -0,0 +1,15 @@
object A {
var x = 0
operator fun get(i1: Int, i2: Int, i3: Int): Int = x
operator fun set(i1: Int, i2: Int, i3: Int, value: Int) {
x = value
}
}
fun box(): String {
A.x = 0
val xx = A[1, 2, 3]++
return if (xx != 0 || A.x != 1) "Failed" else "OK"
}

View File

@@ -0,0 +1,117 @@
class AByte(var value: Byte) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: Byte) {
value = newValue
}
}
class AShort(var value: Short) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: Short) {
value = newValue
}
}
class AInt(var value: Int) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: Int) {
value = newValue
}
}
class ALong(var value: Long) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: Long) {
value = newValue
}
}
class AFloat(var value: Float) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: Float) {
value = newValue
}
}
class ADouble(var value: Double) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: Double) {
value = newValue
}
}
fun box(): String {
val aByte = AByte(1)
var bByte: Byte = 1
val aShort = AShort(1)
var bShort: Short = 1
val aInt = AInt(1)
var bInt: Int = 1
val aLong = ALong(1)
var bLong: Long = 1
val aFloat = AFloat(1.0f)
var bFloat: Float = 1.0f
val aDouble = ADouble(1.0)
var bDouble: Double = 1.0
aByte[0]++
bByte++
if (aByte[0] != bByte) return "Failed post-increment Byte: ${aByte[0]} != $bByte"
aByte[0]--
bByte--
if (aByte[0] != bByte) return "Failed post-decrement Byte: ${aByte[0]} != $bByte"
aShort[0]++
bShort++
if (aShort[0] != bShort) return "Failed post-increment Short: ${aShort[0]} != $bShort"
aShort[0]--
bShort--
if (aShort[0] != bShort) return "Failed post-decrement Short: ${aShort[0]} != $bShort"
aInt[0]++
bInt++
if (aInt[0] != bInt) return "Failed post-increment Int: ${aInt[0]} != $bInt"
aInt[0]--
bInt--
if (aInt[0] != bInt) return "Failed post-decrement Int: ${aInt[0]} != $bInt"
aLong[0]++
bLong++
if (aLong[0] != bLong) return "Failed post-increment Long: ${aLong[0]} != $bLong"
aLong[0]--
bLong--
if (aLong[0] != bLong) return "Failed post-decrement Long: ${aLong[0]} != $bLong"
aFloat[0]++
bFloat++
if (aFloat[0] != bFloat) return "Failed post-increment Float: ${aFloat[0]} != $bFloat"
aFloat[0]--
bFloat--
if (aFloat[0] != bFloat) return "Failed post-decrement Float: ${aFloat[0]} != $bFloat"
aDouble[0]++
bDouble++
if (aDouble[0] != bDouble) return "Failed post-increment Double: ${aDouble[0]} != $bDouble"
aDouble[0]--
bDouble--
if (aDouble[0] != bDouble) return "Failed post-decrement Double: ${aDouble[0]} != $bDouble"
return "OK"
}

View File

@@ -0,0 +1,8 @@
operator fun Long.get(i: Int) = this
operator fun Long.set(i: Int, newValue: Long) {}
fun box(): String {
var x = 0L
val y = x[0]++
return if (y == 0L) "OK" else "Failed, y=$y"
}

View File

@@ -0,0 +1,77 @@
class A<T>(var value: T) {
operator fun get(i: Int) = value
operator fun set(i: Int, newValue: T) {
value = newValue
}
}
fun box(): String {
val aByte = A<Byte>(1)
var bByte: Byte = 1
val aShort = A<Short>(1)
var bShort: Short = 1
val aInt = A<Int>(1)
var bInt: Int = 1
val aLong = A<Long>(1)
var bLong: Long = 1
val aFloat = A<Float>(1.0f)
var bFloat: Float = 1.0f
val aDouble = A<Double>(1.0)
var bDouble: Double = 1.0
aByte[0]++
bByte++
if (aByte[0] != bByte) return "Failed post-increment Byte: ${aByte[0]} != $bByte"
aByte[0]--
bByte--
if (aByte[0] != bByte) return "Failed post-decrement Byte: ${aByte[0]} != $bByte"
aShort[0]++
bShort++
if (aShort[0] != bShort) return "Failed post-increment Short: ${aShort[0]} != $bShort"
aShort[0]--
bShort--
if (aShort[0] != bShort) return "Failed post-decrement Short: ${aShort[0]} != $bShort"
aInt[0]++
bInt++
if (aInt[0] != bInt) return "Failed post-increment Int: ${aInt[0]} != $bInt"
aInt[0]--
bInt--
if (aInt[0] != bInt) return "Failed post-decrement Int: ${aInt[0]} != $bInt"
aLong[0]++
bLong++
if (aLong[0] != bLong) return "Failed post-increment Long: ${aLong[0]} != $bLong"
aLong[0]--
bLong--
if (aLong[0] != bLong) return "Failed post-decrement Long: ${aLong[0]} != $bLong"
aFloat[0]++
bFloat++
if (aFloat[0] != bFloat) return "Failed post-increment Float: ${aFloat[0]} != $bFloat"
aFloat[0]--
bFloat--
if (aFloat[0] != bFloat) return "Failed post-decrement Float: ${aFloat[0]} != $bFloat"
aDouble[0]++
bDouble++
if (aDouble[0] != bDouble) return "Failed post-increment Double: ${aDouble[0]} != $bDouble"
aDouble[0]--
bDouble--
if (aDouble[0] != bDouble) return "Failed post-decrement Double: ${aDouble[0]} != $bDouble"
return "OK"
}

View File

@@ -0,0 +1,12 @@
object ExtProvider {
operator fun Long.get(i: Int) = this
operator fun Long.set(i: Int, newValue: Long) {}
}
fun box(): String {
with (ExtProvider) {
var x = 0L
val y = x[0]++
return if (y == 0L) "OK" else "Failed, y=$y"
}
}

View File

@@ -0,0 +1,81 @@
fun box(): String {
val aByte = arrayListOf<Byte>(1)
var bByte: Byte = 1
val aShort = arrayListOf<Short>(1)
var bShort: Short = 1
val aInt = arrayListOf<Int>(1)
var bInt: Int = 1
val aLong = arrayListOf<Long>(1)
var bLong: Long = 1
val aFloat = arrayListOf<Float>(1.0f)
var bFloat: Float = 1.0f
val aDouble = arrayListOf<Double>(1.0)
var bDouble: Double = 1.0
aByte[0]--
bByte--
if (aByte[0] != bByte) return "Failed post-decrement Byte: ${aByte[0]} != $bByte"
aByte[0]++
bByte++
if (aByte[0] != bByte) return "Failed post-increment Byte: ${aByte[0]} != $bByte"
aShort[0]--
bShort--
if (aShort[0] != bShort) return "Failed post-decrement Short: ${aShort[0]} != $bShort"
aShort[0]++
bShort++
if (aShort[0] != bShort) return "Failed post-increment Short: ${aShort[0]} != $bShort"
aInt[0]--
bInt--
if (aInt[0] != bInt) return "Failed post-decrement Int: ${aInt[0]} != $bInt"
aInt[0]++
bInt++
if (aInt[0] != bInt) return "Failed post-increment Int: ${aInt[0]} != $bInt"
aLong[0]--
bLong--
if (aLong[0] != bLong) return "Failed post-decrement Long: ${aLong[0]} != $bLong"
aLong[0]++
bLong++
if (aLong[0] != bLong) return "Failed post-increment Long: ${aLong[0]} != $bLong"
aFloat[0]--
bFloat--
if (aFloat[0] != bFloat) return "Failed post-decrement Float: ${aFloat[0]} != $bFloat"
aFloat[0]++
bFloat++
if (aFloat[0] != bFloat) return "Failed post-increment Float: ${aFloat[0]} != $bFloat"
aDouble[0]--
bDouble--
if (aDouble[0] != bDouble) return "Failed post-decrement Double: ${aDouble[0]} != $bDouble"
aDouble[0]++
bDouble++
if (aDouble[0] != bDouble) return "Failed post-increment Double: ${aDouble[0]} != $bDouble"
return "OK"
}

View File

@@ -0,0 +1,69 @@
fun box(): String {
var aByte: Byte? = 0
var bByte: Byte = 0
var aShort: Short? = 0
var bShort: Short = 0
var aInt: Int? = 0
var bInt: Int = 0
var aLong: Long? = 0
var bLong: Long = 0
var aFloat: Float? = 0.0f
var bFloat: Float = 0.0f
var aDouble: Double? = 0.0
var bDouble: Double = 0.0
if (aByte != null) aByte--
bByte--
if (aByte != bByte) return "Failed post-decrement Byte: $aByte != $bByte"
if (aByte != null) aByte++
bByte++
if (aByte != bByte) return "Failed post-increment Byte: $aByte != $bByte"
if (aShort != null) aShort--
bShort--
if (aShort != bShort) return "Failed post-decrement Short: $aShort != $bShort"
if (aShort != null) aShort++
bShort++
if (aShort != bShort) return "Failed post-increment Short: $aShort != $bShort"
if (aInt != null) aInt--
bInt--
if (aInt != bInt) return "Failed post-decrement Int: $aInt != $bInt"
if (aInt != null) aInt++
bInt++
if (aInt != bInt) return "Failed post-increment Int: $aInt != $bInt"
if (aLong != null) aLong--
bLong--
if (aLong != bLong) return "Failed post-decrement Long: $aLong != $bLong"
if (aLong != null) aLong++
bLong++
if (aLong != bLong) return "Failed post-increment Long: $aLong != $bLong"
if (aFloat != null) aFloat--
bFloat--
if (aFloat != bFloat) return "Failed post-decrement Float: $aFloat != $bFloat"
if (aFloat != null) aFloat++
bFloat++
if (aFloat != bFloat) return "Failed post-increment Float: $aFloat != $bFloat"
if (aDouble != null) aDouble--
bDouble--
if (aDouble != bDouble) return "Failed post-decrement Double: $aDouble != $bDouble"
if (aDouble != null) aDouble++
bDouble++
if (aDouble != bDouble) return "Failed post-increment Double: $aDouble != $bDouble"
return "OK"
}

View File

@@ -0,0 +1,23 @@
class B<M>
interface A<T, Y : B<T>> {
fun <T, L> p(p: T): T {
return p
}
val <T> T.z : T?
get() = null
}
fun box(): String {
val defaultImpls = Class.forName("A\$DefaultImpls")
val declaredMethod = defaultImpls.getDeclaredMethod("p", A::class.java, Any::class.java)
if (declaredMethod.toGenericString() != "public static <T_I1,Y,T,L> T A\$DefaultImpls.p(A<T_I1, Y>,T)") return "fail 1: ${declaredMethod.toGenericString()}"
val declaredProperty = defaultImpls.getDeclaredMethod("getZ", A::class.java, Any::class.java)
if (declaredProperty.toGenericString() != "public static <T_I1,Y,T> T A\$DefaultImpls.getZ(A<T_I1, Y>,T)") return "fail 2: ${declaredProperty.toGenericString()}"
return "OK"
}

View File

@@ -90,18 +90,18 @@ fun box(
}
/*
9 INVOKEVIRTUAL A[0-9]+.removeAt \(I\) -> calls in bridges with signature `public final bridge remove\(I\)`
16 INVOKEVIRTUAL A[0-9]+\.remove \(I\) -> calls to A1-A9.removeAt + 7 calls from `public synthetic bridge remove\(I\)Ljava/lang/Object;`
16 INVOKEVIRTUAL A[0-9]+.removeAt \(I\) -> calls in bridges with signature `public final bridge remove\(I\)` + 7 calls from `public synthetic bridge remove\(I\)Ljava/lang/Object;`
9 INVOKEVIRTUAL A[0-9]+\.remove \(I\) -> calls to A1-A9.removeAt
1 INVOKEINTERFACE A9\.remove \(I\) -> call A9.removeAt
1 INVOKEINTERFACE A9\.remove \(Ljava/lang/Object;\) -> call A9.remove
2 INVOKEVIRTUAL A10\.remove \(I\) -> one call in function and one from `public synthetic bridge remove(I)Ljava/lang/Object;` bridge in A10
1 INVOKEVIRTUAL A10\.remove \(I\) -> one call in 'box' function
*/
// 9 INVOKEVIRTUAL A[0-9]+.removeAt \(I\)
// 16 INVOKEVIRTUAL A[0-9]+\.remove \(I\)
// 16 INVOKEVIRTUAL A[0-9]+.removeAt \(I\)
// 9 INVOKEVIRTUAL A[0-9]+\.remove \(I\)
// 1 INVOKEINTERFACE A9\.remove \(I\)
// 1 INVOKEINTERFACE A9\.remove \(Ljava/lang/Object;\)
// 2 INVOKEVIRTUAL A10\.remove \(I\)
// 1 INVOKEVIRTUAL A10\.remove \(I\)
// 2 INVOKEINTERFACE java\/util\/List.remove \(I\)
// 2 INVOKEINTERFACE java\/util\/List.remove \(Ljava/lang/Object;\)

View File

@@ -0,0 +1,4 @@
class A {
fun foo() = fun() {}
fun bar() = {}
}

View File

@@ -34,16 +34,12 @@ val <!INVALID_CHARACTERS!>`val\X`<!> = 10
val <!INVALID_CHARACTERS!>`;`<!> = 1
val <!INVALID_CHARACTERS!>`[`<!> = 2
val <!INVALID_CHARACTERS!>`]`<!> = 3
// org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException: Descriptor wasn't found for declaration PROPERTY
// Names which start with '<' are treated as "special": see Name.java
//val `<` = 4
val <!INVALID_CHARACTERS!>`<`<!> = 4
val <!INVALID_CHARACTERS!>`>`<!> = 5
val <!INVALID_CHARACTERS!>`:`<!> = 6
val <!INVALID_CHARACTERS!>`\`<!> = 7
// org.jetbrains.kotlin.resolve.lazy.NoDescriptorForDeclarationException: Descriptor wasn't found for declaration PROPERTY
// Names which start with '<' are treated as "special": see Name.java
//val `<>` = 8
val <!INVALID_CHARACTERS!>`<>`<!> = 8
val <!INVALID_CHARACTERS!>`[]`<!> = 9
val <!INVALID_CHARACTERS!>`[;]`<!> = 10

View File

@@ -2,6 +2,8 @@ package
public val `:`: kotlin.Int = 6
public val `;`: kotlin.Int = 1
public val `<`: kotlin.Int = 4
public val `<>`: kotlin.Int = 8
public val `>`: kotlin.Int = 5
public val `[`: kotlin.Int = 2
public val `[;]`: kotlin.Int = 10

View File

@@ -0,0 +1,14 @@
fun useDeclaredVariables() {
for ((a, b)<!SYNTAX!><!>) {
<!UNUSED_EXPRESSION, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>a<!>
<!UNUSED_EXPRESSION, DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>b<!>
}
}
fun checkersShouldRun() {
for ((@A a, <!UNDERSCORE_IS_RESERVED!>_<!>)<!SYNTAX!><!>) {
}
}
annotation class A

View File

@@ -0,0 +1,11 @@
package
public fun checkersShouldRun(): kotlin.Unit
public fun useDeclaredVariables(): kotlin.Unit
public final annotation class A : kotlin.Annotation {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -0,0 +1,8 @@
interface In<in E>
class En<T> : In<T>
class A : In<A>
fun <T> select(x: T, y: T): T = x ?: y
// Return type should be In<*> nor In<out Any?>
fun foobar(e: En<*>) = select(A(), e)

View File

@@ -0,0 +1,24 @@
package
public fun foobar(/*0*/ e: En<*>): In<*>
public fun </*0*/ T> select(/*0*/ x: T, /*1*/ y: T): T
public final class A : In<A> {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class En</*0*/ T> : In<T> {
public constructor En</*0*/ T>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface In</*0*/ in E> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -0,0 +1,7 @@
interface In<in E>
class A : In<A>
class B : In<B>
fun <T> select(x: T, y: T) = x ?: y
// Return type should be In<*> nor In<out Any?>
fun foobar(a: A, b: B) = select(a, b)

View File

@@ -0,0 +1,24 @@
package
public fun foobar(/*0*/ a: A, /*1*/ b: B): In<*>
public fun </*0*/ T> select(/*0*/ x: T, /*1*/ y: T): T
public final class A : In<A> {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class B : In<B> {
public constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface In</*0*/ in E> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -1,4 +1,4 @@
// FILE: a.Kt
// FILE: a.kt
package a
class C1 {

View File

@@ -0,0 +1,45 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
object Legal {
operator fun get(i: Int) = 0
operator fun set(i: Int, newValue: Int) {}
operator fun set(i: Int, newValue: String) {}
}
fun testLegal() {
++Legal[0]
Legal[0]++
Legal[0] += 1
}
object MismatchingTypes {
operator fun get(i: Int) = 0
operator fun set(i: Int, newValue: String) {}
}
fun testMismatchingTypes() {
++MismatchingTypes<!NO_SET_METHOD!>[0]<!>
MismatchingTypes<!NO_SET_METHOD!>[0]<!>++
MismatchingTypes<!NO_SET_METHOD!>[0]<!> += 1
}
object MismatchingArities1 {
operator fun get(i: Int) = 0
operator fun set(i: Int, j: Int, newValue: Int) {}
}
object MismatchingArities2 {
operator fun get(i: Int, j: Int) = 0
operator fun set(i: Int, newValue: Int) {}
}
fun testMismatchingArities() {
++MismatchingArities1<!NO_SET_METHOD!>[0]<!>
MismatchingArities1<!NO_SET_METHOD!>[0]<!>++
MismatchingArities1<!NO_SET_METHOD!>[0]<!> += 1
++<!NO_VALUE_FOR_PARAMETER!>MismatchingArities2[0]<!>
<!NO_VALUE_FOR_PARAMETER!>MismatchingArities2[0]<!>++
<!NO_VALUE_FOR_PARAMETER!>MismatchingArities2[0]<!> += 1
}

View File

@@ -0,0 +1,42 @@
package
public fun testLegal(): kotlin.Unit
public fun testMismatchingArities(): kotlin.Unit
public fun testMismatchingTypes(): kotlin.Unit
public object Legal {
private constructor Legal()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final operator fun get(/*0*/ i: kotlin.Int): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ newValue: kotlin.Int): kotlin.Unit
public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ newValue: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public object MismatchingArities1 {
private constructor MismatchingArities1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final operator fun get(/*0*/ i: kotlin.Int): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ j: kotlin.Int, /*2*/ newValue: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public object MismatchingArities2 {
private constructor MismatchingArities2()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final operator fun get(/*0*/ i: kotlin.Int, /*1*/ j: kotlin.Int): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ newValue: kotlin.Int): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public object MismatchingTypes {
private constructor MismatchingTypes()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final operator fun get(/*0*/ i: kotlin.Int): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public final operator fun set(/*0*/ i: kotlin.Int, /*1*/ newValue: kotlin.String): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -1,4 +1,4 @@
// FILE: InOut.k
// FILE: InOut.kt
interface In<in T>
// FILE: J1.java

View File

@@ -0,0 +1,17 @@
<!STRICTFP_ON_CLASS!>@kotlin.jvm.Strictfp<!> class A {
}
<!STRICTFP_ON_CLASS!>@kotlin.jvm.Strictfp<!> object B {
}
<!STRICTFP_ON_CLASS!>@kotlin.jvm.Strictfp<!> interface C {
}
fun foo() {
<!STRICTFP_ON_CLASS!>@kotlin.jvm.Strictfp<!> class D
<!STRICTFP_ON_CLASS!>@kotlin.jvm.Strictfp<!> object: Any() {}
}

View File

@@ -0,0 +1,23 @@
package
public fun foo(): kotlin.Unit
@kotlin.jvm.Strictfp() public final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.jvm.Strictfp() public object B {
private constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.jvm.Strictfp() public interface C {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -0,0 +1,7 @@
class Foo {
inline fun foo() = { }
}
// TESTED_OBJECT_KIND: class
// TESTED_OBJECTS: Foo$foo$1
// FLAGS: ACC_PUBLIC, ACC_FINAL, ACC_SUPER

View File

@@ -0,0 +1,7 @@
class Foo {
fun foo() = { }
}
// TESTED_OBJECT_KIND: class
// TESTED_OBJECTS: Foo$foo$1
// FLAGS: ACC_FINAL, ACC_SUPER

View File

@@ -0,0 +1,13 @@
class B<M>
interface A<T, Y : B<T>> {
fun <T, L> p(p: T): T {
return p
}
}
// method: A$DefaultImpls::p
// jvm signature: (LA;Ljava/lang/Object;)Ljava/lang/Object;
// generic signature: <T_I1:Ljava/lang/Object;Y:LB<TT_I1;>;T:Ljava/lang/Object;L:Ljava/lang/Object;>(LA<TT_I1;TY;>;TT;)TT;

View File

@@ -0,0 +1,13 @@
class B<M>
interface A<T, Y : B<T>, T_I1: T> {
fun <T, L> p(p: T): T {
return p
}
}
// method: A$DefaultImpls::p
// jvm signature: (LA;Ljava/lang/Object;)Ljava/lang/Object;
// generic signature: <T_I2:Ljava/lang/Object;Y:LB<TT_I2;>;T_I1::TT_I2;T:Ljava/lang/Object;L:Ljava/lang/Object;>(LA<TT_I2;TY;TT_I1;>;TT;)TT;

View File

@@ -0,0 +1,11 @@
class B<M>
interface A<T, Y : B<T>> {
val <T> T.z: T?
get() = null
}
// method: A$DefaultImpls::getZ
// jvm signature: (LA;Ljava/lang/Object;)Ljava/lang/Object;
// generic signature: <T_I1:Ljava/lang/Object;Y:LB<TT_I1;>;T:Ljava/lang/Object;>(LA<TT_I1;TY;>;TT;)TT;

View File

@@ -4481,6 +4481,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("ForLoopMissingLoopParameter.kt")
public void testForLoopMissingLoopParameter() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopMissingLoopParameter.kt");
doTest(fileName);
}
@TestMetadata("ForLoopWithExtensions.kt")
public void testForLoopWithExtensions() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/declarationChecks/multiDeclarations/ForLoopWithExtensions.kt");
@@ -6891,6 +6897,18 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("commonSupertypeContravariant.kt")
public void testCommonSupertypeContravariant() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant.kt");
doTest(fileName);
}
@TestMetadata("commonSupertypeContravariant2.kt")
public void testCommonSupertypeContravariant2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/commonSupertypeContravariant2.kt");
doTest(fileName);
}
@TestMetadata("genericsInType.kt")
public void testGenericsInType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/generics/genericsInType.kt");
@@ -11628,6 +11646,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("InconsistentGetSet.kt")
public void testInconsistentGetSet() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.kt");
doTest(fileName);
}
@TestMetadata("IteratorAmbiguity.kt")
public void testIteratorAmbiguity() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/operatorsOverloading/IteratorAmbiguity.kt");

View File

@@ -193,6 +193,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName);
}
@TestMetadata("strictfpOnClass.kt")
public void testStrictfpOnClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/strictfpOnClass.kt");
doTest(fileName);
}
@TestMetadata("Synchronized.kt")
public void testSynchronized() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/Synchronized.kt");

View File

@@ -89,6 +89,12 @@ public class CheckLocalVariablesTableTestGenerated extends AbstractCheckLocalVar
doTest(fileName);
}
@TestMetadata("kt11117.kt")
public void testKt11117() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/checkLocalVariablesTable/kt11117.kt");
doTest(fileName);
}
@TestMetadata("lambdaAsVar.kt")
public void testLambdaAsVar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/checkLocalVariablesTable/lambdaAsVar.kt");

View File

@@ -103,6 +103,15 @@ public class InnerClassInfoGenTest extends CodegenTestCase {
checkAccess("A", "PublicClass", ACC_PUBLIC);
}
public void testLambdaClassFlags() {
InnerClassAttribute foo = new InnerClassAttribute("A$foo$1", null, null, ACC_STATIC | ACC_FINAL);
InnerClassAttribute bar = new InnerClassAttribute("A$bar$1", null, null, ACC_STATIC | ACC_FINAL);
extractAndCompareInnerClasses("A", foo, bar);
extractAndCompareInnerClasses("A$foo$1", foo);
extractAndCompareInnerClasses("A$bar$1", bar);
}
private void checkAccess(@NotNull String outerName, @NotNull final String innerName, int accessFlags) {

View File

@@ -644,6 +644,27 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
}
}
@TestMetadata("compiler/testData/writeFlags/lambda")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Lambda extends AbstractWriteFlagsTest {
public void testAllFilesPresentInLambda() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/lambda"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("lambdaInInlineFunction.kt")
public void testLambdaInInlineFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/lambda/lambdaInInlineFunction.kt");
doTest(fileName);
}
@TestMetadata("simpleLambda.kt")
public void testSimpleLambda() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/lambda/simpleLambda.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/writeFlags/lateinit")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)

View File

@@ -367,6 +367,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt11163.kt")
public void testKt11163() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/binaryOp/kt11163.kt");
doTest(fileName);
}
@TestMetadata("kt6747_identityEquals.kt")
public void testKt6747_identityEquals() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/binaryOp/kt6747_identityEquals.kt");
@@ -5659,6 +5665,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("kt11117.kt")
public void testKt11117() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/kt11117.kt");
doTest(fileName);
}
@TestMetadata("kt1136.kt")
public void testKt1136() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/objects/kt1136.kt");
@@ -5920,6 +5932,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("nestedMaps.kt")
public void testNestedMaps() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/nestedMaps.kt");
doTest(fileName);
}
@TestMetadata("overloadedSet.kt")
public void testOverloadedSet() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/operatorConventions/overloadedSet.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/codegen/box/operatorConventions/compareTo")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -7009,6 +7033,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/regressions"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("commonSupertypeContravariant.kt")
public void testCommonSupertypeContravariant() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/commonSupertypeContravariant.kt");
doTest(fileName);
}
@TestMetadata("commonSupertypeContravariant2.kt")
public void testCommonSupertypeContravariant2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/commonSupertypeContravariant2.kt");
doTest(fileName);
}
@TestMetadata("doubleMerge.kt")
public void testDoubleMerge() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/regressions/doubleMerge.kt");
@@ -7477,6 +7513,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("commonBridgesTarget.kt")
public void testCommonBridgesTarget() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/commonBridgesTarget.kt");
doTest(fileName);
}
@TestMetadata("emptyList.kt")
public void testEmptyList() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/specialBuiltins/emptyList.kt");

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