Commit Graph

61307 Commits

Author SHA1 Message Date
Pavel Kirpichenkov 75d57c7d3f Update pattern for finding diagnostics in diagnostic tests
Also use updated diagnostic pattern in TreesCompareTest.
In rare cases diagnostic was cut too early on !> characters,
that were a part of diagnostic parameter:
<!DIAGNOSTIC("Type<DefinitelyNotNullTypeArgument!!>")!>
2020-02-04 17:49:18 +03:00
Kristoffer Andersen 4dd794c2d2 [JVM_IR] Propagate Type Parameters to DefaultImpls
This ensures correct generation of generic signatures in the resulting
byte code, but it _is_ a work in progress: the actual type *arguments*
passed for these parameters during compilation are dummy `Any?` types.

Sites that need more work are indicated with TODO's.

- copy type parameters of interfaces to methods moved to DefaultImpls
- implement type parameter renaming scheme from JVM, with proper
  renaming and substitution.
- adjust call sites in bridges in classes->DefaultImpls
- adjust call sites in bridges from DefaultImpls->Interface
- adjust call sites in bridges from DefaultImpls->DefaultImpls
- adjust super calls ->DefaultImpls
- adjust calls in code of Interfaces->DefaultImpls
2020-02-04 17:41:31 +03:00
Kristoffer Andersen 3606a4104b [JVM IR] Documentation for remapTypeParameters 2020-02-04 17:41:31 +03:00
Dmitry Gridin 6c439ae85a Create TrailingCommaIntention
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin 195d9020a6 TrailingCommaInspection: shouldn't be associated with formatter settings
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin b5d0956a5e Move call-site trailing comma to registry
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin c34b417d0c Fix tests after disabling trailing comma
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin 3fb34596ae Code style: disable trailing comma by default
#KT-34744
2020-02-04 21:34:52 +07:00
Denis Zharkov 4f834cb16b FIR: Get rid of replacements map during calls completion
Otherwise, it's complicated to work with nested lambdas:
outer/inner ones may be replaced independently and still refer
to the old one instances.
So in the changed test, if we don't apply the commit, will remain
implicit return and receiver types for the nested lambda

Anyway, once we decided to leave immutable semantics,
replacements are not necessary anymore
2020-02-04 16:24:01 +03:00
Denis Zharkov 8d24e0f842 FIR: Add some absent "replace" methods for callable declarations
It's necessary to avoid copying lambdas in LambdaAnalyzerImpl
2020-02-04 16:24:01 +03:00
Denis Zharkov c3e900b945 FIR: Make replace function accepting parameter with nullability as-is 2020-02-04 16:24:01 +03:00
Denis Zharkov 23e9a0c861 FIR: Force processing postponed arguments nested in lambdas
See the call-site of processAllContainingCallCandidates in getOrderedNotAnalyzedPostponedArguments
2020-02-04 16:24:01 +03:00
Ilya Goncharov 1e2e556328 [Gradle, JS] Fix test 2020-02-04 16:21:13 +03:00
Igor Chevdar 8214a9383c Enabled some tests 2020-02-04 16:14:29 +03:00
Igor Chevdar 562e8e357a [IR] SAM lowering: supported suspend functions 2020-02-04 16:14:27 +03:00
Igor Chevdar d6f91333dc [IR] SAM lowering: use block body instead of expr body
irBlockBody { +irReturn(..) } instead of irExprBody { .. }
K/N doesn't support expr bodies for now
2020-02-04 16:14:27 +03:00
Igor Chevdar 645488b342 [IR] SAM lowering: place wrappers into file if no enclosing class exists 2020-02-04 16:14:27 +03:00
Igor Chevdar 6ecda9e8af [IR] [JVM_IR] Commonized SAM conversions lowering 2020-02-04 16:14:27 +03:00
Dmitriy Dolovov 4dbf60eb2c Fix: Load properties in konan Distribution in safe way
Issue #KT-36333
2020-02-04 19:24:42 +07:00
Dmitriy Dolovov f69eef811b Minor: Remove unnecessary IO check 2020-02-04 19:24:36 +07:00
Mikhail Glukhikh b1436804b3 [FIR, by demiurg] Fix exception in DFA for a case with lambda empty body 2020-02-04 15:00:13 +03:00
Mikhail Glukhikh 64c7ab1302 [FIR] Fix lambda resolve in independent context 2020-02-04 15:00:12 +03:00
Mikhail Glukhikh 4f8d0382f7 Get rid of FirControlFlowGraphOwner 2020-02-04 15:00:11 +03:00
Mikhail Glukhikh f28144ff9c Minor FirRenderer code cleanup 2020-02-04 15:00:10 +03:00
Mikhail Glukhikh e977c1c076 Get rid of name in FirConstructor 2020-02-04 15:00:10 +03:00
Mikhail Glukhikh f20845ba40 Get rid of FirMemberFunction 2020-02-04 15:00:09 +03:00
Mikhail Glukhikh 677129ad20 Get rid of FirNamedDeclaration 2020-02-04 15:00:08 +03:00
Ilya Kirillov 7a52cf103a Fix change signature refactoring
Do not increase modification count for OutOfCodeBlockTracker when KtTypeCodeFragment is modified

KtTypeCodeFragment is used in UI for providing completion for types.
When OutOfCodeBlockModification happens it invalidates ModuleDescriptors
But change signature relies on them which causes InvalidModuleException

#KT-35903 fixed
#KT-35689 fixed
#KT-34415 fixed
#KT-34415 fixed
2020-02-04 14:15:25 +03:00
Ilya Kirillov ed5156ee83 Wizard: do not show disable/enable checkbox for new project wizard in AS
#KT-36195 fixed
2020-02-04 14:15:24 +03:00
Jinseong Jeon 451fa245b8 JVM_IR: Change name for (dispatch|extension) receiver of inline class according to naming convention. 2020-02-04 11:52:56 +01:00
Alexander Udalov 19b516cbf4 JVM IR: do not erase static fields in annotation classes 2020-02-04 11:43:24 +01:00
Alexander Udalov 00de5dae32 JVM IR: copy property instead of field in MoveOrCopyCompanionObjectFieldsLowering
This way we're making sure that the copied field has some associated
property, where we can get the value of isConst flag from. That flag is
later used in StaticInitializersLowering to determine whether we need to
erase initializer of a field. The tests are unmuted because now the
initializer is correctly _not_ erased. (They were passing before
switching master to 1.4 because without
NoConstantValueAttributeForNonConstVals, we treated all static fields
with primitive/string values as const, and never erased initializers
because of that.)
2020-02-04 11:43:24 +01:00
Alexander Udalov e42a4b2fac IR: extract JvmPropertiesLowering out of PropertiesLowering 2020-02-04 11:43:23 +01:00
Ilya Goncharov 60da37404e [Gradle, JS] Distribution and distributeResources 2020-02-04 13:07:10 +03:00
Dmitriy Dolovov e302818e26 Refactor KotlinNativeToolRunner to make it extendable
Now, it's possible to add new tool runners independent of Kotlin/Native
distribution. Ex: Upcoming KotlinNativeKlibCommonizerToolRunner
2020-02-04 15:49:49 +07:00
Mikhail Zarechenskiy cb07c9172f [NI] Record substituted generic signature for SAM arguments
#KT-36297 Fixed
2020-02-04 10:26:48 +03:00
Dmitry Petrov 8ef79f932c JVM_IR: Implement some BE diagnostics
TODO proper diagnostics tests with BE diagnostics
2020-02-04 00:04:22 +03:00
Georgy Bronnikov c9df17f2f1 Handle type arguments in IrType.eraseTypeParameters 2020-02-03 19:14:22 +03:00
Mikhail Glukhikh 22068dd6ad [FIR TEST] Update test data due to hardened receiver check (NB: broken)
In particular, nullable invoke extension call and some smart casts
are broken here
2020-02-03 16:45:21 +03:00
Mikhail Glukhikh 7dca4d2fee [FIR TEST] Update test data for purely implements case (NB: broken)
In this case Java super type arguments should be not null, not flexible
2020-02-03 16:45:21 +03:00
Mikhail Glukhikh b25d99c1e5 [FIR TEST] Add test with some problematic smart casts 2020-02-03 16:45:20 +03:00
simon.ogorodnik ca5fee77d4 [FIR] Fix generation of raw FIR for delegate with receiver 2020-02-03 16:45:20 +03:00
simon.ogorodnik ef5aab374b [FIR] Fix implicit this aliasing in DFA 2020-02-03 16:45:20 +03:00
simon.ogorodnik 645602b675 [FIR] Fix data-flow after while loops 2020-02-03 16:45:20 +03:00
Mikhail Glukhikh 91b432b4a1 [FIR] Java super-type arguments are now handled as flexible 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh aeb6f35571 Support nullable callable references in FIR resolve 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh a584589665 Support nullable callable references in raw FIR 2020-02-03 16:45:19 +03:00
Mikhail Glukhikh 95122f1d0b Add two more FIR problematic tests 2020-02-03 16:45:18 +03:00
Mikhail Glukhikh 0b377c103a Add FIR problematic test (safe extension invoke) 2020-02-03 16:45:18 +03:00
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00