Commit Graph

20920 Commits

Author SHA1 Message Date
Alexander Udalov 789a6f9c63 Add test for deterministic bridge order
The test didn't fail before fixin the issue (in the previous commit),
but may still be useful in the future

 #KT-23707 Fixed
2018-04-18 15:55:33 +02:00
Denis Vnukov e3829a70b0 Stable order of synthesized bridges.
In some cases when several bridge methods are generated, their order
is undetermenistic. For example for class ClassLowerWithContext in the
following example

```
interface IrElement
class IrClassContext

interface IrElementVisitor<out R, in D> {
    fun visitElement(element: IrElement, data: D): R
}

interface IrElementTransformer<in D> : IrElementVisitor<IrElement, D> {
    override fun visitElement(element: IrElement, data: D): IrElement =
            element.also { throw RuntimeException() }
}

abstract class ClassLowerWithContext : IrElementTransformer<IrClassContext?>
```

kotlin compiler synthesizes two additional bridges:

  public IrElement visitElement(IrElement, IrClassContext);
  [bridge] public Object visitElement(IrElement, Object);
  [bridge] public IrElement visitElement(IrElement, Object);

Unfortunately the behavior is not deterministic and not easy to reproduce.
2018-04-18 15:36:33 +02:00
Mikhail Glukhikh 5212b97047 Remove reformatting in intentions isApplicable via createByPattern 2018-04-18 16:15:57 +03:00
Toshiaki Kameyama 1cd438c3f7 Add inspection "main should return Unit" #KT-16085 Fixed 2018-04-18 10:59:23 +03:00
Ilya Gorbunov 8784d89f38 Use kotlin-stdlib-sources.jar in tests
Instead of deprecated kotlin-runtime-sources
2018-04-18 05:22:40 +03:00
Mikhail Zarechenskiy 4af8833f08 Render unwrapped suspend function in backend
Hierarchy of specially wrapped suspend function may have inconsistent
 overridden descriptors: some of them may be wrapped, some unwrapped.
 To mitigate this problem, currently it's proposed to render only
 unwrapped functions, which are always have stable overridden descriptors

 #KT-23809 Fixed
2018-04-17 16:24:13 +03:00
Mikhail Zarechenskiy c216749eb6 [NI] Fix substitutor for anonymous types with captured type parameters 2018-04-17 16:06:55 +03:00
Dmitry Petrov d3a1d93460 Type translation, initial import 2018-04-17 10:35:52 +03:00
Dmitry Petrov d1fe32a486 IrType: basic interface & implementation 2018-04-17 10:35:52 +03:00
Mikhail Zarechenskiy 3318549622 [NI] Fix smartcasts computation for dot-qualifier expressions 2018-04-16 18:13:12 +03:00
Nikolay Krasko ecd2db3b48 Remove bunch files that are equal to base files 2018-04-16 15:55:53 +03:00
Zalim Bashorov e1ba08e03d [JS IR BE] add new items to whitelist and regenerate tests 2018-04-16 14:34:44 +03:00
Zalim Bashorov ac42a0a23e [JS IR BE] don't materialize Unit for toplevel expressions 2018-04-16 14:34:44 +03:00
Zalim Bashorov 8408bada76 [JS IR BE] basic support for the case when IrBlock is used as expression
In this case compiler generates comma separated expressions.
2018-04-16 14:34:43 +03:00
Zalim Bashorov 77ac0a5d95 [JS IR BE] use most of new intrinsics in IR -> IR 2018-04-16 14:34:43 +03:00
Zalim Bashorov 48219e4a9a [JS IR BE] support new intrinsics in IR -> JS 2018-04-16 14:34:43 +03:00
Zalim Bashorov 76e102a2d2 [JS IR BE] declare more intrinsics
* jsGt
* jsGtEq
* jsLt
* jsLtEq
* jsUnaryPlus
* jsUnaryMinus
* jsPrefixInc
* jsPostfixInc
* jsPrefixDec
* jsPostfixDec
* jsAnd
* jsOr
* jsBitAnd
* jsBitOr
* jsBitXor
* jsBitNot
* jsBitShiftR
* jsBitShiftRU
* jsBitShiftL
* jsInstanceOf
2018-04-16 14:34:42 +03:00
Zalim Bashorov 2ed82f136c [JS IR BE] move intrinsic for Object.create calls to JsIntrinsics 2018-04-16 14:34:42 +03:00
Zalim Bashorov 89aefb2e3f [JS IR BE] add basic support for some binary and equality operations; add some intrinsic infrastructure 2018-04-16 14:34:41 +03:00
Zalim Bashorov 1f7d818307 [JS IR BE] use mapTo instead of map when translate call arguments 2018-04-16 14:34:41 +03:00
Zalim Bashorov 194f5d575a [JS IR BE] use IrMemberAccessExpression.valueArgumentsCount instead of descriptor based IrFunctionSymbol.parameterCount and remove last one 2018-04-16 14:34:40 +03:00
Vyacheslav Gerasimov a6bd0f618e as32: Remove platform-api & platform-impl from build scripts
since they are not present in AS 3.2 C10
2018-04-13 21:33:14 +03:00
Vyacheslav Gerasimov 4299455dc1 as32: Update to AS 3.2 C10 2018-04-13 21:33:03 +03:00
Alexey Sedunov c7e72af170 Override/Implement Members: Copy @Experimental-annotated annotations
#KT-22922 Fixed
2018-04-13 20:23:06 +03:00
Alexey Sedunov bf106d01b8 Find Usages: Restrict search scope of private top-level declarations
#KT-7622 Fixed
2018-04-13 20:23:04 +03:00
Alexander Udalov 30b9caeae6 Fix NPE in data class 'equals' codegen
Do not perform the optimization from 0a11385006 for data class
properties of nullable types
2018-04-12 22:19:30 +02:00
Nikolay Krasko 579b773388 172: Remove 172 specific from psiModificationUtils.kt and KtPsiFactory.kt 2018-04-12 19:29:01 +03:00
Alexander Udalov 1b1e4ab970 Fix stdlib test path in GenerateRangesCodegenTestData
This fixes `./gradlew generateTests`
2018-04-12 18:28:17 +02:00
Alexey Tsvetkov ea8f2b5cd8 Clear MockApplication in ClassesFqNamesTest 2018-04-12 18:26:50 +03:00
Mikhail Zarechenskiy 612baacc25 Make useless elvis diagnostic more consistent for new and old inference
Also, remove diagnostics that can be covered by usual USELESS_ELVIS diagnostic
2018-04-12 14:38:55 +03:00
Dmitry Savvinov 934c56a4da Wire StorageManager into a ClassTypeConstructorImpl and ClassDescriptorImpl 2018-04-12 13:44:10 +03:00
Mikhail Glukhikh 1477e67076 Optimize KtPropertyAccessor.hasBlockBody() 2018-04-12 11:03:41 +03:00
Alexey Tsvetkov bd50ad87ba Use KotlinCoreEnvironment for parsing Kotlin in IC
Creating and disposing CoreApplicationEnvironment on each call leads to
problems with parallel builds, while KotlinCoreEnvironment
avoids disposing application environment in case of parallel builds.

    #KT-23694 fixed
2018-04-11 19:56:15 +03:00
Alexey Tsvetkov 13ac64b84a Move parseFileUtils to incremental-compilation-impl 2018-04-11 19:56:15 +03:00
Denis Zharkov 1442dd6c2b Avoid exponential complexity in LexicalScope::findLocalVariable
There was an exponential complexity in case we have a chain
of nested LexicalScopeWrapper instances:
we were walking through the chain and on each step running
the algorithm recursively.

Such a case is possible in scripts where each line contains LexicalScopeWrapper

The fix looks safe to me because delegate was used there
for checking !is ImportingScope && !is LexicalChainedScope

In all other means, being recursively run the algorithm does the same job.

 #KT-22740 Fixed
2018-04-11 17:53:19 +03:00
Denis Zharkov a3c8afade5 Minor. Reformat ScopeUtils.kt 2018-04-11 17:53:19 +03:00
Felix Guo 9539212180 Take Java source file into account in "Add annotation target"
So #KT-22860 Fixed
2018-04-11 17:00:37 +03:00
Nikolay Krasko 5559a6edd3 Fix quick fix, refactoring and slice tests - ignore bunch files 2018-04-11 16:28:45 +03:00
Vyacheslav Gerasimov b98b02b56e 182: Suppress proguard warnings for com.intellij.util.SVGLoader
Depends on apache batick which has lots of dependencies, probably should be refactored out in idea
2018-04-11 16:28:44 +03:00
Vyacheslav Gerasimov 2514800ce0 182: Suppress proguard warnings for new guava nullability annotations 2018-04-11 16:28:44 +03:00
Vyacheslav Gerasimov d9f9bf7564 182: Set picocontainer version to 1.2 2018-04-11 16:28:44 +03:00
Nicolay Mitropolsky e7c3086db7 182: dep javax.annotation:jsr250-api:1.0 added to compiler/frontend.java 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky 072af7304f 182: jdk.internal.org.objectweb.asm.Opcodes -> org.jetbrains 2018-04-11 16:28:43 +03:00
Nicolay Mitropolsky 22186c05b4 182: KotlinDecompilerServiceImpl and KtParsingTestCase compilation fixes 2018-04-11 16:28:40 +03:00
Alexey Sedunov 25d19b45e9 181: Safe Delete: Do not delegate class search to Java
This fixes tests failing in IDEA 181
2018-04-11 16:28:37 +03:00
Nicolay Mitropolsky 94d18581e3 181: FakeFileForLightClass made return "virtualFile" from "ktFile" 2018-04-11 16:28:37 +03:00
Vyacheslav Gerasimov 212d218bc6 181: Fix test runtime for 181 platform compiler tests 2018-04-11 16:28:36 +03:00
Nicolay Mitropolsky 585348c590 181: LightClasses: using viewProvider from KtFile
#KT-22929
2018-04-11 16:28:35 +03:00
Nicolay Mitropolsky 55753d79e8 181: using InjectedFileViewProvider for light-files in language-injections
#KT-22929
2018-04-11 16:28:34 +03:00
Nicolay Mitropolsky 9bac6c5a71 181: Light annotations made strictly non-physical (KT-22565)
(cherry picked from commit cf6e21d)
2018-04-11 16:28:34 +03:00