2010年,长达是十年之久的Java开发让JetBrains的工程师认为老旧的Java语言已经严重阻碍了生产力。他们认为是时候开发一款现代化的JVM语言了,这也是因为他们有足够的资源和专家。本身做各种IDEs起家的JetBrains就开始着手新工具的开发——一个编程语言。
Kotlin可以通过versa调用Java方法,源码可在同一项目中混合使用,甚至生成的.class文件完全兼容Java工具。JetBrains内部现在已经有一个超过20个开发人员的团队使用Kotlin开发。 目前已经有大量的开发人员使用Kotlin开发web服务后端和Android应用。
更新日志
Analysis & diagnostics
- KT-7437, KT-7971, KT-7051, KT-6125, KT-6186, KT-11649 Implement missing checks for protected visibility
- KT-11666 Report "Implicit nothing return type" on non-override member functions
- KT-4328, KT-11497, KT-10493, KT-10820, KT-11368 Report error if some classes were not found due to missing or conflicting dependencies
- KT-11280 Do not perform smart casts for values with custom
equals
compared with ==
- KT-3856 Fix wrong "inner class inaccessible" diagnostic for extension to outer class
- KT-3896, KT-3883, KT-4986
do...while (true)
is now considered an infinite loop - KT-10445 Prohibit initialization of captured
val
in lambda or in local function - KT-10042 Correctly handle local classes and anonymous objects in control flow analysis
- KT-11043 Prohibit complex expressions with class literals in annotation arguments
- KT-10992, KT-11007 Fix multiple problems related to smart casts
- KT-11490 Prohibit nested intersection types in return position
- KT-11411 Report "illegal noinline/crossinline" on parameter of subtype of function type
- KT-3083 Report "conflicting overloads" for functions with parameter of type parameter type
- KT-7265 Parse anonymous functions in blocks as expressions
- KT-8246 Handle break/continue for outer loop correctly in case of try/finally in between
- KT-11300 Report error on increment or augmented assignment when
get
is an operator but set
is not - Report warning about unused anonymous functions
- Improve callable reference type in some ambiguous cases
- Improve multiple diagnostic messages: KT-10761, KT-9760, KT-10949, KT-9887, KT-9550, KT-11239, KT-11819
- Fix several compiler bugs leading to exceptions: KT-9820, KT-11597, KT-10983, KT-10972, KT-11287, KT-11492, KT-11765, KT-11869
JVM code generation
- KT-8269, KT-9246, KT-10143 Fix visibility of protected classes in bytecode
- KT-11363 Fix potential binary compatibility breakage on using
when
over enums in inline functions - KT-11762 Fix VerifyError caused by explicit loop variable type
- KT-11645 Fix NoSuchFieldError on private const property in multi-file class
- KT-9670 Optimize Class <-> KClass wrapping/unwrapping when getting values from annotation
- KT-6842 Optimize unnecessary boxing and interface calls on iterating over ranges
- KT-11025 Don't inline const val properties in non-annotation contexts
- KT-5429 Write nullability annotations on extension receiver parameters
- KT-11347 Preserve source file and line number of call site when inlining certain standard library functions
- KT-11677 Write correct generic signatures for local classes in inlined lambdas
- KT-12127 Do not write unnecessary generic signature for property delegate backing field
- Fix multiple issues leading to exceptions or bad bytecode being generated: KT-11034, KT-11519,KT-11117, KT-11479
Java interoperability
- KT-3068 Load contravariantly projected collections in Java (
List<? super T>
) as mutable collections in Kotlin (MutableList<in T>
) - KT-11322 Do not lose type nullability information in SAM constructors
- KT-11721 Fix wrong "Typechecker has run into recursive problem" error on calling Kotlin get function as synthetic Java property
- KT-10691 Fix wrong "Inherited platform declarations clash" error on inheritance from generic Java class with overloaded methods
Command line compiler
- KT-9546 Flush stdout and stderr before shutdown when executing scripts
- KT-10605 Disable colored output on certain platforms to prevent crashes
- Report warning instead of error on unknown "-X" flags
- Remove the compiler option "Xmultifile-facades-open"
Compiler daemon
- Reduce read disk activity
- Fix compiler daemon JAR cache clearing on IDEA Ultimate
Standard library
- KT-11410 Reduce method count of the standard library by ~2k
- KT-9990 Optimize snapshot operations to return special collection implementations when result is empty or has single element
- KT-10794 EmptyList now implements RandomAccess
- KT-10821 Create at most one wrapper sequence for adjacent drop/take operations on sequences
- KT-11301 Make Map.plus accept Map out-projected by key type as either operand (receiver or parameter)
- KT-11485 Remove implementations of some internal intrinsic functions
- KT-11648 Add deprecated extension MutableList.remove to redirect to valid function removeAt
- KT-11348 kotlin.test: Make inline methods
todo
and currentStackTrace
@InlineOnly
not to lose stack trace - KT-11745 Rename parameters of
String.subSequence
to match those of CharSequence.subSequence
- KT-10953 Clarify parameter order of lambda function parameter of
*Indexed
functions - KT-10198 Improve docs for
binarySearch
functions - KT-9786 Improve docs for
trimIndent
/trimMargin
Reflection
- KT-9952 Improve
toString()
for lambdas and function expressions when kotlin-reflect.jar is available - KT-11433 Fix multiple resource leaks by closing InputStream instances
- KT-8131 Fix exception from calling
KProperty.javaField
on a subclass - KT-10690 Support
javaMethod
and kotlinFunction
for top level functions in a different file - KT-11447 Support reflection calls to multifile class members
- KT-10892 Load annotations of const properties from multifile classes
- KT-11258 Don't crash on requesting members of Java collection classes
- KT-11502 Clarify KClass equality
JS
- KT-4124 Support nested classes
- KT-11030 Support local classes
- KT-7819 Support non-local returns in local lambdas
- KT-6912 Safe calls (
x?.let { it }
) are now inlined - KT-2670 Support unsafe casts (
as
) - KT-7016, KT-8012 Fix
is
-checks for reified type parameters - KT-7038 Avoid unwanted side effects on
is
-checks for nullable types - KT-10614 Copy array on vararg call with spread operator
- KT-10785 Correctly translate property names and receiver instances in assignment operations
- KT-11611 Fix translation of default value of secondary constructor's functional parameter
- KT-11100 Fix generation of
invoke
on objects and companion objects - KT-11823 Fix capturing of outer class'
this
in inner's lambdas - KT-11996 Fix translation of a call to a private member of an outer class from an inner class which is a subtype of the outer class
- KT-10667 Support inheritance from nested built-in types such as Map.Entry
- KT-7480 Remove declarations of LinkedList, SortedSet, TreeSet, Enumeration
- KT-3064 Implement
CharSequence.repeat
IDE
New features:
- Spring Support
- KT-11098 Inspection on final classes/functions annotated with Spring
@Configuration
/@Component
/@Bean
- KT-11405 Navigation and Find Usages for Spring beans referenced in annotation arguments and BeanFactory method calls
- KT-3741 Show Spring-specific line markers on Kotlin classes
- KT-11406 Support Spring EL injections inside of Kotlin string literals
- KT-11604 Support "Configure Spring facet" inspection on Kotlin classes
- KT-11407 Implement "Generate Spring Dependency..." actions
- KT-11408 Implement "Generate
@Autowired
Dependency..." action - KT-11652 Rename bean attributes mentioned in Spring XML config together with corresponding Kotlin declarations
- Enable precise incremental compilation by default in non-Maven/Gradle projects
- KT-11612 Highlight named arguments
- KT-7715 Highlight
var
s that can be replaced by val
s - KT-5208 Intention action to convert string to raw string and back
- KT-11078 Quick fix to remove
.java
when KClass is expected - KT-1494 Inspection to highlight public members with no documentation
- KT-8473 Intention action to implement interface or abstract class
- KT-10299 Inspection to warn on array properties in data classes
- KT-6674 Inspection to warn on protected symbols in effectively final classes
- KT-11576 Quick fix to suppress "Unused symbol" warning based on annotations on the declaration
- KT-10063 Quick fix for adding
arrayOf
wrapper for annotation parameters - KT-10476 Quick fix for converting primitive types
- KT-10859 Quick fix to make
var
with private setter final - KT-9498 Quick fix to specify property type
- KT-10509 Quick fix to simplify condition with senseless comparison
- KT-11404 Quick fix to let type implement missing interface
- KT-6785, KT-10013, KT-9996, KT-11675 Support Smart Enter for trailing lambda argument, try/catch/finally, property setter, init block
- Add
kotlinClassName()
and kotlinFunctionName()
macros for use in live templates - Auto-configure EAP-repository during Kotlin Maven and Gradle project set up
Issues fixed:
- KT-11678, KT-4768 Support navigation to Kotlin libraries from Java sources
- KT-9401 Support Change Signature quick fix for Java -> Kotlin case
- KT-8592 Fix "Choose sources" for Kotlin files
- KT-11256 Fix Navigate to declaration for Java constructor with
@NotNull
parameter - KT-11018 Fix
var
s shown in Ctrl + Mouse Hover as val
s - KT-5105, KT-11024 Improve incompatible ABI versions editor strap, show the hint on how to resolve the problem
- KT-11638 Fixed
hashCode()
implementation in "Generate equals/hashCode" action - KT-10971 Pull Members Up: Always insert spaces between keywords
- KT-11476, KT-4175, KT-10965, KT-11076 Formatter: fix multiple issues regarding space handling
- KT-9025 Improve "Create Kotlin Java runtime library" dialog usability
- KT-11481 Fix "Add import" intention not being available for
is
branches in when - KT-10619 Fix completion after package name in annotation
- KT-10621 Do not show non-top level packages after
@
in completion - KT-11295 "Convert string to template" intention: fix exception on certain code
- KT-10750, KT-11424 "Convert if to when" intention now detects effectively else branches in subsequent code and performs more accurate comment handling
- Configure Kotlin: show only changed files in the notification "Kotlin not configured", restore all changed files in undo action
- KT-11556 Do not show "Kotlin not configured" for Kotlin JS projects
- KT-11593 Fix "Configure Kotlin" action for Gradle projects in IDEA 2016
- KT-11077 Use new built-in definition file format (
.kotlin_builtins
files) - KT-5728 Remove closing curly brace in a string template when opening one is deleted
- KT-10883 "Explicit get or set call" quick fix: do not move caret too far away
- KT-5717 "Replace 'when' with 'if'": do not lose comments
- KT-10797 "Replace with operator" intention is not available anymore for non-
operator
functions - KT-11529 Highlighting range for unresolved annotation name does not include
@
now - KT-11178 Don't show "Change type arguments" fix when there's nothing to change
- KT-11789 Don't interpret annotations inside Markdown code blocks as KDoc tags
- KT-11702 Fixed resolution of Kotlin beans with custom name
- KT-11689 Fixed exception on attempt to navigate to Kotlin file from Spring notification balloon
- KT-11725 Fixed renaming of injected SpEL references
- KT-11720 Fixed renaming of Kotlin beans through SpEL references
- KT-11719 Fixed renaming of Kotlin parameters references in XML files
- KT-11736 Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions
- KT-11862 Fixed bogus warnings about unresolved types in the Change Signature dialog
- Fix several issues leading to exceptions: KT-11579, KT-11580, KT-11777, KT-11868, KT-11845, KT-11486
- Fixed NoSuchFieldException in Kotlin module settings on IDEA Ultimate
Debugger
- KT-11705 "Smart step into" no longer skips methods from subclasses
- Debugger can now distinguish nested inline arguments
- KT-11326 Support private classes in Evaluate Expression
- KT-11455 Fix Evaluate Expression behavior for files with errors in sources
- KT-10670 Fix Evaluate Expression behavior for inline functions with default parameters
- KT-11380 Evaluate Expression now handles smart casts correctly
- KT-10148 Do not suggest methods from outer context in "Smart step into"
- Fix Evaluate Expression for expression created for array element
- Complete private members from libraries in Evaluate Expression
- KT-11578 Evaluate Expression: do not highlight completion variants from nullable receiver with grey
- KT-6805 Convert Java expression to Kotlin when opening Evaluate Expression from Variables view
- KT-11927 Fix "ambiguous import" error when invoking Evaluate Expression from Variables view for some field
- KT-11831 Fix Evaluate Expression for values of raw types
- Show error message when debug info for some local variable is corrupted
- Avoid 1s delay in completion in debugger fields if session is not stopped on a breakpoint
- Avoid cast to runtime type unavailable in current scope
- Fix text with line breaks in popup with line breakpoint variants
- Fix breakpoints inside inline functions in libraries sources
- Allow breakpoints at catch clause declaration
- KT-11848 Fix breakpoints inside generic crossinline lambda argument body
- KT-11932 Fix Step Over for
while
loop condition
Java to Kotlin converter
- Protected members used outside of inheritors are converted as public
- Support conversion for annotation constructor calls
- Place comments from the middle of the call to the end
- Drop line breaks between operator arguments (except
+
, -
, &&
and ||
) - Add non-null assertions on call site for non-null parameters
- Specify type for variables with anonymous type if they have write accesses
- KT-11587 Fix conversion of static field accesses from other Java class
- KT-6800 Quote
$
symbols in converted strings - KT-11126 Convert annotations in annotations parameters correctly
- KT-11600 Do not produce unresolved
toArray
calls for Java Collection#toArray(T[])
- KT-11544 Fix conversion of uninitialized non-final field
- KT-10604 Fix conversion of scratch files
- KT-11543 Do not produce unnecessary casts of non-nullable expression to nullable type
- KT-11160 Fix IDE freeze
Android
- KT-7729 Add Android Lint checks for Kotlin (from Android Studio 1.5)
- KT-11487 Fixed sequential build with kapt and stubs enabled when Kotlin source file was modified and no Java source files were modified
- KT-11264 Action to create new activity in Kotlin
- KT-11201 Do not ignore items with similar names in kapt
- KT-11944 Rename Android Extensions imports when the layout file is renamed/deleted/added
- KT-10321 Do not upcast ViewStub to View
- KT-10841 Support
@android:id/*
IDs in Android Extensions
Maven
Gradle
- KT-8487 Experimental support for incremental compilation with project property
kotlin.incremental
- KT-11350 Fixed a bug causing Java rebuild when both Java and Kotlin are up-to-date
- KT-10507 Fix IllegalArgumentException "Missing extension point" on parallel builds
- KT-10932 Prevent compile tasks from running when nothing changes
- KT-11993 Fix NoSuchMethodError on access to internal members in production from tests (IDEA 2016+)
下载地址