Commit Graph

14142 Commits

Author SHA1 Message Date
Svetlana Isakova 9063b3803e record smartcast to the most specific type 2014-02-12 12:48:14 +04:00
Svetlana Isakova 9832676701 generate constraint system tests
more tests added
2014-02-12 12:48:13 +04:00
Svetlana Isakova 791fa22abb KT-4405 Control-flow analysis is not performed for some local declarations #KT-4405 Fixed 2014-02-12 12:48:13 +04:00
Svetlana Isakova aa713ef1f6 generate pseudocode for property accessor only if the property is local
otherwise check it independently like a function
2014-02-12 12:48:12 +04:00
Svetlana Isakova 1c4db84d92 do not try properties named 'invoke' when resolve 'invoke' 2014-02-12 12:48:12 +04:00
Svetlana Isakova b51e3dc464 added ConstraintSystemTest 2014-02-12 12:48:11 +04:00
Svetlana Isakova 9d493b6f7b generate CHECK_CAST for smartcasted 'this' 2014-02-12 12:48:11 +04:00
Svetlana Isakova 9ed57a5767 removed AutoCastReceiver
check subtype for receiver by AutoCastUtils.isSubTypeByAutoCast directly
 #KT-4403 Fixed
 #KT-4415 Fixed
2014-02-12 12:48:10 +04:00
Svetlana Isakova 5ef320173c generate pseudocode for functions in local classes
#KT-4405 In progress
 #KT-3501 Fixed
2014-02-11 21:07:10 +04:00
Svetlana Isakova f74fbf9f8b added readme file about diagnostic tests directives 2014-02-11 21:07:09 +04:00
Svetlana Isakova 1446feff20 removed unnecessary more accept(JetVisitorVoid) methods 2014-02-11 21:07:09 +04:00
Svetlana Isakova cfb97bf0b9 made JetVisitorVoid extends JetVisitor<Void, Void> 2014-02-11 21:07:09 +04:00
Svetlana Isakova 64e13114e2 store unsubstituted descriptor as REFERENCE_TARGET 2014-02-11 21:07:09 +04:00
Svetlana Isakova 8868da8c5f KT-4372 Invalid error position and failing to resolve invoke with receiver from other module #KT-4372 Fixed 2014-02-11 21:07:09 +04:00
Svetlana Isakova e95e505b5d asserts changed to LOG.error 2014-02-11 21:07:08 +04:00
Svetlana Isakova c5d9757b94 added renderers for constraint system and type bounds
moved classes
2014-02-11 21:07:08 +04:00
Svetlana Isakova 45abab2a2c KT-4341 No resolved call for right-hand side of equals expression
#KT-4341 Fixed
2014-02-11 21:07:08 +04:00
Svetlana Isakova aca21f78d5 check incomplete equality 2014-02-11 21:07:08 +04:00
Pavel V. Talanov 80183c88cf Do not normalize visibilities for fake overrides
#KT-4525 Fixed
2014-02-11 20:13:11 +04:00
Mikhael Bogdanov eab7f5539b Fixed dependency to kotlin runtime (dist version) 2014-02-11 17:36:01 +04:00
Pavel V. Talanov 4a3ccc4eac JDR: do not create package fragment for class statics if class cannot be resolved
This keeps behaviour consistent in rare cases when JavaClass can be found but not resolved
As of now this can happen in IDE if we take PsiClass from index but file structure is wrong so we can't resolve the class
Add test which documents this case
2014-02-11 17:17:34 +04:00
Pavel V. Talanov 4501adf5f1 AbstractInsertImportOnPasteTest: use test framework to create correct file structure for java files 2014-02-11 17:17:33 +04:00
Pavel V. Talanov e3ae7afac3 Add validation for binding between java classes and corresponding package fragments 2014-02-11 17:17:06 +04:00
Pavel V. Talanov e4a0221abc Remove PackageFragmentDescriptor#getProvider method
PackageFragmentProvider should be hidden from the client of PackageFramentDescriptor
2014-02-11 17:17:05 +04:00
Pavel V. Talanov cd6a71ef81 Refactor JDR: add explicit binding between java classes and packages for their statics
Get rid of Kind in JavaPackageFragmentDescriptor and create subclass which exposes additional function
Add method in JavaClassDescriptor to get correponding package fragment
Remove JavaDescriptorResolver from context
2014-02-11 17:17:04 +04:00
Pavel V. Talanov 00a5e7ab15 Refactor JDR: remove some of the usages of JavaDescriptorResolver class 2014-02-11 17:17:03 +04:00
Pavel V. Talanov 16a2a5cd62 Refactor JDR: minor extract function in LazyJavaPackageFragmentProvider 2014-02-11 17:17:02 +04:00
Pavel V. Talanov 2fe2a50b14 Refactor JDR: use JavaResolverCache in LazyJavaPackageFragmentProvider directly
Remove LazyJavaClassResolverWithCache
This actually can affect behaviour because JavaResolverCache has slightly different logic (uses CLASS key in BindingContext as opposed to FQNAME_TO_CLASS_DESCRIPTOR)
2014-02-11 17:17:01 +04:00
Pavel V. Talanov 18d088cb71 Refactor JDR: create LazyJavaPackageFragmentProvider in injector 2014-02-11 17:17:00 +04:00
Pavel V. Talanov 737f538ea7 Minor: use orEmpty() instead of ?: listOf() in LazyJavaPackageFragmentProvider 2014-02-11 17:16:59 +04:00
Pavel V. Talanov 4153182fd2 Refactor JDR: minor, extract class 2014-02-11 17:16:58 +04:00
Zalim Bashorov 37154e42d2 JS backend: fixed smartcast when a call have implicit this or receiver. 2014-02-11 13:50:16 +04:00
Alexey Sedunov 40eaf49a8c Support find usages for declarations with multiple overridden Java methods (e.g. J -> J -> K) 2014-02-10 18:57:56 +04:00
Aleksei Sedunov 0e451bd35e Add assertion message 2014-02-10 12:25:53 +04:00
Alexey Sedunov d549257bfc Allow to find usages of Java class via references to its constructor #KT-4521 Fixed 2014-02-10 12:25:52 +04:00
Pradyoth Kukkapalli 8b6bd8a184 New Intention Action: Replace an infix function call with a dot qualified method call. 2014-02-09 09:05:19 -08:00
Tuomas Tynkkynen 64f67f30f0 Prevent smartSelectExpression from breaking up 'this@outerClass'
The previous commit made JetThisExpression not implement
JetStatementExpression. This had the side effect that
smartSelectExpression over a label-qualified this expression
(e.g 'this@outerClass') would now also list a plain 'this'
as a potential expression. Restore the old behaviour by adding an
explicit check for JetThisExpression.
2014-02-09 17:22:30 +04:00
Tuomas Tynkkynen 9ce40cd17b Fix unnecessary parenthesis around 'this' in refactorings
Operator priority calculation for 'this' expressions was incorrect in
JetPsiUtil.getPriority(): it would return a very low value for
a JetThisExpression, causing the IDE to report that parenthesis
are necessary in an expression like '(this)[1]'.

Fix this by making JetThisExpression not implement
JetStatementExpression by removing the implements clause from
JetLabelQualifiedInstanceExpression and adding it to all other
subclasses of JetLabelQualifiedInstanceExpression.

Fixes KT-4513.
2014-02-09 17:22:27 +04:00
Tuomas Tynkkynen 85c46019d3 Add test suite for smart expression selector
Add test suite for smart expression selector (the small expression list
popup in e.g. Extract Variable.)

The test file format is similar to that in JetNameSuggesterTest: a .kt
file with the usual <caret> marker specifying the place where the smart
selector will be run. Then, the last comment in the file should contain
the expected outcome.
2014-02-09 17:22:24 +04:00
Tuomas Tynkkynen 815ca2fe57 Separate GUI logic from smartSelectExpression
Previously smartSelectExpression did both the determination of suitable
expressions and displaying the GUI. Separate the actual logic into a new
method, getSmartSelectSuggestions so that smart selection can be tested
in the future.
2014-02-09 17:22:19 +04:00
Tuomas Tynkkynen 7429cc8819 Make JetTestUtils.getLastCommentInFile() to allow trailing newline
Many editors add a trailing newline when saving. Allow them in
getLastCommentInFile.
2014-02-09 17:22:10 +04:00
Tuomas Tynkkynen 420a08167b Extract JetTestUtils.getLastCommentInFile()
JetNameSuggesterTest contains useful code for getting the last comment
of a file. Extract it to JetTestUtils.getLastCommentInFile() so other
tests can use it as well.
2014-02-09 17:22:07 +04:00
Alexander Udalov cb2733a0ae Fix built-ins serializer to work with any packages
Make it serialize data for all packages found in sources and not only
KotlinBuiltIns.FQ_NAME, i.e. "jet". This is required to migrate built-ins from
package "jet" to "kotlin"
2014-02-09 04:17:35 +04:00
Andrey Breslav 9229062926 Do not annotate bare type parameters as @Nullable
This is to account for the case of, say

     class Function<R> { fun invoke(): R }

it would be a shame to put @Nullable on the return type of the function, and force all callers to check for null,
so we put no annotations
2014-02-07 16:41:12 -08:00
Mikhael Bogdanov e0ca1abe4b KT-3706 Inconsistent stack height in try catch finally in function
KT-4134 Incorrect bytecode is generated for

 #KT-3706 Fixed
 #KT-4134 Fixed
2014-02-07 13:45:22 +04:00
Nikolay Krasko 7b07b748cb Refactoring: remove unused method 2014-02-06 15:52:04 +04:00
Nikolay Krasko 1d884912a0 Minor: call overloaded constructor 2014-02-06 15:52:04 +04:00
Nikolay Krasko 10dec22feb Minor: Add 'memoized' to dictionary 2014-02-06 15:52:03 +04:00
Nikolay Krasko 876040cb53 Minor: fix warnings and formatting 2014-02-06 15:52:03 +04:00
Nikolay Krasko 3b3f9f7022 Rewrite KotlinImportListRenderer to Java to make it compilable with both JDK 1.6 and JDK 1.7
In JDK 1.7 JList has generic parameter
2014-02-06 15:52:02 +04:00