Commit Graph

7021 Commits

Author SHA1 Message Date
Pavel V. Talanov 19db4304bd Use clsDelegate to calculate hasModifierProperty("final") for light psi
AllOpen plugin can make some changes and we don't have the tools to make
    correct decision based on psi

 #KT-17857 Fixed
2017-06-06 17:11:18 +03:00
Alexander Udalov 26e3d2cf5d Use TopLevelDeclarations analysis mode in REPL
#KT-12564 Fixed
2017-06-06 14:00:45 +03:00
Dmitry Petrov fd1866b838 Do not check argumentMapping.isError()
Argument matching status can be considered an "error" in resolve,
even though it is not a compilation error and doesn't prevent code
from being generated.
Actually, we should only check if the argument matching status is
ArgumentMatch.

 #KT-18294 Fixed
2017-06-06 10:19:18 +03:00
Mikhail Glukhikh ecfc2236a6 Fix script properties kind in modifier checker #KT-18234 Fixed 2017-06-05 17:22:11 +03:00
Dmitry Petrov 978661c53d Do not generate default parameter values for synthetic functions
This causes a subtle issue with 'copy' function for data class,
which has parameters with source elements corresponding to
the data class primary constructor parameters: default value expression
for such parameters is generated second time (to be overwritten later),
which creates duplicate bindings if such expression included any
(possibly anonymous) declarations, such as lambdas or anonymous objects.

 #KT-18208 Fixed
2017-06-02 10:57:45 +03:00
Dmitry Petrov 08885e273b Support additional intrinsics in null check elimination
1. checkExpressionValueIsNotNull implies checked value is non-null

2. throwNpe never returns

 #KT-18162 Fixed Target versions 1.1.4
 #KT-18164 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Dmitry Petrov d559212d70 Optimize out trivial INSTANCEOF checks
#KT-18157 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Alexey Andreev e6b0cc64bd Fix copying of non-abstract functions of interfaces in JS BE
Fix copying of non-abstract functions of interfaces to implementing
classes when implementing class inherits interface via 2+ paths.

See KT-18187
2017-05-31 11:21:13 +03:00
Dmitry Petrov c558e2657b Update testData for light classes after generic signature fixes 2017-05-31 10:18:48 +03:00
Dmitry Petrov 17d2472511 Do not patch generic signature for methods with special bridges
Somewhat awkward solution for KT-18189.
2017-05-31 10:18:48 +03:00
Dmitry Petrov fd00a6fbe8 Generate generic signatures for special bridges
#KT-12408 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Dmitry Petrov 48a60e6f39 Dump generic signatures in bytecode listing tests if required
Add '// WITH_SIGNATURES' to test file if generic signatures should be
dumped.
2017-05-31 10:18:48 +03:00
Alexey Andreev 9375a1d984 Prohibit illegal identifiers in packages in JS BE
See KT-18032
2017-05-29 15:37:30 +03:00
Alexey Andreev 24c0a1e7ce Fix translation of delegated functions with default params in JS BE
See KT-17285
2017-05-29 15:30:28 +03:00
Alexey Andreev 383e273fed In LightAnalysisModeTestGenerated skip tests ignored in JVM
When a test is marked as ignored in JVM BE (i.e. IGNORE_BACKEND: JVM)
it's ignored in LightAnalysisModeTestGenerated. This means that
this tests is expected to fail. However, often tests that fail
in JVM blackbox tests, don't fail in LAMTG, therefore it's reasonable
to skip these tests in LAMTG at all.
2017-05-29 15:30:27 +03:00
Denis Zharkov 2c98bd053a Fix super calls to suspend functions in abstract classes 2017-05-29 10:58:18 +03:00
Alexander Udalov da0ecc6cf7 Refactor CompileKotlinAgainstCustomBinariesTest
Combine compileLibrary and compileJava into a universal compileLibrary
which compiles both .java and .kt files, either to a directory or to a
.jar file. Also introduce compileJsLibrary for JS only
2017-05-26 19:38:54 +03:00
Alexander Udalov dae414854d Reduce boilerplate in CompileKotlinAgainstCustomBinariesTest
Check against output.txt in compileKotlin; adapt test data of some tests
2017-05-26 19:38:53 +03:00
Alexey Andreev dde50a34db Fix comparison of boolean values in JS BE
See KT-16984
2017-05-26 18:26:08 +03:00
Alexey Andreev 522a56947c Add -keep command line option to JS DCE tool 2017-05-26 18:20:23 +03:00
Alexey Andreev 8a8fdf1968 Command-line tool for JS DCE 2017-05-26 18:20:17 +03:00
Mikhail Glukhikh adbece82ef Clear DF info for variables assigned in 'try' #KT-17929 Fixed 2017-05-26 15:39:27 +03:00
Mikhail Glukhikh 0fd70df681 Add tests for KT-17929 2017-05-26 15:39:25 +03:00
Dmitry Petrov 2c83718452 Prohibit having duplicate parameter names in functional types
#KT-15804 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov 9908212c99 Report VIRTUAL_MEMBER_HIDDEN on declaration name
#KT-13749 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov a86fe89aae Include file name for package-level members in diagnostics 2017-05-26 13:58:46 +03:00
Dmitry Petrov 7979663e6c Update testData for changed diagnostic messages 2017-05-26 13:58:46 +03:00
Dmitry Petrov d850f01c39 Fix diagnostic for uninitialized extension property without accessors
#KT-8612 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov 902d3af280 Prohibit extending kotlin.Enum directly
#KT-7773 Fixed
2017-05-26 13:58:46 +03:00
Mikhael Bogdanov 3f7bf8467a Process non-aload0 outer access in constructor during inline
#KT-17972 Fixed
2017-05-26 09:24:10 +02:00
Mikhail Glukhikh af3a123c15 Report WRONG_MODIFIER_CONTAINING_DECLARATION for vararg in setter 2017-05-26 09:47:51 +03:00
Dmitry Petrov 30182c38ce Fix toString and hashCode for array members of data classes
Generate them as special intrinsics that would be mapped to proper
platform-specific calls by BEs.

 #KT-16945 Fixed
2017-05-26 09:32:29 +03:00
Dmitry Petrov 1420926a9b Generate receivers for callable references in the same way as for calls
Properly handle callable members imported from objects
and other related corner cases.

 #KT-18084 Fixed
2017-05-26 09:32:29 +03:00
Mikhail Zarechenskiy d0e26c6527 Support underscores in non local destructuring declarations 2017-05-25 16:46:06 +03:00
Mikhail Zarechenskiy 47f2386212 Generate non-local destructuring declarations as properties
#KT-5620 Fixed
 #KT-15810 Fixed
2017-05-25 16:46:05 +03:00
Mikhail Zarechenskiy 400ecd5e13 Support destructuring declarations in scripts and REPL
#KT-5620 In Progress
 #KT-15810 In Progress
2017-05-25 16:46:04 +03:00
Alexey Andreev 0e31c14a86 Implement inlining of default parameters in JS BE
Fix KT-17910
2017-05-25 14:38:53 +03:00
Dmitry Petrov 7600b6de52 Allow top-level type aliases in scripts 2017-05-24 11:20:22 +03:00
Alexander Udalov 6d47991172 Minor, use other package in test data file
To avoid rendering contents of package org.intellij.lang.annotations
into the corresponding .txt file
2017-05-22 18:15:32 +03:00
Denis Zharkov 52b2e632df Simplify generated code for rangeTo/concat intrinsics
The main reason is avoiding complicated operations like
dup + dup_x2 + pop2 for instances obtained by NEW instruction.

Otherwise it leads to problems in performRefinedTypeAnalysis
because code there has a sensible assumption that NEW instances
can be only dupped or stored into a local (rare cases)

 #KT-17457 Fixed
2017-05-22 14:51:04 +03:00
Dmitry Petrov 39aa97eebf Use Intrinsics#compare when specializing compareTo for ints 2017-05-22 11:57:20 +03:00
Dmitry Petrov e1b41eee15 Specialize Comparable#compareTo for boxed primitives
Support Comparable#compareTo for boxed primitive in redundant
boxing/unboxing analysis, along with CHECKCAST to java.lang.Comparable.

Note that we can do that for Float and Double, too, because
Float#compareTo(Float) and Double#compareTo(Double) are delegated to
Float#compare(float, float) and Double#compare(double, double),
respectively.

Fuse specialized comparison for integers with conditional jumps
if possible (both for Comparable#compareTo and Intrinsics#areEqual).

 #KT-11959 Fixed
2017-05-22 11:57:20 +03:00
Dmitry Petrov bd5b984da9 Return type of local delegated property setter should be Unit
#KT-17950 Fixed
2017-05-22 11:47:09 +03:00
Mikhael Bogdanov ba06ad3e53 Minor. Fix test directive 2017-05-22 08:31:03 +02:00
Dmitry Petrov 1dbd6453e0 Add more stub generator tests for external dependencies 2017-05-19 14:49:34 +03:00
Mikhael Bogdanov 47fec6c9d5 Wrap captured local delegated property into Delegate
#KT-16864 Fixed
2017-05-19 09:53:19 +02:00
Nikolay Krasko 0cd3e4f3a4 Minor: JetFile -> KtFile 2017-05-18 20:00:17 +03:00
Alexander Udalov d1c9d0328a Report error if <withKotlin> is run in fork mode
Otherwise the error message is confusing, see #KT-9292
2017-05-18 19:25:21 +03:00
Alexander Udalov 671aed252d Support single Java source files in kotlinc arguments
E.g. "kotlinc foo.kt test/Bar.java" will compile foo.kt, and
declarations from Bar.java will be accessible to Kotlin code in foo.kt.

The change in AbstractTopLevelMembersInvocationTest is needed because an
incorrect configuration was created in that test where a library jar was
also a Java source root (the compiler is never configured this way in
production), which led to an exception in
JavaCoreProjectEnvironment#addSourcesToClasspath

 #KT-17697 Fixed
2017-05-18 19:22:17 +03:00
Mikhael Bogdanov 511c9f86b1 Add new test on receiver clash during default lambda inlining 2017-05-18 18:18:15 +02:00