Commit Graph

585 Commits

Author SHA1 Message Date
Andrey Breslav 8ff5cf62cc Generate annotations from descriptors, not PSI 2014-12-23 15:18:46 +03:00
Natalia Ukhorskaya 8896aa93b4 Fix NPE in ReferenceVariantsHelper
#KT-6500 Fixed
2014-12-23 14:40:27 +03:00
Valentin Kipyatkov 311a3a75c8 Code completion: do not list instance members from context with no instance
#KT-6388 Fixed
 #KT-4422 Fixed
 #KT-5516 Fixed
2014-12-22 18:26:03 +03:00
Svetlana Isakova 6489ff2cb6 Ignore constraint from implicit 'in Nothing'
From Array<T> <: Array<out Int> we may generate T >: Nothing (implicit) and T <: Int (explicit).
Without ignoring we'll infer 'Nothing' for T too often
2014-12-22 12:04:42 +03:00
Pavel V. Talanov 9e784e7018 Minor: Add some utils to KotlinBuiltIns 2014-12-21 14:23:21 +03:00
Alexander Udalov 6793464cd0 Drop obsolete code in built-in serialization 2014-12-19 14:41:51 +03:00
Valentin Kipyatkov 6ec10b9b6b Correct completion of nested/inner classes after dot
#KT-1889 Fixed
2014-12-18 15:48:27 +03:00
Valentin Kipyatkov cb5c12cda3 Completion of object's in type position - they can be used there 2014-12-18 15:47:59 +03:00
Valentin Kipyatkov 191d3e2766 Corrected usages of isNullableType/isMarkedNullable 2014-12-18 15:47:58 +03:00
Andrey Breslav f9fea88749 PlatformStaticGenerator reworked to use FunctionCodegen.generateMethod() 2014-12-16 16:23:35 +03:00
Svetlana Isakova b0889f0760 Minor: fixed toString 2014-12-16 14:41:56 +03:00
Svetlana Isakova bda5bab057 Captured type might be substituted in an opposite projection
out Captured (in Int) = out Int
 in Captured (out Int) = in Int
2014-12-16 14:41:56 +03:00
Svetlana Isakova a589323eaf Rename: TypeCheckerTypingConstraints -> TypeCheckerProcedureCallbacks 2014-12-12 23:08:29 +03:00
Svetlana Isakova 239b9a96a0 Temporary hack to compile 'kotlin' 2014-12-12 23:08:29 +03:00
Svetlana Isakova 1f6f607f40 Type variable with non-trivial upper bound cannot capture 'in' projection 2014-12-12 23:08:29 +03:00
Svetlana Isakova 8b0707b15d Throw error for conflict in variances to combine 2014-12-12 23:08:29 +03:00
Svetlana Isakova c097e6ee3e After approximation interpret Contr<*> as Contr<Nothing>
not Contr<out Any?>
2014-12-12 23:08:29 +03:00
Svetlana Isakova 14a53a105b Fixed 'subtype' for captured type 2014-12-12 23:08:29 +03:00
Svetlana Isakova 0149e8048c Capture notnullable type if type variable is nullable 2014-12-12 23:08:29 +03:00
Svetlana Isakova 5b4f10e698 Made vararg parameters have Array<out T> type
instead of simply Array<T>
  #KT-1638 Fixed
  #KT-2163 Fixed
  #KT-3213 Fixed
  #KT-4172 Fixed
  #KT-5534 Fixed
2014-12-12 23:08:28 +03:00
Svetlana Isakova a3e949674f Preserve nullability while substituting captured types 2014-12-12 23:08:28 +03:00
Svetlana Isakova 070dba69fa Don't add a constraint T <: DONT_CARE from upper bounds 2014-12-12 23:08:27 +03:00
Svetlana Isakova f9d4a68c6e KT-6320 AssertionError in ConstraintSystem(The constraint shouldn't contain different type variables on both sides: Y <: X)
#KT-6320 Fixed
2014-12-12 23:08:27 +03:00
Svetlana Isakova b098220d03 Refactoring: made code in 'processDeclaredBoundConstraints' more kotlin 2014-12-12 23:08:27 +03:00
Svetlana Isakova 1fb713342b Capture types only on the top level 2014-12-12 23:08:27 +03:00
Svetlana Isakova cd359a046c Added captured types and approximation
CapturedType captures type projection while solving the constraint system.
During the substitution type containing captured types is approximated
to get rid of captured types and (for simple cases) replace them with corresponding type projections.

Note that Array<Array< CapturedType(out Int) >> is (over)approximated by Array<out<Array<out Int>>

See 'Mixed-site variance' by Ross Tate for details.

 #KT-2570 Fixed
 #KT-2872 Fixed
 #KT-3213 Fixed
2014-12-12 23:08:27 +03:00
Svetlana Isakova 4df8c250ab Fixes after merge
Added platform types fixes to rewritten to kotlin files
2014-12-12 23:08:26 +03:00
Svetlana Isakova 26a54aa95d Small refactoring in ConstraintSystemImpl
Extracted isMyTypeVariable, getMyTypeVariable
2014-12-12 23:08:26 +03:00
Svetlana Isakova a2fa38a7f9 Rewritten ConstraintPosition to Kotlin
Added ConstraintPositionKind
 (to be able to use enum constants from Java code)
2014-12-12 23:08:26 +03:00
Svetlana Isakova 578f6d4811 Converted ConstraintSystem to Kotlin 2014-12-12 23:08:26 +03:00
Svetlana Isakova 38d38e14c8 Changed file extension to '.kt'
to preserve file history
2014-12-12 23:08:26 +03:00
Denis Zharkov b86e19782c Moved containsReifiedTypeParameters to DescriptorUtils 2014-12-11 16:04:02 +03:00
Stanislav Erokhin f9afdf7540 Use Visibilities.isVisible with ReceiverValue. 2014-12-08 18:24:30 +03:00
Stanislav Erokhin fc8cec9509 Create PRIVATE_TO_THIS visibility 2014-12-08 18:24:30 +03:00
Valentin Kipyatkov b8d1f115bf Renamed JetType.isNullable() to isMarkedNullable() 2014-12-03 21:36:10 +03:00
Valentin Kipyatkov 856be73500 Smart completion: generic functions are correctly included into the list
#KT-6375 Fixed
2014-12-03 19:07:04 +03:00
Alexander Udalov 63bfa004fd Introduce binary representation for annotations
Will be used where annotations can't be stored elsewhere: for example,
built-ins, JS, type annotations on JDK<8
2014-12-03 16:10:19 +03:00
Alexander Udalov 9a86318908 Introduce extension for built-ins serialization, drop .kotlin_class_names 2014-12-03 15:58:14 +03:00
Alexander Udalov f19aa2290c Minor, remove unnecessary NOTHING_TO_INLINE suppressions 2014-12-03 15:58:13 +03:00
Alexander Udalov 9bd815126b Rename NameTable -> StringTable in serialization
Since almost the beginning, it was also used to store arbitrary strings, not
just names
2014-12-03 15:58:13 +03:00
Alexander Udalov 66774c0fd1 Remove utility method from AnnotationDescriptor interface 2014-12-03 15:58:12 +03:00
Andrey Breslav fda7f63957 isBoolean() moved to KotlinBuiltIns 2014-12-03 15:39:16 +03:00
Andrey Breslav 80a32ee875 ModuleDescriptor knows its built-ins 2014-12-03 15:39:15 +03:00
Andrey Breslav c21dd366e0 Checks for primitive types and arrays made static in KotlinBuiltIns 2014-12-03 15:39:11 +03:00
Andrey Breslav b275b363c9 is<Annotation>() made static in KotlinBuiltIns 2014-12-03 15:39:11 +03:00
Andrey Breslav db635c0e44 is<TYPE>() made static in KotlinBuiltIns 2014-12-03 15:39:10 +03:00
Andrey Breslav 7a41e37655 isNothing() made static 2014-12-03 15:39:10 +03:00
Andrey Breslav ea4f0ab214 Methods in KotlinBuiltIns made static where already possible 2014-12-03 15:39:09 +03:00
Stanislav Erokhin 99ec8952e1 Temporary hack for KT-6320 2014-12-02 18:09:01 +03:00
Stanislav Erokhin b55114055e Change usage "v == Visibilities.PRIVATE" to Visibilities.isPrivate(v) 2014-12-02 14:30:17 +03:00