Commit Graph

68695 Commits

Author SHA1 Message Date
Pavel Kirpichenkov 873224dfbc [NI] Use new type substitutor for known type parameters
Use known type parameters substitutor after substitutor for fresh variables.
The old logic of substituions had the following order:
- replace known type parameters
- replace type parameters with type variables
- complete inference
- replace type variables with inferred types

According to the updated logic, replacement goes as follows:
- replace type parameters with type variables
- replace known type parameters; if they were variables, this will effectively remove them from inference
- complete inference
- replace remaining type variables with inferred types

Support projection substitution in new type substitutor.
It is needed for correct interaction with old type substitutor.
Old type substitutors can contain mappings constructor -> projection
which couldn't be expressed correctly with existing substitutor API in some cases.

^KT-41386 Fixed
2020-08-31 17:53:46 +03:00
Alexander Udalov c706673de9 Minor, refactor bytecode text tests on when-over-string optimization
- Merge `duplicatingItemsSameHashCode.kt` and
  `duplicatingItemsSameHashCode2.kt` into one test enabled on both
  backends, and rename it to
  `duplicatingItemsSameHashCodeFewBranches.kt`.
- Rename `duplicatingItemsSameHashCode3.kt` to
  `duplicatingItemsSameHashCodeMoreBranches.kt`, and also enable it for
  both backends.
- Use JVM_TEMPLATES/JVM_IR_TEMPLATES to check backend-specific behavior:
    1) JVM IR does not optimize less than 2 branches by design
    2) JVM IR does not generate duplicate branches, also by design

Related to KT-36846.
2020-08-31 16:47:11 +02:00
Alexander Udalov a639915a34 JVM IR: do not mangle property accessors of unsigned types in annotations
Before this change, we incorrectly mangled the names of annotation
methods (e.g. `getI-pVg5ArA` instead of `i`) because the isSpecial
condition was false.
2020-08-31 14:19:14 +02:00
Mikhail Glukhikh 1e360d9c91 [FIR2IR] Pass type context for type argument conversion properly 2020-08-31 14:31:58 +03:00
Jinseong Jeon 04af6846a7 FIR2IR: handle more vararg spreads for adapted callable references 2020-08-31 14:31:58 +03:00
Mikhail Glukhikh 5efabe063e [FIR] Fix JVM mapped function callable id 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh db815c96c5 [FIR] Substitute copied type parameters in fake override properties 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh dc9306367a FirClassSubstitutionScope: reorder companion functions 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 5ad453d927 [FIR] Substitute copied type parameters in fake override functions 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 458f89ef33 [FIR] Signature composer: return null signature for local declarations 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 02b6f34067 [FIR2IR] Add extension receiver parameter to delegated members 2020-08-31 14:31:57 +03:00
Mikhail Glukhikh 22c63c4e80 [FIR2IR] Add supertypes to delegated member type parameters 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh 9ad55a0ee3 [FIR2IR] Don't create list under the hood in DelegatedMemberGenerator 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh 5384ccf02f [FIR] Introduce & use FirDelegatedMemberScope 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh f0af930288 [FIR] Eliminate unused FirDelegatedTypeRef 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh ede910065a [FIR] Add problematic resolve test case with delegated super call 2020-08-31 14:31:56 +03:00
Mikhail Glukhikh 3f5beb77e8 [FIR2IR] Cache delegatable members properly 2020-08-31 14:31:55 +03:00
Alexander Udalov 1e712f8398 IR: remove IrElementVisitorVoidWithContext
It was only used as a superclass in IrInlineReferenceLocator and
LocalDeclarationsLowering. In both cases it's clearer and more optimal
to pass the necessary data via the visitor 'data' variable.
2020-08-31 12:47:54 +02:00
Alexander Udalov 5e48be3d11 Add a fallback flag -Xno-unified-null-checks for KT-22275
#KT-41482 Fixed
2020-08-31 12:43:28 +02:00
Ilya Kirillov 40669350f7 Wizard: navigate to wizard help page when clicking help button 2020-08-31 12:50:01 +03:00
Ilya Kirillov fa847d758d Wizard: use compileKotlin for groovy instead of direct KotlinCompile task access
#KT-38921 fixed
2020-08-31 12:49:48 +03:00
Ilya Goncharov e672f5f8e3 [Wizard, JS] Remove duplicating descriptions 2020-08-31 12:19:10 +03:00
Ilya Goncharov 554c67cd1d [Wizard, JS] Add descriptions to wizard options 2020-08-31 12:16:54 +03:00
Nicolay Mitropolsky af35b6c3c8 Provide icons to Kotlin Light-elements (KT-26235) 2020-08-31 10:54:46 +03:00
Igor Chevdar 527de030fc [box-tests] Turned on some tests for K/N 2020-08-31 12:01:31 +05:00
Igor Chevdar ab54e43b00 [IR] Commonized SAM equals/hashCode builder 2020-08-31 12:01:29 +05:00
Igor Chevdar 12ddd137bc [IR] Moved isLambda to common IR utils 2020-08-31 12:01:29 +05:00
vldf b050ef9970 [FIR] Remove print in UnusedChecker 2020-08-30 14:18:01 +03:00
Ilya Gorbunov 9c3ff6828a Export kotlin.test packages with annotations and underlying frameworks
- Add exports for jvm package names used in kotlin.test annotations;

- Export transitively underlying test framework modules
Otherwise "This class does not have a constructor" happens when using
an aliased annotation, e.g. kotlin.test.Test aliased to org.junit.test

KT-41320
2020-08-29 03:33:38 +03:00
Andrey.Lozhkin ef57c62576 [Gradle, Cocoapods] refactor I/O, improve Up-To-Date
all synthetic tasks are per pod
tasks receive parts of extension as inputs
2020-08-29 01:51:20 +03:00
Andrey.Lozhkin 1888462dc0 [Gradle, Cocoapods] move tasks from per target
podGen now per Family
podSetupBuild and podBuild now per sdk
2020-08-29 01:51:20 +03:00
Andrey Lozhkin fcf5060907 [Gradle, Cocoapods] implement DSL to support Cocoapods Dependencies from Git or Web
Issue #KT-41367 Fixed
2020-08-29 01:51:20 +03:00
Steven Schäfer b02f0f0a25 JVM IR: Fix compilation of nested inner classes 2020-08-28 20:03:19 +02:00
Steven Schäfer 02e78bcd76 JVM IR: Use package visibility for fields of captured variables 2020-08-28 20:03:19 +02:00
Roman Artemev 443269af0a [IR] Drop irProviders from stub generator 2020-08-28 18:14:05 +03:00
Roman Artemev 39808789c3 [KLIB] Fix SOE in K/N
- fixes KT-41324
2020-08-28 18:14:04 +03:00
Mikhail Zarechenskiy 23f87d413a Use initial system for completion if common one is effectively empty
Otherwise we can get unsubstituted type variables as expected types and
 then write wrong information for assertions

 #KT-41470 Fixed
2020-08-28 17:47:08 +03:00
Nick bb18203ae6 [FIR] Various checkers performance fixes 2020-08-28 17:07:35 +03:00
Sergey Igushkin 5c88eb722d Fix transitive deps on MPP with host-specific source sets (KT-41083)
A consumer could not resolve the host-specific metadata artifact
of the transitive dependency because the transitive dependency's parent
in the platform dependencies graph did not include the dependency on it
in the variant that is chosen for host-specific source sets metadata:
the dependencies of that variant were empty.

Export the dependencies of the Kotlin/Native target in the host-specific
metadata variant as well.

Issue #KT-41083 Fixed
2020-08-28 11:09:56 +00:00
Zalim Bashorov 9097d0918c [JS BE] Support passing an array as argument of vararg in named form
#KT-38059 fixed
2020-08-28 13:14:23 +03:00
Zalim Bashorov 606232a584 [JS IR] Don't generate "import" statements for external interfaces
#KT-40964 fixed
2020-08-28 13:14:22 +03:00
Zalim Bashorov ba846830c9 [JS IR] Support nativeGetter, nativeSetter and nativeInvoke
#KT-41081 fixed
2020-08-28 13:04:18 +03:00
Ilya Kirillov c804319e65 FIR IDE: fix compilation on AS 2020-08-28 12:51:55 +03:00
Ilya Kirillov 36cc73602e FIR IDE: fix testdata of AbstractFirLazyResolveTest 2020-08-28 12:51:55 +03:00
Ilya Kirillov 3cd445563e FIR IDE: implement KotlinExpressionTypeProvider for FIR 2020-08-28 12:51:55 +03:00
Ilya Kirillov fcc7db5224 FIR IDE: introduce analyseInModalWindow function 2020-08-28 12:51:23 +03:00
Ilya Kirillov 81be230541 FIR IDE: add validity assertion on analysis session access 2020-08-28 12:15:19 +03:00
Ilya Kirillov db48884a4e FIR IDE: add check canceled check between diagnostics 2020-08-28 12:15:18 +03:00
Ilya Kirillov 95a96f32bf FIR IDE: log errors on diagnostics, not throw them 2020-08-28 12:15:17 +03:00
Ilya Kirillov ebafd0fb51 FIR IDE: resolve ambiguity & inapplicable references 2020-08-28 12:15:16 +03:00