Commit Graph

30502 Commits

Author SHA1 Message Date
Kirill Rakhman 146dca2cd6 Formatter: Remove spaces between expression and parentheses
#KT-11476 Fixed
2016-03-21 17:56:04 +03:00
Denis Zharkov 56477f0af8 Fix loading container type from Java
Load immutable flexible upper bound for 'Iterable<? super T>'

We load 'Collection<? super CharSequence>' as 'MutableCollection<in CharSequence>'
instead of 'MutableCollection<in CharSequence>..Collection<*>'
because it's obviously not typesafe to use any 'Collection<*>'
as argument for such type.

But there'se nothing bad with loading 'Iterable<? super CharSequence>'
as 'MutableIterable<*>..Collection<*>'. Same for other declarations that have
covariant mutable representation (currently Iterator, ListIterator).

Also there are useful use-cases when it's neccessary to use 'Iterable<*>'
as an argument for parameter with type 'Iterable<? super T>' (see matchers.kt test).

NB: Star-projections appear in examples because types like 'Collection<in CharSequence>'
with conflicting use-site projections are invalid in Kotlin, but they are valid in Java.
2016-03-21 16:46:46 +03:00
Denis Zharkov c3e44ec199 Fix loading Java type arguments
Type arguments with use variance in java contradicting to Kotlin declaration-site variance should be loaded as star-projections

 #KT-11492 Fixed
2016-03-18 19:07:27 +03:00
Denis Zharkov 838fcf9a57 Load contavariantly projected collections in Java as mutable
#KT-3068 Fixed
2016-03-18 19:07:27 +03:00
Denis Zharkov e54b25a35a Fix StackOverflowError while mapping recursive intersection-type
#KT-10972 Fixed
2016-03-18 19:07:27 +03:00
Denis Zharkov 67b59fa72f Prohibit nested intersection types in return position
#KT-11490 Fixed
2016-03-18 19:07:27 +03:00
Mikhail Glukhikh 90b5d3b9f5 Minor if-to-when refactoring 2016-03-18 18:54:01 +03:00
Mikhail Glukhikh fa069214fd if to when intention now detects effectively else branches in subsequent code + performs more accurate comment handling #KT-10750 Fixed
Also #KT-11424 Fixed
2016-03-18 18:47:32 +03:00
Michael Bogdanov c3d450f050 Fix for KT-11479: 1.0.2 Snapshot: CompilationException: Back-end (JVM) Internal error: Couldn't inline method call
#KT-11479 Fixed
2016-03-18 15:43:18 +01:00
Natalia Ukhorskaya dde11b7f50 Report more info for errors from jdi 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya 6b4ea1ff19 Debugger: do not report errors from context file
#KT-11455 Fixed
2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya 6752d0f180 Descriptors from library source should be visible from descriptors from libraries class files 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya 5b489d1986 Debugger: use StackFrameProxy from IDEA instead of StackFrame from JDI to show error message when debug info in corrupted
#EA-76187 - IE: FrameVisitor.findLocalVariable Fixed
2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya 589d7007fc Skip additional visibility check for java classes in debug mode 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya b79aa13242 Complete private members from libraries in Evaluate Expression dialog 2016-03-18 15:19:03 +03:00
Natalia Ukhorskaya 26c153639a Skip visibility check when resolving class in debug mode
#KT-11326 Fixed
2016-03-18 15:19:03 +03:00
Alexander Udalov 0fd8bec2ef Convert Java model to Kotlin, put in several files
Also move JavaPropertyInitializerEvaluator to ../components/
2016-03-18 14:48:58 +03:00
Alexander Udalov 0d74fc2290 Minor cleanup in Java model: fix warnings, remove unused 2016-03-18 14:48:57 +03:00
Alexander Udalov 0a54464420 Minor, JavaClass#getOriginKind -> isKotlinLightClass 2016-03-18 14:48:56 +03:00
Alexander Udalov 0ba0e2b10d Delete JavaTypeSubstitutorImpl, use PsiSubstitutor in JavaClassImpl
Also delete related tests
2016-03-18 14:48:56 +03:00
Alexander Udalov 291c713d8b Cleanup JavaElement model from methods used only in substitutor
Downcast everything used in JavaTypeSubstitutorImpl to *Impl, remove methods
from interfaces, inline/move some of them
2016-03-18 14:48:55 +03:00
Alexander Udalov 26bf0dca13 Remove interface JavaTypeSubstitutor, use implementation
After 151e55b JavaTypeSubstitutor is only used from inside PSI-based
implementation of Java structure
2016-03-18 14:48:55 +03:00
Alexander Udalov e42cb2af40 Render 'annotation class not found' for error types in tests
After 13ae3d9 it became unclear whether an annotation mentioned in test data is
resolved or not, this change fixes that
2016-03-18 14:48:54 +03:00
Alexander Udalov 70dd79d7e4 Minor, rename TypeConstructorImpl -> ClassTypeConstructorImpl 2016-03-18 14:20:43 +03:00
Alexander Udalov 13ae3d96ab Simplify TypeConstructorImpl, extend it from AbstractClassTypeConstructor 2016-03-18 14:20:43 +03:00
Michael Bogdanov b95e27fd87 Fix for KT-11478: "Couldn't inline method call" error
#KT-11478 Fixed
2016-03-18 11:07:47 +01:00
Denis Zharkov ce8add2802 Fix common supertype calculation
Use star-projections instead of 'out Any?' in corner cases

 #KT-11468 Fixed
2016-03-18 10:12:00 +03:00
Mikhail Glukhikh bace881463 Quick fix to make var with private setter final #KT-10859 Fixed 2016-03-17 18:18:07 +03:00
Mikhail Glukhikh efdf6b9569 Minor 2016-03-17 17:47:10 +03:00
Alexey Tsvetkov d1a8c0d09b Enable default incremental compilation by default in IDEA
#KT-11360 fixed
2016-03-17 15:47:51 +03:00
Denis Zharkov fecb64560b Minor. Decrease method visibility 2016-03-16 20:23:42 +03:00
Denis Zharkov d9a6d15fe4 Add tests for obsolete issues
#KT-4628 Obsolete
 #KT-3897 Obsolete
 #KT-3898 Obsolete
 #KT-7523 Obsolete
2016-03-16 20:23:36 +03:00
Denis Zharkov bfa0b69ba9 Simplify SamCodegenUtil.getOriginalIfSamAdapter
At the monent adapters are either:
- synthetic extensions (no overrides)
- static members:
fake override always has one overridden from super class,
that should be created as a result of SamAdapterDescriptor.createSubsitutedCopy(),
hence should be instance of SamAdapterDescriptor
2016-03-16 20:23:01 +03:00
Denis Zharkov 1d0c37ff20 Cache read classes and method nodes for inline
It decrease GENERATE phase nearly for 10%
2016-03-16 20:23:01 +03:00
Denis Zharkov 26081bf817 Support loading Java annotations with TYPE_PARAMETER target 2016-03-16 20:23:01 +03:00
Denis Zharkov 04eb5ff4f7 Move test loading Java TYPE_USE annotation to Java8 module
#KT-11454 Fixed
2016-03-16 20:23:00 +03:00
Denis Zharkov 85329e59ca Remove nullability annotations attached to TYPE_USE position in tests
They do not work anyway by many reasons:
- 'org.jetbrains.annotations.*' are not TYPE_USE targeted
- raw type with annotated arguments is something very weird and should be
investigated
2016-03-16 20:23:00 +03:00
Denis Zharkov e96024017f Move and fix tests on typeEnhancement with TYPE_USE annotations 2016-03-16 20:22:59 +03:00
Denis Zharkov a644dd3ae9 Create tests for TYPE_USE nullability annotations
- tests and declarations for checkerframework has been moved,
because they only Java 8 targeted
- tests for eclipse annotations has been just copied,
because there are two jars: one for Java 8 and other for earlier versions
2016-03-16 20:22:59 +03:00
Denis Zharkov 3f3c2bb272 Minor. Update eclipse nullability annotation sources
Accordingly to their repository
2016-03-16 20:22:58 +03:00
Denis Zharkov c9c9f7ff38 Minor. Simplify LazyJavaClassMemberScope.getFunctionsFromSupertypes 2016-03-16 20:22:58 +03:00
Denis Zharkov 78c9dffe00 Refine return type of MemberScope.getContributedFunctions 2016-03-16 20:22:58 +03:00
Denis Zharkov 50d258e7f4 Optimize CF merge operations
Return incoming value if it's single
2016-03-16 19:27:28 +03:00
Denis Zharkov 4bea054e4b Optimize TowerResolver.run implementation
- run `processor` at each level instead of list construction
- make it as lazy as possible

Speed up analysis time nearly for 2-5%
2016-03-16 19:27:28 +03:00
Nikolay Krasko ee50aec734 Don't add a blank line between one line class and object (KT-10965) 2016-03-16 18:41:28 +03:00
Alexey Tsvetkov 61090d7027 Refactoring: optimize createDefaultSourceDirectorySet 2016-03-16 16:43:25 +03:00
Alexey Tsvetkov d1abc87857 Fix NoSuchMethodError with Gradle 2.12
#KT-11351 fixed
2016-03-16 16:43:24 +03:00
Alexey Tsvetkov d6c2f77125 Fix Process.waitFor freeze on windows when gradle daemon is stopped during tests 2016-03-16 16:43:24 +03:00
Alexander Udalov b2cffeeb24 Fix 'IDE' scope file pattern by including 'src' recursively
See b328f37
2016-03-16 16:10:26 +03:00
NitroG42 c66f4450d8 Add new expressions to template
Added two missing expressions for live-templates, the className(), and
the functionName()
2016-03-16 13:40:33 +01:00