Commit Graph

44013 Commits

Author SHA1 Message Date
Dmitry Savvinov 7e512ba018 Enable contracts in the 'compiler' module 2018-02-06 10:58:47 +03:00
Mikhail Glukhikh 19beaf57a7 JVM facade: for Java resolve, always use JvmPlatform resolver
So #KT-20281 Fixed
2018-02-06 09:50:10 +03:00
Mikhail Glukhikh c90056f8c4 Introduce inspection for nullable extension receiver of inline function
So #KT-22303 Fixed
2018-02-06 09:50:09 +03:00
Mikhail Glukhikh 08d3f20e09 Reformat: AbstractMultiModuleHighlightingTest 2018-02-06 09:50:08 +03:00
Mikhail Glukhikh 3ba6b70f73 Show expect / actual gutter even for incomplete compatibility
So #KT-18445 Fixed
So #KT-21115 Fixed
2018-02-06 09:50:00 +03:00
Mikaël Peltier a2a3043607 KT-18731 Use reference equality to compare enums
Fix of https://youtrack.jetbrains.com/issue/KT-18731
2018-02-05 18:34:44 +03:00
Pavel V. Talanov bc54c95bc3 JavaResolveExtension: create facade by original element
Fixes semantic difference erroneously introduced in c030a047aa
 #KT-22593 Fixed
2018-02-05 16:26:47 +01:00
Pavel V. Talanov 7b8d501670 Dsl highlighting: Provide gutter for marker annotation definition
Allows to jump to corresponding page in 'color and font' settings
2018-02-05 16:22:23 +01:00
Pavel V. Talanov 0d5d826bc5 Dsl highlighting: reasonable default colors 2018-02-05 16:22:22 +01:00
Pavel V. Talanov b9c832a952 Implement custom highlighting for dsls
A declaration is considered a part of dsl if it's marked with
    a marker annotation (which is in turn must be marked as @DslMarker)
Highlighting attributes are then chosen randomly from a preset list
    based on marker annotation fqname
2018-02-05 16:22:20 +01:00
Pavel V. Talanov 5ab00ee9f7 HighlighterExtension can provide custom highlighting for calls 2018-02-05 16:22:19 +01:00
Alexander Udalov 91a9038b2f Regenerate Gradle options
After f9e195351a
2018-02-05 16:17:30 +01:00
kenji tomita 1875d129ea Inspection to get rid of unnecessary ticks in references #KT-18124 Fixed 2018-02-05 17:31:08 +03:00
Alexander Udalov 9e500831dd Allow expect/actual annotation constructors to have default values
When a parameter has a default argument value both in the expected
annotation and in the actual annotation, they must be equal. This check
has been only implemented for the case when actual annotation is Kotlin
source code, and NOT a Java class coming from an actual typealias. The
latter case would require a bit more work in passing a platform-specific
annotation-value-reading component to ExpectedActualDeclarationChecker,
and is therefore postponed.

For now, Java annotations that are visible through actual type aliases
cannot have default argument values for parameters which already have
default values in the expected annotation declaration

 #KT-22703 Fixed
 #KT-22704 Open
2018-02-05 14:13:32 +01:00
Alexander Udalov 71fe8c02a3 Fix rendering of type aliases
- render 'actual' modifier if it's present
- do not render a space after type parameter list
2018-02-05 13:38:06 +01:00
Zalim Bashorov e0245a9dc7 KJS: support default arguments for expected declarations 2018-02-05 13:38:06 +01:00
Alexander Udalov db4ce703a6 Support default arguments for expected declarations
#KT-21913 Fixed
2018-02-05 13:38:05 +01:00
Alexander Udalov d356f52873 JS: remove MULTIPLATFORM directive from box tests
Move all sources into one module and use "!LANGUAGE:
+MultiPlatformProjects" instead
2018-02-05 13:38:05 +01:00
Alexander Udalov d465f5fd8e Extract ExpectedActualResolver out of ExpectedActualDeclarationChecker
The point is that it's placed in module 'resolution' where it can be
accessed for example in ArgumentsToParametersMapper to load default
argument values from expected function
2018-02-05 13:38:05 +01:00
Alexander Udalov ea30388ae5 Minor, use another way to check that descriptor is from sources
This way this function can be moved to module 'resolution', where
DescriptorToSourceUtils is not available
2018-02-05 13:38:04 +01:00
Alexander Udalov ac5444ef7c Add declaresOrInheritsDefaultValue, move hasDefaultValue to 'resolution'
'hasDefaultValue' needs to be adapted to support locating default values
in 'expect' functions, and this is not possible in module 'descriptors',
where it was originally declared. Therefore, move it to module
'resolution' and copy its current logic to a separate function
'declaresOrInheritsDefaultValue' which is used in 5 places.
'hasDefaultValue' itself is updated in subsequent commits.

Besides changing imports, also use a simpler declaresDefaultValue in
some places, which does not include default values inherited from
supertypes: this is OK for constructors, and in LazyJavaClassMemberScope
for functions from built-ins which do not have default argument values
at all
2018-02-05 13:38:04 +01:00
Alexander Udalov 7eb66f2579 Minor, support 'expect'-only files in codegen tests 2018-02-05 13:38:04 +01:00
Alexander Udalov f75b774d80 Do not report unused parameters for actual constructors
Extract common part for functions and constructors in
processUnusedParameter
2018-02-05 13:38:04 +01:00
Alexander Udalov 1bdec829ea Treat constructors as actual only if the 'actual' modifier is present
Exactly as this is done for functions in
FunctionDescriptorResolver.initializeFunctionDescriptorAndExplicitReturnType

 #KT-21906 Fixed
2018-02-05 13:38:04 +01:00
Alexander Udalov f198a28276 Fix type parameter bound check in expect-actual checker
Also make TypeParameterUpperBounds a "strong" incompatibility, meaning
that non-actual members from platform module are _not_ going to be
matched to the expected members if this incompatibility exists between
them, and therefore NO_ACTUAL_FOR_EXPECT will be reported on the
expected declaration, instead of ACTUAL_MISSING on the platform member.
This is needed because the difference in type parameter upper bounds can
have effect on the function signature on the platform (e.g. on JVM,
Array<T> -> T[], but Array<T> -> Comparable[] if T : Comparable<T>), and
it would be incorrect to report ACTUAL_MISSING on the member that has
nothing to do with the expected declaration that happens to coincide
with it in everything except type parameter bounds

 #KT-21864 Fixed
2018-02-05 13:38:04 +01:00
Alexander Udalov 8c6b140865 Simplify diagnostic message for ACTUAL_MISSING
#KT-21939 Fixed
2018-02-05 13:38:03 +01:00
Mikhael Bogdanov 1530fbee1b Fix ir test execution 2018-02-05 12:07:36 +01:00
Mikhail Zarechenskiy 5dacfae793 Support calling inline functions inside inline classes 2018-02-05 12:07:41 +03:00
Mikhail Zarechenskiy 2536eb4d45 Generate argument expression instead of constructor for inline classes 2018-02-05 12:07:40 +03:00
Mikhail Zarechenskiy 928a342ace Initial version of codegen for inline classes 2018-02-05 12:07:40 +03:00
Mikhail Zarechenskiy fbc02dee58 Refactoring: extract method to generate suspend method out 2018-02-05 12:07:40 +03:00
Mikhail Zarechenskiy d1049e5553 Refine type mapping for nullable inline class types 2018-02-05 12:07:39 +03:00
Mikhail Zarechenskiy d5400f11a3 Basic inline class mapping to the underlying representation 2018-02-05 12:07:39 +03:00
Mikhail Zarechenskiy 4b4525ec17 Support !LANGUAGE directive in signature tests 2018-02-05 12:07:39 +03:00
Mikhail Zarechenskiy d1a8ec06dd Reformat typeSignatureMapping.kt file 2018-02-05 12:07:38 +03:00
Mikhail Zarechenskiy a463fb1d5e Add basic declaration checker for inline classes 2018-02-05 12:07:38 +03:00
Mikhail Zarechenskiy 915455ebe9 Introduce InlineClasses language feature
Allow to write `inline` modifier in front of class declaration
2018-02-05 12:07:38 +03:00
Denis Zharkov 9b28d1a21c Make precise java classes tracking in Gradle enabled by default
#KT-22192 Fixed
2018-02-05 11:54:53 +03:00
Natalia Selezneva 74a9881e9d Fix "Virtual pointer hasn't been disposed" exception in tests. Add sdk to ProjectJdkTable. 2018-02-05 09:46:57 +03:00
Nikolay Krasko f05e926670 Update idea to 173.3.4 (173.4548.28) 2018-02-03 00:15:45 +03:00
Nikolay Krasko 5a9ea89e9c Collect statistics about used Kotlin formatter 2018-02-03 00:15:45 +03:00
Nikolay Krasko d1e6a61197 Fix testInGlobalPropertyWithGetter test in 173 branch
Workaround for IDEA-185462. It was introduced in 173 idea and
fixed in 181.
2018-02-03 00:15:45 +03:00
Vyacheslav Gerasimov 5b0d908d85 Add log4j & jdom to tests-common testCompile
Fixes NCDFEs in IrBlackBoxCodegenTestGenerated
2018-02-02 19:54:27 +03:00
Ilya Gorbunov c06204d0d4 Remove obsolete test classpath helpers 2018-02-02 17:59:29 +03:00
Ilya Gorbunov 381344141f Drop StdlibTest from compiler tests
Reason: stdlib built with the fresh compiler is going to be tested in Compiler Bootstrap Test configuration.
2018-02-02 17:59:27 +03:00
Ilya Gorbunov 8f78d73cd7 Use fqnames for SortedSet and TreeSet from java.util
Remove internal typealiases for SortedSet and TreeSet
2018-02-02 17:56:56 +03:00
Ilya Gorbunov b456c52902 Import kotlin.coroutines.experimental for generated sequences on all platforms
This will add import to common generated sources
2018-02-02 17:56:56 +03:00
Natalia Selezneva cdbe0b8fa9 Scratch tests: delete scratch file after creation 2018-02-02 17:44:42 +03:00
Natalia Selezneva 6ca1b10f41 Use correct logger for debugging scratch files 2018-02-02 17:44:35 +03:00
Natalia Selezneva 847990a4f6 Tests: call super.teardown from finally block in android tests 2018-02-02 17:44:28 +03:00