Commit Graph

23906 Commits

Author SHA1 Message Date
Svetlana Isakova 89e16ecbcc Don't generate constraint if a type variable was substituted twice
to prevent infinite recursion
2015-07-10 15:05:06 +03:00
Svetlana Isakova 3b85ac90ba Check initial constraints in constraint system status 2015-07-10 15:05:06 +03:00
Svetlana Isakova 4c4f99c356 Use approximation of captured types in incorporation
to generate new constraints
2015-07-10 15:05:06 +03:00
Svetlana Isakova c6e698e18d Minor: simplified code
Used BoundKind.ordinal()
2015-07-10 15:05:05 +03:00
Svetlana Isakova ac578f7e5b Cache type corresponding to type variable 2015-07-10 15:05:05 +03:00
Svetlana Isakova db8085c399 Incorporation tests 2015-07-10 15:05:05 +03:00
Svetlana Isakova 179c5e3c3a Add a constraint for nested call
if there are no bounds on variables in this call return type
2015-07-10 15:05:04 +03:00
Svetlana Isakova 1463ff7258 Updated constraint system tests 2015-07-10 15:05:04 +03:00
Svetlana Isakova cf64687b02 More accurate error reporting
with type inference error for delegated properties
Add the constraints from completer if they don't lead to errors
except errors from upper bounds to improve diagnostics
2015-07-10 15:05:04 +03:00
Svetlana Isakova 9a5abf368f Constraint incorporation
In a constraint system a new bound is incorporated:
all new constrains that can be derived from it
(and from existing ones) are added
2015-07-10 15:05:04 +03:00
Svetlana Isakova 82acce4767 Separate input and result data in constraint system test
input file: *.constraints
 result file: *.bounds
2015-07-10 15:05:03 +03:00
Svetlana Isakova 07937a27eb Added GenericCandidateResolver 2015-07-10 15:05:03 +03:00
Svetlana Isakova 0fdfb6b5db Render short names in constraint system tests 2015-07-10 15:05:02 +03:00
Svetlana Isakova 8b9cdd1751 Changes in TypeBounds interface
inlined 'isEmpty' (correctly)
  replaced functions 'getValue, getValues' with properties
2015-07-10 15:05:02 +03:00
Svetlana Isakova 5717148bd4 Changed test data
Added an extra blank line to rendered constraint system
2015-07-10 15:05:02 +03:00
Svetlana Isakova 918087f475 Don't render constraint positions in tests
for constraint system, it's always SPECIAL anyway
2015-07-10 15:05:02 +03:00
Svetlana Isakova f7dc59e2d6 Added 'UNKNOWN' argument mapping
for cases with no argument expression
2015-07-10 15:04:38 +03:00
Denis Zharkov 76648878e0 Ignore type parameters in value arguments while comparing SAM adapters
#KT-8388 Fixed
2015-07-10 08:46:27 +03:00
Alexey Sedunov aa34fe6352 Minor: Remove useless annotation 2015-07-10 01:28:54 +03:00
Alexey Sedunov f71f7dd4dd Minor: Drop unused classes 2015-07-09 20:47:57 +03:00
Alexey Sedunov f9b836e144 Change Signature: Error reporting for Java class without an explicit constructor 2015-07-09 20:47:54 +03:00
Alexey Sedunov a96bd546a1 Change Signature: Avoid explicit Unit return type 2015-07-09 20:47:51 +03:00
Alexey Sedunov eb7463ed81 Change Signature: Propagate parameters to chosen callers
#KT-7902 Fixed
2015-07-09 20:47:48 +03:00
Alexey Sedunov 9853934087 Change Signature: Implement parameter propagation UI
#KT-7902 In progress
2015-07-09 20:47:45 +03:00
Alexey Sedunov 46dcfb508e Call Hierarchy: Find implicit constructor calls in Java code 2015-07-09 20:35:06 +03:00
Alexey Sedunov 8104b899aa Find Usages: Unify usage highlighting and full usage search 2015-07-09 20:35:03 +03:00
Alexey Sedunov e8f5a2db7c Minor: Fix compilation-breaking nullability issues 2015-07-09 20:34:55 +03:00
Alexey Sedunov 058829aa55 J2K: JetChangeSignatureDialog 2015-07-09 17:56:54 +03:00
Alexey Sedunov 8b2be72434 J2K: JetChangeSignatureDialog (rename to .kt) 2015-07-09 17:56:53 +03:00
Alexey Sedunov 0bf7bb3987 J2K: JetChangeSignatureHandler 2015-07-09 17:56:52 +03:00
Alexey Sedunov 74570333c0 J2K: JetChangeSignatureHandler (rename to .kt) 2015-07-09 17:56:50 +03:00
Alexey Sedunov 0afea7acac J2K: JetUsageInfo 2015-07-09 17:56:49 +03:00
Alexey Sedunov 51eb989d57 J2K: JetChangeSignatureProcessor 2015-07-09 17:56:47 +03:00
Alexey Sedunov 9dd6dea85f Change Signature: Move UI-related classes to separate package 2015-07-09 17:56:46 +03:00
Alexey Sedunov 0169963a27 Change Signature: Process internal usages of function parameters when
performing Java refactoring
2015-07-09 17:56:44 +03:00
Denis Zharkov 5c60a1bdb8 Make project compilable after PurelyImplements annotation introduction 2015-07-09 16:36:48 +03:00
Denis Zharkov a218c1359f Adjust testData: JDK collections behave like non-platform in backend
Some of that changes looks like regression and should be fixed soon
2015-07-09 16:36:48 +03:00
Denis Zharkov d350303951 Change HashMap in test to custom class
It's implementing kotlin.Map with flexible arguments that is necessary in this test.
2015-07-09 16:36:47 +03:00
Denis Zharkov 151231ef1a Adjust testData
Standard JDK collections purely implement kotlin.Mutable* with non-platform arguments
2015-07-09 16:36:47 +03:00
Denis Zharkov 8b49a1d660 Add PurelyImplements annotation
It's parameter is FQ-name of class (currently only from builtins) that added as supertype to annotated Java class.

Parameters of annotated class used as non-flexible arguments of added supertype, that helps to propagate more precise types when using in Kotlin.
Some standard JDK collections loaded as they annotated with PurelyImplements.

See tests for clarification.
Before: ArrayList<Int>.add(x: Int!) // possible to add null
After: ArrayList<Int>.add(x: Int)   // impossible to add null

 #KT-7628 Fixed
 #KT-7835 Fixed
2015-07-09 16:36:47 +03:00
Denis Zharkov 8120513465 Add some collections to mockJDK
It's neccessary to test they loaded as pure implementation of kotlin collections
2015-07-09 16:36:46 +03:00
Denis Zharkov da416f1caf Change traversal order for finding corresponding supertype from DFS to BFS
In most cases order doesn't matter as in supertype tree built from real code
types with same type constructors should be completely equal.

The only case when order does matter is when we artificially add more specific supertype closer to the root.

For example specific annotation adding non-platform supertype MutableMap<K, V> to ConcurrentHashMap
ConcurrentHashMap<K, V> extends ConcurrentMap<K!, V!> that extends java.util.Map<K!, V!> (mapped to kotlin.MutableMap<K!, V!>)

So we want in that case to use refined (more specific) version when checking subtypes:
ConcurrentHashMap<String, Int> should not be a subtype Map<String!, Int!> (and respectively Map<String?, Int?>)
It should be pure non-platform Map<String, Int> that can be found only with BFS
2015-07-09 16:36:46 +03:00
Denis Zharkov 0a19fb7df2 Make project compilable after types enhancement 2015-07-09 16:36:46 +03:00
Denis Zharkov 4479c215d4 Change return type for iterator method of asList impls for *Array
These objects implement AbstractList that extending MutableCollection.
After type propagation `iterator` of AbstractList become MutableIterator, so it cannot be overriden with immutable Iterator
2015-07-09 16:36:46 +03:00
Denis Zharkov afcdd27d67 Add some marginal tests for types enhancement 2015-07-09 16:36:45 +03:00
Denis Zharkov 5ea0c14d4a Expand the AbstractJvmRuntimeDescriptorLoaderTest hack
Remove type related annotations from java source as they have CLASS retention policy
2015-07-09 16:36:45 +03:00
Denis Zharkov 00e41fc238 Fix testData after types enhancement 2015-07-09 16:36:45 +03:00
Denis Zharkov befe025d21 Fix intentions testData: types rendering changed
Some more FQ names appeared.
The reason is that earlier such types were Lazy and their `toString` method return short version.
But after type enhancement they are represented with JetTypeImpl
2015-07-09 16:36:45 +03:00
Denis Zharkov f0833d626a Fix intentions tests after types enhancement
Types became more accurate
2015-07-09 16:36:44 +03:00
Denis Zharkov cfadda8061 Fix codegen tests after types enhancement 2015-07-09 16:36:44 +03:00