Commit Graph

21979 Commits

Author SHA1 Message Date
Yan Zhulanow bda14fcbb2 Unresolved reference not reported on data class constructor @get annotation (KT-19628) 2018-08-24 04:28:16 +05:00
Yan Zhulanow ef210d7122 Kapt: Do not write references to anonymous classes to stubs & metadata (#KT-25374) 2018-08-24 04:28:09 +05:00
Alexander Udalov 475a80b641 Do not write pre-release binaries for stable LV
This commit reverts f6571effcc and
reimplements the desired logic in another way.

In particular, we'd like these two conditions to hold:
1) only the release compiler with stable language settings (meaning,
   language version is a released version of Kotlin and no experimental
   features are enabled) should report errors when _reading_ pre-release
   binaries.
2) the compiler should _write_ pre-release binaries only if language
   settings are not stable, independent of whether the compiler itself
   is release or not.

From these conditions it follows that we must use different logic to
determine how to behave when reading/writing pre-release binaries.
Namely, reading (in CompilerDeserializationConfiguration) now checks if
both the compiler is release and the language settings are stable, and
writing (in LanguageVersionSettings.isPreRelease) checks only that the
language settings are stable
2018-08-23 23:11:30 +02:00
Alexander Udalov f6571effcc Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.

The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)

 #KT-21267 Declined
2018-08-23 16:50:48 +02:00
Roman Artemev 0895f72570 Fix testdata 2018-08-23 14:10:11 +03:00
Dmitry Petrov 34548a0667 Fix primitive override with inline class in Kotlin-Java inheritance 2018-08-23 13:07:07 +03:00
Ilya Chernikov 01eca8bac8 Clean up properties collection 2018-08-23 09:51:53 +03:00
Ilya Chernikov bd8f2a81e9 Rename ScriptDefinition to ScriptCompileConfiguration 2018-08-23 09:51:53 +03:00
Ilya Chernikov ab63d59a56 Refactor definition keys 2018-08-23 09:51:53 +03:00
Ilya Chernikov 74f8a541c0 Grand refactoring of the scripting DSL + many minor usability refactorings around it 2018-08-23 09:51:53 +03:00
Ilya Chernikov cf2162c445 Refactor properties 2018-08-23 09:51:53 +03:00
Vyacheslav Gerasimov f2a8e5c248 Log name of the class caused LinkageError in SyntheticResolveExtension
#EA-120641: Now it is unclear which extension caused AbstractMethodError
2018-08-22 18:10:50 +03:00
Ilmir Usmanov 0559cfb724 Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
2018-08-22 16:21:30 +03:00
Ilmir Usmanov 4a7703ed66 Implement correct is check for SuspendFunction
Let callable references implement SuspendFunction
Do not generate CHECKCAST SuspendFunction when LV is 1.2

 #KT-25825: Fixed
2018-08-22 16:21:27 +03:00
Dmitry Petrov 533f87ac33 Use proper KotlinType for prefix increment/decrement
Otherwise inline class values (such as UByte) are boxed incorrectly,
see KT-26219.
2018-08-22 12:24:50 +03:00
Denis Zharkov 16a27d593c Optimize memory-footprint for RemoteLookupTrackerClient
Observations:
- In case of !requiresPosition we don't need to track position
- Also, in the latter case we don't need scopeKind (implicit contract)
- There were a lot of LookupInfo instances having two references
(fileName/scopeFqName) pointing to the same strings.
Looks like in common case (reasonable amount of files/fqnames) it's more
sensible to group lookups in the two-level-tree (implemented with nested maps)

It's expected to decrease memory consumption up to 15M in case of compiling
`idea` module in Kotlin project
2018-08-21 18:18:43 +03:00
Alexander Udalov 59e2101a25 Support reading binary metadata of the next major release
Already existing tests testRequireKotlinInNestedClassesAgainst14{,Js}
now check that there's no error when loading a module/class with
metadata version 1.4.0

 #KT-25972 Fixed
2018-08-21 17:12:02 +02:00
Alexander Udalov 852760b3b0 Report error on incompatible .kotlin_module files in classpath
Also remove obsolete test wrongAbiVersionNoErrors

 #KT-25973 Fixed
 #KT-26266 Open
2018-08-21 17:12:02 +02:00
Alexander Udalov 4f11812668 Report error instead of throwing exception in JvmPackagePartProvider 2018-08-21 17:12:02 +02:00
Sergey Igushkin a71c66a82f Fix the SourceSet.projectDefault() extension adding sources to resources
The `include` calls were effectively made on the `resources`
`SourceDirectorySet`, which meant including '**' from 'src' as well.

Since the 'SourceDirectorySet' API is quite limited and does not support
specifying includes/excludes separately, configure the
`ProcessResources` task instead.
2018-08-21 18:05:52 +03:00
Zalim Bashorov 589085369e [JS FE] Unify how the compiler checks parameters and return types for external declarations 2018-08-21 17:09:33 +03:00
Zalim Bashorov 9d0b880f67 [JS FE] Prohibit inline classes as parameter type and return type of external declarations
#KT-26171 Fixed
2018-08-21 17:09:33 +03:00
Zalim Bashorov 839bce5236 [JS FE] Prohibit external inline classes
#KT-26138 Fixed
2018-08-21 17:09:33 +03:00
Alexander Udalov 3442c7385f Fix compilation in KotlinTestUtils for IDEA 173 2018-08-21 14:05:07 +02:00
Alexander Udalov 97c0f1712a Fix compilation in KotlinTestUtils for AS 3.1 & 3.2 2018-08-21 14:03:28 +02:00
Ilmir Usmanov 932b76a3f3 Minor. Unmute test 2018-08-21 14:13:19 +03:00
Alexander Udalov f069686a14 Minor, use resolveSibling in getAbsolutePaths 2018-08-21 12:49:11 +02:00
Alexander Udalov e56374908e Disallow using optional annotations outside common module sources
#KT-25196 Fixed
2018-08-21 12:49:10 +02:00
Alexander Udalov 0f003802fe Introduce -Xcommon-sources and pass it correctly from build tool plugins
#KT-25196 In Progress
2018-08-21 12:49:10 +02:00
Denis Zharkov ca39cc47c9 Support calling experimental coroutines API in JVM
The support is very limited, though

 #KT-25683 Fixed
2018-08-21 13:46:01 +03:00
Denis Zharkov 944b0d058a Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed
- Presence of suspend function type still makes declaration
unusable unless it belongs to a value parameter as a top-level type
containing less then three parameters

Still, warning should be emitted because they will become unsupported in 1.4

 #KT-25683 In Progress
2018-08-21 13:44:02 +03:00
Denis Zharkov c94b72680a Minor. Extract InstructionAdapter::emitInlineMarker 2018-08-21 13:44:02 +03:00
Alexander Udalov 1c2a9e4b21 Map annotation target TYPE -> TYPE_USE if JVM target >= 1.8
And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
2018-08-21 12:38:05 +02:00
Alexander Udalov b7808ba24d Pass JvmTarget to KotlinTypeMapper
Also use KotlinTypeMapper.RELEASE_COROUTINES_DEFAULT instead of false in
FileRankingCalculator
2018-08-21 12:23:07 +02:00
Stanislav Erokhin f3e0470dcd Allow generic type parameter to have mixed constraints for @InlineOnly functions
#KT-19323 Fixed
2018-08-21 12:17:25 +03:00
Dmitry Petrov 7d4dfc87b1 Use proper KotlinType in get/set methods for property reference 2018-08-21 08:43:12 +03:00
Dmitry Petrov 6cd91e43bb Minor: reformat 2018-08-21 08:43:12 +03:00
Alexey Tsvetkov 30f3622b27 Implement inter-project JS IC with Gradle
#KT-25025 fixed
2018-08-21 04:32:31 +03:00
Alexey Tsvetkov 7ff7c71b96 Refactoring: extract function for getting classpath changes 2018-08-21 03:53:56 +03:00
Alexey Tsvetkov aeaf1d6633 Refactoring: introduce DirtyFilesContainer for better code reuse in IC 2018-08-21 03:53:56 +03:00
Ilmir Usmanov d3dbcae7a4 Get rid of typed create and invoke wherever possible
in coroutine lambdas.
 #KT-26243 Fixed
2018-08-20 21:33:24 +03:00
Dmitry Petrov b5f37d18b2 Fix inlining of functions with matching JVM signatures in same package
When two functions with matching JVM signatures in the same package
were inlined sequentially, inliner could take a wrong method body from
the cache due to MethodId clash. This manifested with inline classes,
but also was possible with some legal Kotlin overloads with matching
erasure.

Use internal name of the corresponding implementation owner class
instead of FQN of the containing declaration. Such MethodIds can't match
accidentally, because corresponding JVM method signatures would clash.
2018-08-20 14:12:34 +03:00
Dmitry Petrov 5045fa446a Prohibit recursive inline classes 2018-08-20 10:08:10 +03:00
Zalim Bashorov 8966e220f0 Update tests 2018-08-17 21:44:08 +03:00
Zalim Bashorov c61d99fcff [JS IR BE] don't initialize instance storage for singletons explicitly, use default value (undefined) instead
It allows accessing to a singleton independent to the state of its storage.
2018-08-17 21:43:33 +03:00
Zalim Bashorov 0f6a77e700 [JS IR BE] take into account receiver's type when generate name for callables (including properties)
Also, add special markers for receiver type and generic types to avoid accidental clashes.
2018-08-17 20:31:06 +03:00
Ilmir Usmanov 2ecea55cb1 Ignore coroutines and assertion tests in android tests generator
for now.
2018-08-17 16:17:19 +03:00
Ilmir Usmanov dcfdc781db Minor. Unmute test in JS BE 2018-08-17 16:14:28 +03:00
Alexey Tsvetkov 3b4a49eebf Add test for KT-26064 2018-08-17 15:27:00 +03:00
Ilya Chernikov ac65aebb19 Direct mapping of script implicit receivers and env vars to parameters 2018-08-16 15:13:00 +02:00