Commit Graph

31868 Commits

Author SHA1 Message Date
Dmitry Petrov 9cf8ef287e KT-11588 Type aliases
Additional tests for generic type alias arguments.
Small refactoring in TowerLevels.
2016-06-01 14:32:45 +03:00
Dmitry Petrov 62f8d00f89 KT-11588 Type aliases
Create substituted constructor descriptors for generic type aliases.
2016-06-01 14:32:45 +03:00
Dmitry Petrov c63166047c KT-11588 Type aliases
Additional tests for type alias constructor & companion object:
- codegen
- error diagnostics
2016-06-01 14:32:45 +03:00
Dmitry Petrov 1329a43d89 KT-11588 Type aliases
Type alias constructor
2016-06-01 14:32:44 +03:00
Dmitry Petrov 4a9507b3ab KT-11588 Type aliases
Type alias companion object
2016-06-01 14:32:44 +03:00
Dmitry Petrov 8c2e80f9eb KT-11588 Type aliases
Fix protoDifferenceUtils.
2016-06-01 14:32:44 +03:00
Mikhael Bogdanov 0f1589fd50 Fix for KT-12200: initial property assignment ignored
#KT-12200 Fixed
2016-05-31 15:27:55 +03:00
Mikhael Bogdanov bdc0b6b308 Local delegated properties moved to language feature option 2016-05-31 15:27:55 +03:00
Alexey Andreev 2bd807bb4e KT-11960: add test for case of instantiating inner class of a local class 2016-05-31 15:24:30 +03:00
Alexey Andreev acc5303731 KT-11960 Fix case of instantiation of local class via its inner class or via nested lambda. Move tests to more appropriate location. Fix bug in blackbox codegen generator for JVM, which does not allow to suppress tests. 2016-05-31 15:24:29 +03:00
Alexey Andreev bb8a3aa262 KT-11960 Minor code style fixes 2016-05-31 15:24:29 +03:00
Alexey Andreev 6f363a71be KT-11960 Fix for data classes 2016-05-31 15:24:29 +03:00
Alexey Andreev 170a671a1b KT-11960 Fix for case when class instantiates itself 2016-05-31 15:24:28 +03:00
Alexander Udalov a300dee61f Keep Native2AsciiCharsetProvider from being stripped by proguard
#KT-12549 Fixed
2016-05-31 14:28:25 +03:00
Kirill Rakhman 93ebb3da65 Formatter: handle spaces around 'is' keyword (#874)
Fixes #KT-12548
2016-05-30 20:35:33 +03:00
Alexander Udalov fbd671c158 Minor, update ChangeLog with '-language-version' 2016-05-30 13:52:04 +03:00
Mikhail Glukhikh 7a24429b53 Simplify for intention: apply name validator to prevent conflicts 2016-05-30 12:15:13 +03:00
Mikhail Glukhikh 792b37bce4 Simplify for intention: applicable of any numbers of properties used #KT-10779 Fixed 2016-05-30 12:15:09 +03:00
Alexander Udalov 68c5e8e190 Minor, add comments on declarations used in Eclipse plugin 2016-05-27 19:40:50 +03:00
Alexander Udalov a95568eedf Minor, make Services#get return type nullable 2016-05-27 19:40:50 +03:00
Alexander Udalov 57849c9dfd Fix project compilation after introduction of bound references
`java` in the package name inside an extension to KClass is now resolved to the
extension property `KClass#java`. So `java.X::class` is now equivalent to
`this.java.X::class`
2016-05-27 19:38:39 +03:00
Mikhail Glukhikh c26d7e0eba Attach "add remaining branches" and "add else branch" fixes to NON_EXHAUSTIVE_WHEN warning #KT-12503 Fixed 2016-05-27 18:08:20 +03:00
Mikhail Glukhikh 8713190e33 Back-end JVM: more accurate handling of when expressions with Unit result #KT-12192 Fixed 2016-05-27 18:08:15 +03:00
Pavel V. Talanov 3a3e145de2 KtLightMethod: Wrap return type so it resolves to light method's type parameter as opposed to delegate's
Affects java type inference in IDEA

  #KT-12090 Fixed
  #KT-11095 Fixed
2016-05-27 13:13:01 +03:00
Alexander Udalov e1a21abd72 Report error on bare types in LHS of callable reference expressions 2016-05-26 22:22:41 +03:00
Alexander Udalov 76efeb4e14 Remove obsolete assertion about expressions on LHS of '::' 2016-05-26 22:22:41 +03:00
Alexander Udalov da42023dd9 Support new callable reference expressions in UAST
Manually mute the class literal test in apiCheck.kt; support for new class
literal expressions is postponed because it's not straightforward to combine
both unbound (Type::class) and bound (instance::class) class literals in one
UClassLiteralExpression: in Java they're two very different expressions
(Type.class and instance.getClass())
2016-05-26 22:22:41 +03:00
Alexander Udalov ca76e4d426 Support new double colon expressions in IDE code 2016-05-26 22:22:41 +03:00
Alexander Udalov a3b38cf6ed Extract method to fully or partially resolve callable reference
Reuse it in the main type-checking path in DoubleColonExpressionResolver, as
well as in ArgumentTypeResolver which handles the case when a callable
reference appears as an argument to another call
2016-05-26 22:22:41 +03:00
Alexander Udalov 693c753988 Support for new double colon expressions in type checker
Despite the fact that the LHS of a double colon expression is now KtExpression
instead of KtUserType, we must still consider it a type for callable references
to work. Extract and reuse relevant parts of QualifiedExpressionResolver and
TypeResolver to support this behavior
2016-05-26 22:22:41 +03:00
Alexander Udalov b5388d6a43 Parse expressions on LHS of '::'
See https://github.com/Kotlin/KEEP/issues/5
2016-05-26 22:22:41 +03:00
Alexander Udalov 7cb61b81ab Minor, capitalize language feature names in tests
To simplify textual search across the codebase
2016-05-26 22:21:22 +03:00
Pavel V. Talanov 76971eca70 Refactor LanguageFeatureSettings: Add LanguageVersion and LanguageFeature entities 2016-05-26 22:16:47 +03:00
Alexander Udalov 9bdf8f1082 Minor, update javac2 annotation filter for kotlin-build-common-test 2016-05-26 22:15:39 +03:00
Alexander Udalov 2c516f18a0 Add tests on "-language-version" usage from Ant, Maven, Gradle 2016-05-26 22:15:39 +03:00
Alexander Udalov bc5202a4d7 Validate "-language-version" argument value, add tests 2016-05-26 22:15:39 +03:00
Alexander Udalov 331a6ee414 Use LanguageFeatureSettings instead of JVM option for top level sealed classes 2016-05-26 22:15:39 +03:00
Alexander Udalov 98c3e030a1 Support enabling/disabling language features in diagnostic tests 2016-05-26 22:15:39 +03:00
Alexander Udalov e1ba4480d7 Support "-language-version" CLI option for compatibility with older releases
Introduce LanguageFeatureSettings, instance of which should be injected by the
container and be accessible everywhere during the compilation (front-end and
back-end).

Parameters of LanguageFeatureSettings are unused in this commit, will be used
later
2016-05-26 22:15:39 +03:00
Alexey Sedunov ec0f21c887 Spring Support: Fixed rename of custom-named beans specified with Kotlin annotation
#KT-12096 Fixed
2016-05-26 20:59:09 +03:00
Alexey Sedunov 076e31c0f8 Spring Support: Automatic configuration by @Import and @ComponentScan ("basePackages"/"basePackageClasses")
#KT-12135 Fixed
 #KT-12139 Fixed
2016-05-26 20:59:07 +03:00
Alexey Sedunov 781a1e0694 Spring Support: Implement @ComponentScan inspection
#KT-12465 Fixed
2016-05-26 20:59:05 +03:00
Alexey Sedunov d69140b7fe Code Insight: Implement package references inside of string literals
#KT-12136 In Progress
2016-05-26 20:59:03 +03:00
Alexey Sedunov d52e62b20d Light Classes: Consider FakeFileForLightClass instances equivalent if they correspond to the light classes with common KtFile
#KT-12117 Fixed
2016-05-26 20:59:01 +03:00
Alexander Udalov 9a762e0fa2 Prevent META-INF/INDEX.LIST from jsr166e.jar to be packed into compiler
INDEX.LIST contains a list of jars with the information about what packages
does each of those jars have (this feature is called JarIndex, see
http://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html). In case of
ideaSDK/core/jsr166e.jar, it only has one entry -- jsr166e.jar itself. When the
compiler is started, the class loading mechanism reads this file and assumes
that there are no other jars nearby. But the compiler depends on other jars,
namely kotlin-runtime.jar and kotlin-reflect.jar, thus we get
ClassNotFoundException when trying to load almost any Kotlin bytecode from
kotlin-compiler.jar.

Note that, fortunately, release builds are not affected because:
1) proguard helpfully strips this file from the final kotlin-compiler.jar;
2) we use a custom class loader (Preloader) which ignores JarIndex.
This only affects local setup with proguard disabled, where one test
(CompilerDaemonTest) was failing because it was trying to invoke the compiler
directly via "java -jar ..."

To implement this, it was necessary to exclude this one file from the compiler
jar, however the "zipgroupfileset" Ant task does not support exclusion of one
file from a particular archive, so we pack all idea core libraries into one jar
beforehand and use "zipfileset" which supports exclusion of one file
(http://stackoverflow.com/a/2426245/288456).

(cherry picked from commit c3f1afee626502470dbe27a1343c777e5cade789)
2016-05-26 14:14:41 +03:00
Alexander Udalov e5d64d316d Fix kotlin-maven-plugin compilation 2016-05-26 14:14:17 +03:00
Alexander Udalov d89e907f00 Minor, comment out ignored test 2016-05-26 11:48:00 +03:00
Alexander Udalov 159d88102f Use MODULE_NAME configuration key in JS instead of MODULE_ID 2016-05-26 11:47:30 +03:00
Alexander Udalov 05f8836f46 Move some configuration keys to JVM or to CommonConfigurationKeys
Move CONTENT_ROOTS and SCRIPT_DEFINITIONS_KEY to JVMConfigurationKeys because
they are only used on JVM, rename the latter to SCRIPT_DEFINITIONS.

Move MODULE_NAME to CommonConfigurationKeys to be combined with MODULE_ID in
JSConfigurationKeys in the future
2016-05-26 11:47:30 +03:00
Alexander Udalov 6674412079 Rename compilerConfigurationForTests -> newConfiguration 2016-05-26 11:47:30 +03:00