Releases: JetBrains/kotlin
Kotlin 1.1-Beta2
Language related changes
KT-7897Do not require to call enum constructor for each entry if all parameters have default valuesKT-8985Support T::class.java for T with no non-null upper boundKT-10711Type inference works now on generics for callable referencesKT-13130Support exhaustive when for sealed treesKT-15898Cannot use type alias to qualify enum entryKT-16061Smart type inference on callable references in 1.1 mode only
Reflection
KT-8384Access to the delegate object for a KProperty
Compiler
Coroutine support
KT-15016VerifyError with coroutine: fix processing of uninitialized instancesKT-15527Coroutine compile error: wrong code generated for safe qualified suspension pointsKT-15552Accessor implementation of suspended function produces AbstractMethodErrorKT-15715Coroutine generate invalid invokeKT-15820Coroutine Internal Error regression with dispatcher + this@KT-15821Coroutine internal error regression: Could not inline method call applyKT-15824Coroutine iterator regression: Object cannot be cast to java.lang.BooleanKT-15827Show Kotlin Bytecode shows wrong bytecode for suspending functionsKT-15907Bogus error about platform declaration clash with private suspend functionsKT-15933Suspend getValue/setValue/provideDelegate do not work properlyKT-15935Private suspend function in file causes UnsupportedOperationException: Context does not have a "this"KT-15963Coroutine: runtime error if returned object "equals" does not like comparison to SUSPENDED_MARKERKT-16068Prohibit inline lambda parameters of suspend function type
Diagnostics
KT-1560Report diagnostic for a declaration of extension function which will be always shadowed by member functionKT-12846Forbid vararg of NothingKT-13227NO_ELSE_IN_WHEN in when by sealed class instance if is-check for base sealed class is usedKT-13355Type mismatch on inheritance is not reported on abstract classKT-15010Missing error on an usage of non-constant property in annotation default argumentKT-15201Compiler is complaining about when statement without null condition even if null is checked before.KT-15736Report an error on type alias expanded to a nullable type on LHS of a class literalKT-15740Report error on expression of a nullable type on LHS of a class literalKT-15844Do not allow to access primary constructor parameters from property with custom getterKT-15878Extension shadowed by member should not be reported for infix/operator extensions when member is non-infix/operatorKT-16010Do not highlight lambda parameters as unused in 1.0 compatibility mode
Kapt
KT-15675Kapt3 does not generate classes annotated with AutoValueKT-15697If an annotation with AnnotationTarget.PROPERTY is tagged on a Kotlin property, it breaks annotation processingKT-15803Kotlin 1.0.6 broke DaggerKT-15814Regression: Kapt is not working in 1.0.6 / 1.1-M04 / 1.1-BetaKT-15838kapt3 1.1-beta: KaptError: Java file parsing errorKT-158411.1-Beta + kapt3 fails to build the project with StackOverflowErrorKT-15915Kapt: Kotlin class target directory is cleared before compilation (and after kapt task)KT-16006Cannot determine if type is an error type during annotation processing
Exceptions / Errors
KT-8264Internal compiler error: java.lang.ArithmeticException: BigInteger: modulus not positiveKT-14547NoSuchElementException when compiling callable reference without stdlib in the classpathKT-14966Regression: VerifyError on access super implementation from delegateKT-15017Throwing exception in the end of inline suspend-functions lead to internal compiler errorKT-15439Resolved call is not completed for generic callable reference in if-expressionKT-15500Exception passing freeCompilerArgs to gradle pluginKT-15646InconsistentDebugInfoException when stepping overthrowKT-15726Kotlin compiles invalid bytecode for nested try-catch with returnKT-15743Overloaded Kotlin extensions annotates wrong parameters in javaKT-15868NPE when comparing nullable doubles for equalityKT-15995Can't build project with DataBinding using Kotlin 1.1: incompatible language versionKT-16047Internal Error: org.jetbrains.kotlin.util.KotlinFrontEndException while analyzing expression
Type inference issues
KT-10268Wrong type inference related to captured typesKT-11259Wrong type inference for Java 8 Stream.collect.KT-12802Type inference failed when irrelevant method reference is usedKT-12964Support type inference for callable references from parameter types of an expected function type
Smart cast issues
KT-13468Smart cast is broken after assignment of 'if' expressionKT-14350Make smart-cast work as it does in 1.0 when -language-version 1.0 is usedKT-14597When over smartcast enum is broken and breaks all other "when"KT-15792Wrong smart cast after y = x, x = null, y != null sequence
Various issues
KT-15236False positive: Null can not be a value of a non-null typeKT-15677Modifiers and annotations are lost on a (nullable) parenthesized typeKT-15707IDEA unable to parallel compile different projectsKT-15734Nullability is lost during expansion of a type aliasKT-15748Type alias constructor return type should have a corresponding abbreviationKT-15775Annotations are lost on value parameter types of a function typeKT-15780Treat Map.getOrDefault overrides in Java the same way as in 1.0.x compiler with language version 1.0KT-15794Refine backward compatibility mode for additional built-ins members from JDKKT-15848Implement additional annotation processing in theKotlinScriptDefinitionFromAnnotatedTemplatefor SamWithReceiver pluginKT-15875Operation has lead to overflow for 'mod' with negative first operandKT-15945Feature Request: Andrey Breslav to grow a beard.
JavaScript backend
Coroutine support
KT-15834JS: Local delegate in suspend functionKT-15892JS: safe call of suspend functions causes compiler to crash
Diagnostics
Kotlin 1.1-Beta
Reflection
KT-15540findAnnotation returns T?, but it throws NoSuchElementException when there is no matching annotation- Reflection API in
kotlin-reflectlibrary is moved tokotlin.reflect.fullpackage, declarations in the packagekotlin.reflectare left deprecated. Please migrate according to the hints provided.
Compiler
Coroutine support
KT-15379Allow invoke on instances of suspend function type inside suspend functionKT-15380Support suspend function type with value parametersKT-15391Prohibit suspend function type in supertype listKT-15392Prohibit local suspending functionKT-15413Override regular functions with suspending ones and vice versaKT-15657Refine dispatchResume conventionKT-15662Prohibit callable references to suspend functions
Diagnostics
KT-9630Cannot create extension function on intersection of typesKT-11398Possible false positive for INACCESSIBLE_TYPEKT-13593Do not report USELESS_ELVIS_RIGHT_IS_NULL for left argument with platform typeKT-13859Wrong error about using unrepeatable annotation when mix implicit and explicit targetsKT-14179Prohibit to use enum entry as type parameterKT-15097Inherited platform declarations clash: regression under 1.1 when indirectly inheriting from java.util.MapKT-15287Kotlin runtime 1.1 and runtime 1.0.x: Overload resolution ambiguityKT-15334Incorrect "val cannot be reassigned" inside do-whileKT-15410"Protected function call from public-API inline function" for protected constructor call
Kapt3
KT-15145Kapt3: Doesn't compile with multiple errorsKT-15232Kapt3 crash due to java codepageKT-15359Kapt3 exception while annotation processing (DataBindings AS2.3-beta1)KT-15375Kapt3 can't find ${env.JDK_18}/lib/tools.jarKT-15381Unresolved references: R with Kapt3KT-15397Kapt3 doesn't work with databindingKT-15409Kapt3 Cannot find the getter for attribute 'android:text' with value type java.lang.String on android.widget.EditText.KT-15421Kapt3: Substitute types from Psi instead of writing NonExistentClass for generated type namesKT-15459Kapt3 doesn't generate code in test moduleKT-15524Kapt3 - Error messages should display associated element information (if available)KT-15713Kapt3: circular dependencies between Gradke tasks
Exceptions / Errors
KT-11401Error type encountered for implicit invoke with function literal argumentKT-12044Assertion "Rewrite at slice LEXICAL_SCOPE" for 'if' with property referencesKT-14011Compiler crash when inlining: lateinit property allRecapturedParameters has not been initializedKT-14868CCE in runtime while converting Number to CharKT-15364VerifyError: Bad type on operand stack on ObserverIterator.hasNextKT-15373Internal error when running TestNG testKT-15437VerifyError: Bad local variable type on simplest provideDelegateKT-15446Property reference on an instance of subclass causes java.lang.VerifyErrorKT-15447Compiler backend error: "Don't know how to generate outer expression for class"KT-15449Back-end (JVM) Internal error: Couldn't inline method callKT-15464Regression: "Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:"KT-15575VerifyError: Bad type on operand stack
Various issues
KT-11962Super call with default parameters check is generated for top-level functionKT-11969ProGuard issue with private interface methodsKT-12795Write information about sealed class inheritors to metadataKT-13718ClassFormatError on aspectj instrumentationKT-14162Support @InlineOnly on inline propertiesKT-14705Inconsistent smart casts on when enum subjectKT-14917No way to pass additional java command line options to kontlinc on WindowsKT-15112Compiler hangs on nested lock compilationKT-15225Scripts: generate classes with names that are valid Java identifiersKT-15411Unnecessary CHECKCAST bytecode when dealing with nullKT-15473Invalid KFunction byte code signature for callable referencesKT-15582Generated bytecode is sometimes incompatible with Java 9KT-15584Do not mark class files compiled with a release language version as pre-releaseKT-15589Upper bound for T in KClass can be implicitly violated using generic functionKT-15631Compiler hang in MethodAnalyzer.analyze() fixed
JavaScript backend
Coroutine support
KT-15362JS: Regex doesn't work (properly) in coroutineKT-15366JS: error when calling inline function with optional parameters from another module inside coroutine lambdaKT-15367JS:foragainst iterator with suspendnextandhasNextfunctions does not workKT-15400suspendCoroutine is missing in JS BEKT-15597Support non-tail suspend calls inside named suspend functionsKT-15625JS: return statement without value surrounded bytry..finallyin suspend lambda causes compiler errorKT-15698Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Diagnostics
KT-14577JS: do not report declaration clash when common redeclaration diagnostic appliesKT-15136JS: prohibit inheritance from kotlin Function{N} interfaces
Language features support
KT-12194Exhaustiveness check isn't generated for when expressions in JS at allKT-15590Support increment on inlined properties
Native / external
KT-8081JS: native inherited class shouldn't require super or primary constructor callKT-13892JS: restrictions for native (external) functions and propertiesKT-15307JS: prohibit inline members inside external declarationsKT-15308JS: prohibit non-abstract members inside external interfaces except nullable properties (with accessors)
Exceptions / Errors
KT-7302KotlinJS - Trait with optional parameter causes compilation errorKT-15325JS: ReferenceError: $receiver is not definedKT-15357JS:whenexpression in primary-from-secondary constructor callKT-15435Call to 'synchronize' crashes JS backendKT-15513JS: empty do..while loop crashes compiler
Various issues
- [
KT-4160](https://youtrack.jetbra...
Kotlin 1.0.6
Compiler
KT-12224Add a diagnostic message for@JvmOverloadson interface methodsKT-14186Vararg parameters were generated as simple array parameters for JavaKT-12664Inner class was not found when a sub-directory with the same name is present in an outer class directoryKT-14408No-arg constructor should always be generated if all primary constuctor arguments have a default valueKT-14469StackOverflowError at EffectiveVisibilityKt.forVisibilityKT-14581NullPointerException at StackTransformationUtils when inlining extension function to ado-whileloop conditionKT-14678Internal error with@JvmOverloadson constructor of inner classKT-14751Class can't be resolved (related to annotation on types)KT-14774Incorrect inner class modifier was generated forsealedinner classes
Stdlib
KT-14883Performance tune: Use byte array buffer directly to read the entire contents of a file
JS
KT-12976Print human-friendly error message on wrong modules orderKT-13792Inner class of local class did not capture the enclosing class properlyKT-13912NullPointerException at JsSourceGenerationVisitor when a Lambda with empty if block passed to inline functionKT-14535Fix broken modification of captured variables defined by a destructuring declarationKT-14752Fix exception while typing@JsNameannotation in editor- Update JavaScript platform declarations (DOM, Events, etc) to latest spec
- Types that exist in runtime are now generated as abstract classes while non-existing types are now interfaces
IDE
KT-14215Show members of anonymous objects in File Structure windowKT-14217Support visibility filters in File Structure window- Implement Kotlin facet
KT-13811Expose JVM target setting in IntelliJ IDEA plugin compiler configuration UI
Issues fixed
KT-6535"Go to Symbol" did not include Enum constantsKT-10700Run tests via Gradle does not work for Kotlin sourcesKT-12385Closing quote was not automatically inserted when typing Char literalKT-12445Fix IllegalStateException in the class chooser if Kotlin script file existsKT-13279Deleting<in function call expression should delete matching>KT-13795Escaped chars in char literals was not highlightedKT-14411Code folding did not work in lambdas after some declatationKT-14585ConvertJavaCopyPasteProcessor showed a dialog under write actionKT-14741Default JVM target was inferred to 1.8 for module with dependency on JDK 1.7KT-13354Fix unstable resolve of value parameter types in IDE testsKT-13400KDoc: Fully-qualified names were resolved incorrectlyKT-13197KDoc: Code completion should suggest relevant identifiers for reference-value tagsKT-10665KDoc: Do not show full KDoc popup on ctrl-hovering over declarationsKT-13038Quick doc: HTML entities in code blocks should be escapedKT-13389Quick Doc: Hyperlinks to properties and functions did nothingKT-7739Quick Doc: Type names in should be navigableKT-7995Quick Doc: ReplaceWith value should be shown for deprecated elementsKT-13197Quick Doc: Markdown indented code blocks were not recognizedKT-11032Quick Doc:@samplewas ignoredKT-13699Quick documentation should show supertype docs for overridden Java methodsKT-14804Avoid loading ast for decompiled filesKT-5897PressingEnterafter binary operations places the caret at the wrong indentationKT-10828Support empty Unit function formatting on one lineKT-15123Do indent adjustment on the fly only for the first element in the lineKT-15128Do not assign type parameters from original proto if type is substituted with Any
Inspections, Intentions and Quickfixes
KT-12095Implement "Join Declaration and Assignment" intentionKT-12701Add a quickfix for@JvmOverloadson functions without default parameters, fix corresponding inspection rangeKT-14326Implement Intention + Inspection to remove empty secondary constructor bodyKT-14521Add Inspection to remove empty primary constructorKT-14569Convert Property to Function Intention: Search occurrences using progress dialogKT-14501Create from Usage: Support array access expressions/binary expressions with type mismatch errorsKT-14500Create from Usage: Suggest functional type based on the call with lambda argument and unresolved invoke()KT-13259"Redundant if statement" inspection: report also assignments (as done for Java)KT-13393Implement intention to convert function reference to lambdaKT-12100Add "Converttry-finallytouse" intentionKT-14459Initialize with Constructor Parameter: Fix IDE freeze on properties in generic classKT-14044Fix exception on deleting unused declaration in IDEA 2016.3KT-14019Create from Usage: Support generation of abstract members for superclassesKT-14246Intentions: Convert function type parameter to receiverKT-14246Intentions: Convert function type receiver to parameterKT-14729Implement "Add names to call arguments" intentionKT-11760Create from Usage: Support adding type parameters to the referenced type
Issues fixed
KT-14396"Remove redundant.letcall" was not proposed for binary operationsKT-14552ChangeParameterTypeFix held a strong reference to PSIKT-14745Fix KotlinNullPointerException in ConvertPrimaryConstructorToSecondaryKT-14791Fix incorrect "remove redundant.let" inspection for value with smart castKT-14733Fix incorrect intention to addout/invariance with inner classesKT-13777Simplify condition intention should work in casebooleanCond == trueKT-14890Inspection to remove curly braces from class definition should not trigger for nested classes followed by a secondary constructorKT-12633Intention "Specify type explicitly" should offer all bounds for platform typesKT-14100Auto-import should suggest Enum constantsKT-15087Don't suggestsomething == truesimplification for flexible typesKT-14982"Convert reference to lambda" worked incorrectly with static methodsKT-14985"Convert reference to lambda" worked incorrectly withapplyKT-15028Fix ClassCastException:KtParametercannot be cast toKtFunctionKT-14063N...
1.1-M04
1.1-M04 (EAP-4)
Language related changes
KT-4481compareTo on primitive floats/doubles should behave naturallyKT-11016Allow to annotate internal API to be used inside public inline functionsKT-11128Member vs SAM conversion with more specific signatureKT-12215Allowing to access protected members in public inline members creates potential binary compatibility problemKT-12531Report error when delegated member hides a supertype memberKT-14650mod function on integral types is inconsistent with BigInteger.modKT-14651Floating point comparisons shall operate according to IEEE754KT-14852It should not be possible to use typealias that abbreviates a generic projection as a constructorKT-15226Restrict delegation to java 8 default methods
Reflection
KT-12250Provide API for getting a single annotation by its classKT-14939VerifyError in accessors for bound property reference with receiver 'null'
Compiler
Coroutines
- Major coroutines redesign - see
KEEPfor details
Optimizations
KT-11734Optimize const vals by inlining them at call siteKT-13570Generate TABLE/LOOKUPSWITCH if all when branches are const integer valuesKT-14746Captured Refs should not be volatile
Various issues
KT-10982java.util.Map::compute* poor usabilityKT-12144Type inference incorporation error on SAM adapter callKT-14196Do not allow class literal with expression in annotation argumentsKT-14453Regression: Type inference failed: inferred type is T but T was expectedKT-14774Incorrect inner class modifier generated for sealed inner classesKT-14839CompilationException when calling inline fun with first arg of 2 (w/defaults) within catch block of Java exception typeKT-14855Projection in type aliases should be allowed in supertypes and constructor invocations if they expand to non-toplevel projectionsKT-14887Unhelpful error "public-API inline function cannot access non-public-API" for unresolved call inside inline functionKT-14930Android: creating Kotlin activity: UOE at EmptyList.removeAll()KT-15146Kapt3 no source files on unittestKT-15272Exception when building 2 projects at the same time
JavaScript backend
dynamic type
KT-8207Extension function on dynamic resolves on any typeKT-6579JS: prohibit to useinand!inon dynamicKT-6580JS: prohibit to use more than one argument in indexed access on dynamicKT-13615JS: don't generate guard for catch with dynamic type
@native/external
KT-13893JS: Replace @Native annotation with external modifierKT-12877Allow to specify module for native JS declarationsKT-14806JS: name of a local variable clashes with native declaration from global scope
Diagnostics
KT-13889JS: prohibit overriding native functions with default values assigned to parametersKT-13894JS: prohibit native declaration inside non-nativeKT-13895JS: RUNTIME annotationsKT-13896JS: prohibit external(native) extension functions and propertiesKT-13897JS: prohibit native(external) files and typealiasesKT-13910JS: prohibit override members of native declaration with overloadsKT-14027JS: prohibit native inner classesKT-14029JS: prohibit private members inside native declarationsKT-14037JS: prohibit using native interfaces in RHS of ISKT-14038JS: warn when using native interface in RHS of ASKT-15130JS: prohibit inheritance native from non-nativeKT-12600JS: type check with a native interface compiles but crash at runtimeKT-13307KotlinJS cannot cast to a marker interface.
Language features support
KT-13573JS: support bound callable referenceKT-14634JS: support enumValues / enumValueOfKT-15058JS: replace suspend function convention
Issues related to kotlin.Any
KT-7664JS: "x is Any" is always falseKT-7665JS: creating Any instance crashes on runtimeKT-15131JS: don't mangle Any.equals
Various issues
KT-14033JS: don't optimize (based on type information) by default expressions with any of "as, is, !is, as?, ?., !!"KT-13616JS: don't omit guard for catch with Throwable typeKT-12976JS: human-friendly error message on wrong modules orderKT-15212JS: link unqualified names injs(...)function to local functions in outer Kotlin function by nameKT-14750JS: remove unnecessary functions from kotlin.js
Bugfixes
KT-12566JS: inner local class should refer to captured variables via its outer classKT-12527Reified is-check works wrongly for chained callsKT-12586JS: compiler crashes when call inline function inside string templeateKT-13164Ecma TypeError on extending local class from inner oneKT-14888JS: Compiler error: Cannot get FQ name of local class: lazy classKT-14748JS: eliminate unused functionsKT-14999JS: Operator set + labeled lambdasKT-15007JS: Dies when checking if exception implements interface. TypeError: Cannot read property 'baseClasses' of undefinedKT-15073KT to JS losing extension function's receiverKT-15169JS: compiler fails on annotated expression with TRE at Translation.doTranslateExpression()KT-13522JS: can't use captured reified type paramter in jsClassKT-13784JS: lambda was not inlined for function with reified parameter declared in another moduleKT-13792JS: inner class of local class does not capture enclosing class properlyKT-15327JS: EnumvalueOfshould throw IllegalArgumentException
Standard library
KT-7930Make String.toInt(), toLong(), etc. nullable instead of throwing exceptionKT-8220Add #peek method to Sequence similar to Stream.peekKT-8286Int.toString and String.toInt with base as parameterKT-14034JS: unsafeCast functionKT-15181Some source files are missing from published sources on Bintray
IDE
1.1-M03
1.1-M03 (EAP-3)
New language features
KT-2964Underscores in integer literals
(see KEEP)KT-3824Underscore in lambda for unused parameters
(see KEEP)KT-2783Allow to skip some components in a multi-declaration
(see the same KEEP)KT-11551limited scope for dsl writers
(see KEEP)
Compiler
Coroutines related issues
- Make fields for storing lambda parameters non-final (as they get assigned within
invokecall) KT-14719Make initial continuation able to be resumed with exceptionKT-14636Coroutine fields should not be volatileKT-14718Validate label value of coroutine in case of no suspension points
Typealises related issues
KT-13514Type inference doesn't work with generic typealiasesKT-13837Error "Type alias expands to T, which is not a class, an interface, or an object"
should also appear for local type aliasesKT-14307Local recursive type alias should be an errorKT-14400Compiler Error IllegalStateException: kotlin.NotImplementedError when anonymous
object inherits from typealiasKT-14377Expected error: Modifier 'companion' is not applicable to 'typealias'KT-14498typealias allows to circumvent variance annotationsKT-14641An exception while processing a nested type alias access after a dot
Various issues
KT-550Properties without initializer but with get must infer type from getterKT-8816Generate Kotlin parameter names in the same form as expected for Java 8 reflectionKT-10569Cannot iterate over values of an enum class when it is used as a generic parameter
(see KEEP)KT-13557VerifyError with delegated local variable used in object expressionKT-13890IllegalAccessError when invoking protected method with default argumentsKT-14012Back-end (JVM) Internal error every first compilation after the source code changeKT-14201UnsupportedOperationException: Don't know how to generate outer expression for anonymous
object with invoke and non-trivial closureKT-14318Repeated annotations resulting from type alias expansion should be reportedKT-14347Report UNUSED_PARAMETER/VARIABLE on named unused lambda parameters/destructuring entriesKT-14352@SinceKotlin is not taken into account for companion object member referenced via
type aliasKT-14357Try-catch used in false condition generates CompilationExceptionKT-14502Prohibit irrelevant modifiers and annotations on destructured parameters in lambdaKT-14692Change resolution scope for componentX in lambda parametersKT-14824Back-end (JVM) Internal error: Couldn't inline method call 'get' into local final fun
StorageComponentContainer.(): kotlin.UnitKT-14798Gradle 3.2 AssertionError: Built-in class kotlin.ParameterName is not found
JS
Feature support
KT-6985Support Exceptions in JSKT-13574JS: support coroutinesKT-14422JS: Support destructuring in lambda parametersKT-14507JS: allow to skip some components in a multi-declaration
Library updates
KT-14637JS: Missing ArrayList.ensureCapacity
Other issues
KT-2328js: kotlin exceptions must inherit ErrorKT-5537Drop Cloneable in JSKT-7014JS: generate code which more friendly to js tools (minifier, optimizer, linter etc)KT-8019JS: no stackTrace in exception subclassesKT-10911JS: Throwable properties aren't supported wellKT-13912JS: Compiler NPE at JsSourceGenerationVisitor. Lambda with empty [if] block passed
to inline functionKT-14535JS: Broken modification of captured variables defined by a destructuring declaration
Standard Library
-
KT-2084Common API should be available without referring to java.* packagesNow those common types, which are supported on all platforms, are available in
kotlin.*packages, and are imported by default. These include:ArrayList,HashSet,LinkedHashSet,HashMap,LinkedHashMapinkotlin.collectionsAppendableandStringBuilderinkotlin.textComparatorinkotlin.comparisons
On JVM these are just typealiases of the good old types fromjava.utilandjava.lang
-
KT-13554Introduce bitwise operationsand/or/xor/invfor Byte and Short -
KT-13582New platform-agnostic extensions for arrays:contentEqualsto compare arrays'
content for equality,contentHashCodeto get hashcode of array's content, andcontentToStringto get the string representation of array elements. -
KT-14510Generic constraints ofArray.flattensignature were relaxed a bit to make it just usable. -
KT-14789ProvideKotlinVersionclass, which allows to get the current version of the standard
library and compare it with some otherKotlinVersionvalue.
IDE
KT-14409Incorrect "Variable can be declared immutable" inspection for local delegated variableKT-14431Create quick-fix on UNUSED_PARAMETER/VARIABLE when it can be replaced with one underscoreKT-14794Add /Specify type/Remove explicit type intentions for property with getters if type
can be inferredKT-14752Exception while typing @JsName annotation in editor
Previous releases
This release also includes the fixes and improvements from releases 1.0.5-2, 1.1-M01 and 1.1-M02
1.0.5-2
- Fixed compatibility with Android Studio 2.3 Canary
KT-14751Fixed inability to resolve references to Java classes with type annotations on inner class or enum constructor parametersKT-14752Fixed error when analyzing incomplete@JsNameannotationKT-14724Kotlin code compiled to JavaScript with Gradle callsmainfunction by default
1.0.5
Compiler
KT-10210Annotation written before a block-level expression now applies to the entire expression, not to its first prefixKT-13565Remove net/sf/cglib/core/* classes from compiler jarsKT-2787Set reference target and report custom error instead unresolved reference for cases:
interface, generic parameter, object + invoke, class without companion.KT-13408Fix decompilation of types based on local classifiersKT-13730Fix signature clash problems when extending Hashtable and similar classes- Support for property reference inlining
KT-11123Fix implicit type arguments resolution for inner classesKT-11263Refine diagnostic about type arguments for an outer classKT-12238,KT-10627Fix inference when captured type is used as a lambda parameter typeKT-13950Fix false positive "Cannot capture" error reportingKT-13381,KT-13396Prevent generation of delegations to interfaces private methodsKT-13295Add warning for redundantlateinitmodifierKT-13952,KT-13005Prohibit return type mismatch for delegation membersKT-8154Fix AssertionError when delegating base interface and implementing derived interfaceKT-13969Fix VerifyError for do-while, continue and a condition in a local variableKT-14025Fix CCE in OverloadResolver.findRedeclarationsKT-14147Report error on declaring 'getClass' in class or packageKT-14146Fix detection of accidental overrides with synthetic bridgeKT-14188Do not generate mutable collection stubs for Kotlin-only signaturesKT-14195Write generic signature for autogenerated toArrayKT-13698Optimize method count for collection stubsKT-14243Fix wrong invocation descriptor on calling implicitly generated implementation in classKT-11585Fix "Cannot pop operand off an empty stack" exception when accessing@JvmStaticpropertyKT-14242Fix runtime exception onarray?.size- Forbid use of expressions to the left of
::class KT-13926Report error on usages of classes deprecated with DeprecationLevel.HIDDENKT-14298Add-api-versioncommand line optionKT-5044Generate more efficient bytecode forinon ranges withdouble,floatandlongelement typeKT-14357Fixed CompilationException in case of try-catch used in false conditionKT-14012Fixed internal error on every first compilation after the source code changeKT-14304Fixed inconsistent reporting of 'variable must be initialized' after assignment
in anonymous objectKT-14158Fixed possible exception thrown when reporting unreachable code diagnosticsKT-7929,KT-8442Fixed various exceptions caused by trying to use destructuring declarations outside of a code blockKT-14447Fixed compiler exception if a value was changed but not usedKT-14201Fixed compiler exception for anonymous object with invoke and non-trivial closureKT-13890Fixed incorrect bytecode generation causing IllegalAccessError at runtime for invoking protected method with default argumentsKT-9297Report "External declaration cannot be abstract" on property with external accessor
Reflection
- Various runtime performance optimizations
KT-13700Fix reflective access on overridden generic property reference
IDE
KT-12852Support breadcrumbs for KotlinKT-13474Fix performance of typing super call lambda- Re-highlight only single function after local modifications
- Show "Variables and values captured in a closure" highlighting only for usages
KT-9125Support Type Hierarchy on references inside of super type call entriesKT-13838Add file name to the presentation of private top-level declaration (Go to symbol, etc.)KT-12697Expand selection selects ": Type"KT-13693Expand selection stops on brackets in indexing expressionKT-4519Show first line for folded block commentsKT-5193Multiline strings are now foldableKT-13473Structure view now shows local functionsKT-11775Added icons for class initializersKT-11776Primary constructor members are shown in Project view when "Show members" is enabledKT-13326Speed search is now enabled in add import popupKT-3363Support "Surround withif" for expressionsKT-13927exception Fixed on adding second inner class when there is a usage in Java of the first oneKT-9009Support for auto-import of Java static methods- Improved performance for Find Usages of convention functions
KT-13643Support for Find Usages ofinvokeoperator methodKT-13605Find Usages no longer fails to find usages of component function defined in JavaKT-13953Import member popup no longer suggests methods when only property or variable is validKT-9019,KT-10178Improved display of structure when "Group by file structure" is enabledKT-13475Show context when invoking Show Implementations from Find Usages popupKT-13140"Copy Reference" now copies JVM name of class or method to clipboardKT-10095Support "Show expression type" in variable declaration positionKT-10588Show smart cast information in "Show expression type"KT-11310,KT-8803Use short names in Show Expression TypeKT-11640Optimize imports prevents accidental changes in resolve because of import prioritiesKT-13976Search Everywhere: Render function parameter typesKT-13977Search Everywhere: Render extension type in prefix positionKT-12966Fixed possible deadlock in IDEKT-13136Reduced plugin memory usage on projects with large number of modulesKT-13861Correct Parameter Info for SAM adaptersKT-13981,KT-5117Add indent before colon of super types list on new lineKT-7718Fixed indent in constructor delegate callKT-13584Fixed IDE misbehavior (exceptions, index corruption) after Java to Kotlin conversionKT-12402Fixed resolve of databinding
classes inside the IDEKT-14131Formatter now removes spaces in labeled expressionsKT-14327Allow to select single word on double click in one line doc comment- [
KT-14452](https://youtrack.jetbrains.com/issue/KT-14452...
Kotlin 1.1 M02 (Early Access Preview)
Language features
-
Destructuring for lambdas (proposal)
Current limitations:
- Nested destructuring is not supported
- Destructuring in named functions/constructors is not supported
- Is not supported for JS target
Compiler
Smart cast enhancements
KT-2127Smart cast receiver to not null after a not null safe callKT-6840Make data flow information the same for assigned and assigneeKT-13426Fix exception when smartcast on both dispatch & extension receiver
Bound references related issues
KT-12995Do not skip generation of the left-hand side for intrinsic bound references and class literalsKT-13075Fix codegen for bound class referenceKT-13110Fix type mismatch error on class literal with integer receiver expressionKT-13172Report error on "this::class" in super constructor callKT-13271Fix incorrect unsupported error on synthetic extension call on LHS of ::KT-13367Inline bound callable reference if it's used only as a lambda
Coroutines related issues
KT-13156Do not execute last Unit-typed coroutine statement twiceKT-13246Fix VerifyError with coroutines on DalvikKT-13289Fix VerifyError with coroutines: Bad type on operand stackKT-13409Fix generic variable spilling with coroutinesKT-13531Fix ClassCastException when coercion to Unit interacts with generic await() and coroutines- Prohibit
Continuation<*>as a last parameter of suspend functions KT-13560Prohibit non-Unit suspend functions
Typealises related issues
KT-13200Fix incorrect number of required type arguments reported on typealiasKT-13181Fix unresolved reference for a type alias from a different moduleKT-13161Support java static methods calls with typealiasesKT-13835Do not lose nullability information while expanding type alias in projection positionKT-13422Prohibit usage of type alias to exception class as an object in 'throw' expressionKT-13735Fix NoSuchMethodError for generic typealias accessKT-13513Support SAM constructors for aliased java functional typesKT-13822Fix exception for start-projection of a type aliasKT-14071Prohibit using type alias as a qualifier for superKT-14282Report error on unused type alias with -language-version 1.0KT-14274Fix type alias resolution when it's used for supertype constructor call
JDK dependent built-in classes related issues
KT-13209Change first parameter's type of Map.getOrDefault to K instead of AnyKT-13069Do not emit invalid DefaultImpls delegation when interface extends MutableMap with JDK8
data classes and inheritance
KT-11306Allow data classes to implement equals/hashCode/toString from base classes
Various JVM code generation issues
KT-13182Fix compiler internal error at inlineKT-13757Prohibit referencing nested classes by name with $KT-12985Do not create range instances for 'for' loop in CharSequence.indicesKT-13931Optimize generated code for IntRange#contains
Various analysis & diagnostic issues
KT-435Use parameter names in error messages when calling a function-valued expressionKT-10001Fix false unnecessary non-null assertion on a pair elementKT-12811Treat function declaration as final if it is a member of a final classKT-13961Report REDECLARATION on private-in-file 'foo' vs public 'foo' in different file
JS
Feature support
Library updates
KT-18Move exceptions fromjava.langtokotlinpackageKT-12386Rewrite JS collections in Kotlin, move them tokotlin.collectionspackageKT-7809Make Collection implementations conform to their declared interfacesKT-7473Make AbstractCollection.equals check object typeKT-13429Make 'remove' on fresh iterator throw exception instead of removing last elementKT-13459Make JS implementation of ArrayList::add(index, element) check the index is in valid rangeKT-8724Fix MutableIterator.remove() for HashMapKT-10786Make Map.keys return view of map keys instead of snapshotKT-14194Make HashMap.putAll implementation not to call getKey/getValue
Standard Library
Backward compatibility
KT-14297Add @SinceKotlin annotation to support compatibility with compilation against older standard libraryKT-14213Ensure printStackTrace can be called with -language-version 1.0
Enhancements
KEEP-53Provide two distinct hierarchies of abstract collections: one for implementing read-only/immutable collections, and other for implementing mutable collectionsKEEP-13Provide extension functions to copy mapsKT-18Introduce type aliases for common exceptions fromjava.langinkotlinpackageKT-12762Makekotlin.ranges.untilreturn an empty range for "illegal" 'to' parameterKT-12894Allow nullable receiver foruseextension
Reflection
New features
KT-8998Introduce comprehensive API to work with KType instancesKT-10447Provide a way to check if a KClass is a data classKT-11284Add KClass.cast extensionKT-13106Support annotation constructors in reflection
Optimizations
KT-10651Optimize KClass.simpleName
IDE
New features
KT-12903Implement "Inline type alias" refactoringKT-12902Implement "Introduce type alias" refactoringKT-12904Implement "Create type alias from usage" quick fixKT-9016Make use of named higher order function parametersKT-12205Suggest import of Kotlin static members in editor with Java sourceKT-13941Implement intention for introducing destructured lambda parameters when it's possibleKT-13943Implement inspection and quickfix for to detect a manual destructuring of for / lambda parameter
Issues fixed
KT-13004Support bound method references in completionKT-13242Suggest 'typealias' keyword in completionKT-13244Override/Implement Members: Do not expand type aliases in the generated membersKT-13611Go to Class: Fix presentation of type aliasesKT-13759Rename: Process object-wrapping alias referencesKT-13955Find Usages: Add special type for usages inside of type aliases- [`KT-13...
1.0.4
Compiler
Analysis & diagnostics
KT-10968,KT-11075,KT-12286Type inference of callable referencesKT-11892Report error on qualified super call to a supertype extended by a different supertypeKT-12875Report error on incorrect call of member extension invokeKT-12847Report error on accessing protected property setter from super class' companionKT-12322Overload resolution ambiguity with constructor reference when class has a companion objectKT-11440Overload resolution ambiguity on specialized Map.put implementation from JavaKT-11389Runtime exception when calling Java primitive overloadingsKT-8200Exception when using non-generic interface with generic argumentsKT-10237Exception on an unresolved symbol in a type parameter bound in the 'where' clauseKT-11821Exception on incorrect number of generic arguments in a type parameter bound in the 'where' clauseKT-12482Exception: Implementation doesn't have the most specific type, but none of the other overridden methods does eitherKT-12687Exception when 'data' modifier is applied to objectKT-9620AssertionError in DescriptorResolver#checkBoundsKT-3689IllegalAccess on a property with private setter of the subclassKT-6391Wrong warning for array casting (Array<Any?> to Array)KT-8596Exception when analyzing nested class constructor reference in an argument positionKT-12982Incorrect type inference when accessing mutable protected property via reflectionKT-13206Report "Cast never succeeds" if and only if ClassCastException can be predictedKT-12467IllegalStateException: Concrete fake override should have exactly one concrete super-declaration: []KT-13340Report "return is not allowed here" only on the return keyword, not the whole expressionKT-2349,KT-6054Report "uninitialized enum entry" if enum entry is referenced before its declarationKT-12809Report "uninitialized variable" if property is referenced before its declarationKT-260Do not report "cast never succeeds" when casting nullable to nullableKT-11769Prohibit access from enum instance initialization code to members of enum's companion objectKT-13371Fix CompilationException: Rewrite at slice LEAKING_THIS key: REFERENCE_EXPRESSIONKT-13401Fix StackOverflowError when checking varianceKT-13330,KT-13349Fix AssertionError: Illegal resolved call to variable with invokeKT-13421Fix AssertionError: Only integer constants should be checked for overflowKT-13555Fix internal error "resolveToInstruction"KT-8989Change error messages: Replace "invisible_fake" with "invisible (private in a supertype)"KT-13612Val reassignment in try / catchKT-5469Incorrect "is never used" warning for value used in catch blockKT-13510Missing "Nested class not allowed" error for anonymous object inside val initializerKT-13685Fix NPE when resolving callable references on incomplete code- Change error messages: Fix quotes around keywords in diagnostic messages
- Change error messages: Remove quotes around visibilities
Parser
KT-7118Improve error message after trailing dot in floating point literalKT-4948Recover by following keywordKT-7915Recover after val with no subsequent nameKT-12987Recover after val with no name before declaration starting with soft keyword
JVM code generation
KT-12909Do not generate redundant bridge for special built-in overrideKT-11915Exception in entrySet when Map implementation in Kotlin extends another oneKT-12755Exception on property generation in multi-file classesKT-12983VerifyError: Bad type on operand stack in arraylengthKT-12908Variable initialization in loop causes VerifyError: Bad local variable typeKT-13040Invalid bytecode generated for extension lambda invocation with safe callKT-13023Char operations throw ClassCastException for boxed CharsKT-11634Exception for super call in delegationKT-12359Redundant stubs are generated on inheriting from java.util.CollectionKT-11833Error generating constructors of class on anonymous object inheriting from nested class of super classKT-13133Incorrect InnerClasses attribute value for anonymous object copied from an inline functionKT-13241Indices optimization leads to VerifyError with smart cast receiverKT-13374Fix compiler exception when inline function contains anonymous object implementing an interface by delegation
Generated code performance
KT-11964No TABLESWITCH in when on enum bytecode if enum constant is importedKT-6916Optimize 'for' over 'downTo'KT-12733Optimize 'for' over 'rangeTo' as a non-qualified call
Standard Library
KT-13115,KT-13297Improve documentation formatting, clarify documentation forFileTreeWalk,SequenceandgenerateSequence.KT-12894Do not fail inCloseable.useif the resource isnull.
Reflection
KT-12915Runtime exception on callBy of JvmStatic function with default argumentsKT-12967Runtime exception on reference to generic propertyKT-13370NullPointerException on companionObjectInstance of a built-in classKT-13462Make KClass for primitive type equal to the corresponding KClass for wrapper type
IDE
KT-12655New Kotlin file: extra error message for already existing fileKT-12760Prohibit running non-Unit returning main functionKT-12893Impossible to open Kotlin compiler settingsKT-10433Copy-pasting reference to companion object member causes import dialogKT-12803Class is marked as unused when it is only used is in method referenceKT-13084Run test method action executes all tests from same kotlin fileKT-12718Deadlock due to index reenteringKT-13114'Unused declaration' option 'JUnit static methods' is always enabledKT-12997Override/Implement Members: Support "Copy JavaDoc" options for library classesKT-12887"Extend selection" should select call's invoked expressionKT-13383,KT-13379Override/Implement Members: Do not make return type non-nullable if base return type is explicitly nullable- [
KT-13218](https:/...
Kotlin 1.1 M01 (Early Access Preview)
Language features
-
Coroutines (async/await, generators) (proposal)
Current limitations:
-
Bound callable references (proposal)
-
Type aliases (proposal)
Current limitations:
- type alias constructors for inner classes are not supported yet
- annotations on type alias are not supported yet
- limited IDE support
-
Local delegated properties (proposal)
-
JDK dependent built-in classes (proposal)
-
Sealed class inheritors in the same file (proposal)
-
Allow base classes for data classes (proposal)
Scripting
- Implement support for Script Definition Template
and related functionality, except the following parts:- automatic script templates discovery is not implemented
@file:ScriptTemplateannotation is not supported- the parameters
javaHomeandscriptsfromKotlinScriptExternalDependenciesare not used yet
- Implement support for custom template-based scripts in IDEA: resolving, completion and navigation to symbols from script classpath and sources
- Implement GradleScriptTemplateProvider extension that supplies a script template if gradle with
kotlin script support is used in the project
Compiler
Issues fixed
KT-4779Generate default methods for implementations in interfacesKT-11780Fixed incorrect "No cast needed" warningKT-12156Fixed incorrect error oninlinemodifier inside final classKT-12358Report missing error "Abstract member not implemented" when a fake method of 'Any' is inherited from an interfaceKT-6206Generate equals/hashCode/toString in data class always unless it'll cause a JVM signature clash errorKT-8990Fixed incorrect error "virtual member hidden" for a private method of an inner classKT-12429Fixed visibility checks for annotation usage on top-level declarationsKT-5068Introduced a special diagnostic message for "type mismatch" errors such asfun f(): Int = { 1 }.
Standard Library
KT-8254Provide standard library supplement artifacts for using with JDK 7 and 8.
These artifacts include extensions for the types available in the latter JDKs, such asAutoCloseable.use(KT-5899) orStream.toList.KT-12753Provide an access to named group matches ofRegexmatch result (for JDK 8 only).- Add
assertFailsoverload with message to kotlin-test.
IDE
New features
-
"Leaking this" inspection
This inspection reports dangerous operations inside constructors including:
- Accessing non-final property in constructor
- Calling non-final function in constructor
- Using 'this' as function argument in constructor of non-final class