Commit Graph

2877 Commits

Author SHA1 Message Date
Alexander Udalov d499998655 Inject CompilerConfiguration instead of LanguageVersionSettings
LanguageVersionSettings can be read from the configuration. Also, the
configuration may be used for other stuff, not related to language version
settings, soon
2017-02-20 16:18:00 +03:00
Alexander Udalov ee1152bc98 Simplify injection of LanguageVersionSettings into JVM analysis
Pass the LanguageVersionSettings instance inside the CompilerConfiguration,
since it's needed anyway. In compiler and tests, the configuration comes from
KotlinCoreEnvironment; in IDE, we're constructing it in JvmAnalyzerFacade
2017-02-20 16:18:00 +03:00
Alexander Udalov a1a71a01b1 Drop JvmMetadataVersion.skipCheck, support this correctly
Pass the value of this flag via DeserializationConfiguration
2017-02-15 10:46:48 +03:00
Dmitry Jemerov be0211cd49 Ugly deadlock workaround for KT-16149: members of DataBindingComponent are calculated via annotations search which causes resolve reentrering 2017-02-13 17:20:10 +01:00
Mikhael Bogdanov b1e2db21d3 Fix for KT-16225: enumValues non-reified stub implementation references nonexistent method
#KT-16225 Fixed
2017-02-09 10:23:32 +01:00
Denis Zharkov f4690ebff9 Initialize JvmBuiltins for module configuration used in test
This method is only used within tests, and they didn't fail
mostly by coincidence.

But because of more eager reading of
JvmBuiltIns.isAdditionalBuiltInsFeatureSupported (that checks if built-ins
have been initialized) these tests started failing
2017-02-08 16:04:19 +03:00
Denis Zharkov 1bb40afada Simplify compatibility mode with ll=1.0 on JDK dependent built-ins
A lot of problem arise with current solution
(loading them with lowpriority annotation + additional call checkers):
- We errorneously treated ArrayList.stream as an existing method, while
  it's just a fake override from List
- The same problem arises when creating a class delegating to List.
  Also the latter case is failing with codegen internal error
  (see issue KT-16171)

The negative side of this solution is that instead of reporting meaningful
diagnostic, there will be UNRESOLVED_REFERENCE.
But it seems to be better than having strange problems like ones described above.

 #KT-16073 Fixed
 #KT-16171 Fixed
2017-02-08 16:04:19 +03:00
Alexander Udalov b780e6d374 Do not import "kotlin.comparisons" by default for language version 1.0
#KT-16199 Fixed
2017-02-07 10:15:57 +03:00
Alexander Udalov 389ddf26b3 Do not use LanguageVersionSettings.languageVersion directly 2017-02-03 19:35:17 +03:00
Stanislav Erokhin 382122470f Use LanguageVersionSettings from project instead of LanguageVersionSettingsImpl.DEFAULT for sdk and library resolver.
General effect will be the following:
- all member scopes for libraries and JDK will be constructed with -language-version/-api-version specified in project settings
- for modules with another (not like in project settings) -api-version or -language-version we will have not correct member scope -- for example we will see typealiases from such libraries.

#KT-15979 Fixed

(cherry picked from commit 0001865)
2017-02-02 16:47:53 +03:00
Dmitry Jemerov bc9c40883c Avoid repeated reading of file contents from disk while building stubs 2017-02-01 18:14:57 +01:00
Alexander Udalov 805e3e4d0f Drop tests on JS decompiled text / stub consistency
They're no longer needed because the logic of the decompiler / stub builder is
now trivial (see KotlinJavaScriptDeserializerForDecompiler,
KotlinJavaScriptStubBuilder) and after it's merged to the decompiler for
built-ins, it's going to be tested anyway with BuiltInDecompilerConsistencyTest
2017-01-30 11:31:02 +03:00
Denis Zharkov 0e132b9857 Move all coroutine-related declarations from built-ins to stdlib
Also move internal declarations from runtime.jvm module into new package
kotlin.coroutines.jvm.internal in stdlib

The necessity of these declarations being in built-ins is controversial,
but also it will complicate the migration of current coroutine runtime
to a separate jar if we ever need this
2017-01-27 23:24:13 +03:00
Mikhael Bogdanov 25d75bcd8b Delegates to java defaults methods in compatibility mode 2017-01-26 14:32:33 +01:00
mglukhikh f64345634b WHEN_ENUM_CAN_BE_NULL_IN_JAVA is no more reported after smart cast to not-null #KT-15201 Fixed 2017-01-24 13:51:15 +03:00
Alexander Udalov f1cd2ee6fd Introduce PropertyDescriptor.isDelegated, write new flag to metadata
#KT-8384 In Progress
2017-01-23 12:25:34 +03:00
Mikhael Bogdanov da1b8a02ed Exclude builtins members mapped to java default methods from delegation 2017-01-20 13:16:58 +01:00
Denis Zharkov bbb5d4eb0f Fix 1.0-compatibility mode for JDK dependendent built-ins
Do not report UNSUPPORTED_FEATURE if there is no overridden descriptors
E.g. in case of property accessors
2017-01-19 15:20:57 +03:00
Denis Zharkov 5d4f51d9b6 Refine 1.0-compatibility mode for JDK dependent members
- calls must be prohibited iff they refer to some additonal built in member
- override must be prohibited iff all of the overridden descriptors are additional

Other usages were able to be successfully compiled by 1.0.x

Solution with @Deprecated(level=Error) doesn't work properly, because
deprecation propagates to overridden, thus call 'java.util.ArrayList<String>().stream()'
becomes invalid, while it was correct in 1.0.x

 #KT-15794 Fixed
2017-01-19 10:20:35 +03:00
Zalim Bashorov 6ea6e4ab98 KJS: move println to kotlin.io; import kotlin.io by default in Default platform 2017-01-18 14:25:36 +03:00
Mikhael Bogdanov de52a5bc20 Fixed diagnostic message 2017-01-18 11:19:36 +01:00
Mikhael Bogdanov 591de36666 Added deprecated diagnostic for invoking default methods within jvm-target 1.6 2017-01-18 10:50:59 +01:00
Mikhael Bogdanov 7a27a9d51f Propagate 'CompilerConfiguration' to frontend checkers 2017-01-18 10:23:40 +01:00
Denis Zharkov d0d617b44e Fix signature mapping for default suspend function from interface
Use jvm suspend function view in function codegen.
Also use SUSPEND_FUNCTION_TO_JVM_VIEW slice if the value exists
for the given key

 #KT-15552 Fixed
2017-01-18 12:00:45 +03:00
Yan Zhulanow 5adc3bacff SamWithReceiver: Call onContainerComposed() properly for module dependencies as well. Inject SamWithReceiverResolver by instance. 2017-01-17 20:39:28 +09:00
Denis Zharkov 7837d736f7 Merge RestrictedCoroutineImpl into CoroutineImpl 2017-01-14 13:24:53 +03:00
Denis Zharkov 2cb9d3a8ad Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Also rename val SUSPENDED to SUSPENDED_MARKER

 #KT-15698 Fixed
2017-01-14 13:24:53 +03:00
Mikhael Bogdanov 0a363fd1a5 Introduced test flag: JVM8_TARGET_WITH_DEFAULTS 2017-01-13 13:52:56 +01:00
Mikhail Glukhikh c09a71b178 Multi-platform refactoring: get rid of PlatformKind (replace with MultiTargetPlatform) 2017-01-12 18:58:13 +03:00
Alexander Udalov 6ffa56b640 Move name sanitization utilities to module 'descriptors' 2017-01-12 11:24:23 +03:00
Alexander Udalov db3fa8eaca Refactor JvmPackagePartProvider
Make code more imperative than functional, preserve the information about the
original root where the module mapping was discovered
2017-01-11 13:15:56 +03:00
Dmitry Petrov 7a8ec86cb9 KT-11398
- turn INACCESSIBLE_TYPE into a warning;
- improve diagnostic message for INACCESSIBLE_TYPE.
2017-01-11 10:23:01 +03:00
Dmitry Petrov 8d16bd1215 Method can be hidden if it is annotated with kotlin.internal.PlatformDependent,
or is a Java method from a Kotlin built-in class (transitively).

https://github.com/Kotlin/KEEP/blob/master/proposals/jdk-dependent-built-ins.md#backward-compatibility-of-overrides
2016-12-23 13:51:08 +03:00
Alexey Tsvetkov 4fdca24db4 Remove source annotations removing (not needed with KAPT3) 2016-12-19 22:46:12 +03:00
Denis Zharkov c73b0d7b76 Move coroutine intrinsics to object (backend's) 2016-12-15 23:58:23 +03:00
Stanislav Erokhin 42440f50dc Remove soft keyword coroutine & isCoroutine from ValueParameterDescriptor. 2016-12-15 23:57:56 +03:00
Stanislav Erokhin 0132f3eea7 Remove kotlin.coroutine package from default imports. 2016-12-15 23:57:51 +03:00
Denis Zharkov 6649f64e9f Support new coroutine convention in JVM backend 2016-12-15 23:57:40 +03:00
Denis Zharkov b1d1128466 Minor. Move createFunctionType to core
As it will be used in the type mapper soon
2016-12-15 23:32:09 +03:00
Mikhael Bogdanov 268d55104c Don't generate delegation to java default methods
#KT-15226  Fixed
2016-12-14 11:20:04 +01:00
Alexander Udalov d0fa9bac75 Introduce '-Xskip-runtime-version-check' command line option 2016-12-13 21:09:00 +03:00
Mikhail Glukhikh 57da92b862 Infrastructure change: module descriptor now knows its platform kind & its sources kind 2016-12-13 18:53:55 +03:00
Stanislav Erokhin 59efedf610 Rename platform to header. 2016-12-13 18:00:00 +03:00
Dmitry Jemerov 7e92cf2af7 Don't create light classes for platform declarations
#KT-15137 Fixed
2016-12-12 20:47:45 +01:00
Roman Elizarov 8affb2726f Pluggable Synthetic Objects 2016-12-12 18:43:26 +03:00
Yan Zhulanow b9a0a4f3db Kapt3: Ensure that field types and method return types are not anonymous (KT-14997) 2016-12-09 20:28:31 +03:00
Yan Zhulanow cbef0250aa Allow to turn the first parameter of a SAM-converted lambda into the receiver (KT-12848) 2016-12-09 20:01:21 +03:00
Alexander Udalov 789483e1eb Remove old mechanism of metadata version error reporting 2016-12-09 01:59:36 +03:00
Alexander Udalov 11f975fe89 Add classifier usage checker for missing dependency classes
This has no effect for the original use case of mock class descriptors
(unresolved classes used in libraries), but is necessary for pre-release
classes in case the compiler is a release, because such classes end up in scope
and can be the result of the resolution
2016-12-09 01:59:33 +03:00
Alexander Udalov 4e99349f1f Write "pre-release" flag to class files, do not allow usages in release 2016-12-09 01:59:33 +03:00