Commit Graph

61329 Commits

Author SHA1 Message Date
Pavel Kirpichenkov 2a15df6a20 [IDEA-TESTS] Update configuration tests involving LATEST_STABLE version
Change `LATEST_STABLE` with `VersionView.RELEASED_VERSION`
in tests checking default language configuration options.

Replace `LATEST_STABLE` with fixed version in `testDropKotlincOnVersionAutoAdvance`
as the test actually compares it with version from kotlinc.xml.
It being latest stable is not relevant.

By default the lastest stable Kotlin version is selected for module
when there is no explicit version in configuration. However, it is
the version previous to `LanguageVersion.LATEST_STABLE` during prerelease.
2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov a5d201e263 Exclude unsupported language versions from gradle options
^KT-36146 Fixed
2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov f530c0c903 minor: reformat 2020-02-05 20:15:17 +03:00
Pavel Kirpichenkov 87e0186334 Cleanup test checking legacy inline suspend
Move expected library compilation output to file.
^KT-36240 Fixed
2020-02-05 19:34:59 +03:00
Ilmir Usmanov 8335ad7e98 JVM_IR: Minor. Add test 2020-02-05 15:07:55 +01:00
Ilmir Usmanov 5977799c59 JVM_IR: Get rid of non-local related hacks in coroutines inlining 2020-02-05 15:07:49 +01:00
Ilmir Usmanov e5bd4f74f3 JVM_IR: Do not copy attributes into DEFAULT_IMPLS functions
Otherwise, on creating suspend function views these functions will clash
with interface ones. Instead, compute name of their continuation classes
based on attributes of the interface class.
2020-02-05 15:07:43 +01:00
Ilmir Usmanov fc70455877 JVM_IR: Move suspend function views creation to lowering
Now AddContinuationLowering is responsible for both adding continuation
classes to suspend functions and adding continuation parameters to
them.
Because we cannot create a view if inline suspend function is defined
in another file, we generate a stub without body when we encounter call
to it. And then, when we lower the file containing the function we add
the body. This way we have no unlowered views after the lowering.
Thus, after the lowering there should be no suspend function, which
are not views, therefore, remove VIEW origins.
Because transformations of suspend functions can copy them into another
object, use attribute as a key inside function to view map.
2020-02-05 15:07:37 +01:00
Alexander Udalov 5e7343624b Update test data of wrongInlineTarget to 1.4 2020-02-05 13:09:53 +01:00
Alexander Udalov 9f9eef44b1 Use captured type approximation from new inference in ExpressionCodegen
This is needed in order to avoid star projections being expanded into
`out Any?`, which is visible for users of `typeOf` since 1.4.

 #KT-30278 Fixed
2020-02-05 13:09:08 +01:00
Toshiaki Kameyama 4d1937b92d "Redundant 'suspend' modifier": do not report when function has 'suspend' calls by parenthesized expression
#KT-24869 Fixed
2020-02-05 14:31:13 +03:00
Roman Golyshev 31315e2c45 Add plugin_version and file_type features for ML completion
- This is required to be able to use ML completion infrastructure to monitor code completion quality (even without ML enhancement)
2020-02-05 12:19:49 +03:00
Mikhail Glukhikh 98ea2231f1 [FIR] Code cleanup: NodeConfigurator 2020-02-05 11:19:25 +03:00
Mikhail Glukhikh 0fa98ed635 [FIR] Discriminate abstract members when resolving on super 2020-02-05 11:19:23 +03:00
Mikhail Glukhikh 8e40782e7b [FIR] Add test with abstract / non-abstract ambiguity 2020-02-05 11:19:22 +03:00
Mikhail Glukhikh f7d658b624 FIR2IR: fix dispatch receiver generation (non-function case) 2020-02-05 11:19:21 +03:00
Mikhail Glukhikh b09b2673bf FIR2IR: handle non-ambiguous super references properly 2020-02-05 11:19:20 +03:00
Mikhail Glukhikh 71b0840ef9 [FIR] Implement super resolve as a particular tower resolver case 2020-02-05 11:19:19 +03:00
Dmitry Petrov ee020ef290 KT-36336 @EnhancedNullability and null checks
Don't insert implicit null check on a value of @EnhancedNullability type
used where @EnhancedNullability type is expected.

This uncovers a bunch of other problems in FE and BE.
KT-36343 and KT-36347 are bugs in StrictJavaNullabilityAssertions
implementation which should most likely be fixed in next major language
version (with proper breaking change notice).
KT-36344 is a design problem which should be addressed after 1.4 issues
are resolved.
2020-02-05 11:15:41 +03:00
Vladimir Dolzhenko 6489b56fb0 Fix 192 compilation for move remove redundant imports to bg thread
Relates to #KT-24122
2020-02-04 18:36:38 +01:00
Vladimir Dolzhenko dd0613bc7a Move remove redundant imports to bg thread
#KT-24122 Fixed
2020-02-04 16:34:57 +01:00
Denis Zharkov fef2e06db4 FIR: Fix test data 2020-02-04 17:55:12 +03:00
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