Commit Graph

4941 Commits

Author SHA1 Message Date
Denis Zharkov ba506170e9 Use 'mapToCallableMethod' for delegateTo signature calculation
#KT-9707 Fixed
2016-01-21 11:24:23 +03:00
Valentin Kipyatkov 3a7ed33de1 KT-10747 "Incompatible stack heights" when compiling call to Java setter with non-void return type using property syntax
#KT-10747 Fixed
2016-01-21 10:48:47 +03:00
Michael Bogdanov 23480a5698 Supported inline of array convention simple cases; Fix for KT-9211: M13 an extension function that is inline, and for get(v) causes an exception when called using brackets
#KT-9211 Fixed
2016-01-20 17:33:50 +03:00
Denis Zharkov ede4b61980 Add tests for obsolete issue
#KT-7412 Obsolete
2016-01-20 14:27:53 +03:00
Denis Zharkov 06fbc9bdd3 Support reification of arrays containing reified parameters
#KT-10555 Fixed
2016-01-20 14:27:53 +03:00
Alexander Udalov 9620893fa4 Drop synthetic class kind Function, drop Metadata#xi 2016-01-19 18:39:59 +03:00
Alexander Udalov aef6d49b48 Drop isLocalClass, do not write KotlinLocalClass 2016-01-19 18:39:59 +03:00
Alexander Udalov e37bd4eba6 Do not write and read KotlinInterfaceDefaultImpls
This was only used in InlineTestUtil.kt and had no effect in the condition
2016-01-19 18:39:59 +03:00
Alexander Udalov 59dab0a558 Combine all metadata annotations into one kotlin/Metadata 2016-01-19 18:39:59 +03:00
Mikhail Glukhikh 9360bd49a6 Data flow info: correct disjunction of a type with Nothing: Type U Nothing = Type #KT-9578 Fixed 2016-01-19 16:01:10 +03:00
Mikhail Glukhikh e4f7446bec JvmSynthetic forbidden for delegated properties (and searched for different use-site targets) 2016-01-19 11:38:53 +03:00
Mikhail Glukhikh b78d481bb1 delegate use-site targeted annotations: parser, front-end, codegen with some tests #KT-10502 Fixed 2016-01-19 11:38:41 +03:00
Michael Bogdanov 7eec1d8e1d Skip inline lambdas in 'InlineCallSite' parameter calculation; Fix for KT-10679: Wrong outer after inline
#KT-10679 Fixed
2016-01-15 18:24:33 +03:00
Denis Zharkov be2f857670 Introduce inline-only functions
They have private visibility in bytecode
2016-01-15 09:46:30 +03:00
Denis Zharkov 23d2b87a52 Ignore redundant projections for declaration-site variance 2016-01-14 19:20:00 +03:00
Michael Bogdanov 607f32615f Type uncapturing 2016-01-14 15:32:50 +03:00
Denis Zharkov b8c79e689b Make all nested inlined closure classes public
#KT-6987 Fixed
2016-01-13 19:41:59 +03:00
Michael Bogdanov 66ab1c484c StackOverflow fix on type remapping 2016-01-13 16:57:36 +03:00
Michael Bogdanov 657b9ff808 Write enclosing method info for transformed objects 2016-01-12 15:51:57 +03:00
Michael Bogdanov fee6d4f282 Type parameters mapping
#KT-10429 Fixed
2016-01-12 15:51:56 +03:00
Michael Bogdanov 0274ce4619 Always generate ACC_SUPER flag for all classes; Fix for KT-10260: java.lang.VerifyError in Android 4.x when Instant Run is used
#KT-10260 Fixed
2016-01-11 09:55:56 +03:00
Dmitry Petrov b736880787 KT-6646, KT-10482:
when a method (or a property getter) returns Nothing, emit
  ACONST_NULL
  ATHROW
after a call so that class files verifier knows that this is an exit point in a method.
Note that if an inline method returning Nothing throws an exception explicitly
(or via a chain of inline methods), this code will be deleted by DCE.
2015-12-31 11:07:56 +03:00
Michael Bogdanov e116cc3206 Private visibility for non-const, non-jvmField class companion property backing field 2015-12-29 16:45:22 +03:00
Michael Bogdanov 85ae0cb78e Restrict companion properties copying to interface by const 2015-12-29 16:45:22 +03:00
Alexander Udalov 890c961383 Fix reflection internal error on enum nested classes query
#KT-10520 Fixed
2015-12-28 16:40:34 +03:00
Denis Zharkov 58caff3411 Minor. Add tests checking not-null assertions
More precisely these tests check cases when expected type
was somehow obtained from captured type (in member scope with projections)
2015-12-28 07:44:56 +03:00
Mikhail Glukhikh 7d6ccc40c2 Implicit exhaustive whens now have exception in else branch #KT-8700 Fixed 2015-12-26 10:46:39 +03:00
Alexander Udalov 75f046fa81 Drop Throwable#printStackTrace, make it a JVM-specific extension 2015-12-25 20:16:18 +03:00
Michael Bogdanov f870e365fa Removed accessors for const properties 2015-12-25 11:28:10 +03:00
Michael Bogdanov b4db23a7b3 Removed 'INSTANCE' field from companions 2015-12-24 13:59:45 +03:00
Michael Bogdanov 2e73559f33 Removed 'INSTANCE$' field generation 2015-12-24 13:59:44 +03:00
Michael Bogdanov aeb6486473 Deprecated 'INSTANCE$' replaced with 'INSTANCE' 2015-12-24 13:59:43 +03:00
Ilya Gorbunov de11ed4fc6 Primitive Companion objects do not longer implement IntegerConstants and FloatingPointConstants. All declarations moved inside companions.
IntegerConstants and FloatingPointConstants are dropped.
#KT-8897 Fixed
2015-12-24 06:17:03 +03:00
Mikhail Glukhikh 99a32b93fb Implemented missed checks for local functions #KT-10449 Fixed
Relevant code/test fixes
2015-12-23 18:22:32 +03:00
Mikhail Glukhikh ebda21c68a Codegen tests for lateinit var with private setter 2015-12-23 18:02:07 +03:00
Sergey Mashkov e25d31618c Fix tests 2015-12-18 22:16:04 +03:00
Ilya Gorbunov 03816373b3 Primitive array constructor-like functions with init lambda.
#KT-8831

Update testData and resolve ambiguity in newArray test
2015-12-18 17:54:09 +03:00
Mikhail Glukhikh 3fb04aceb9 Check backing field availability for AnnotationTarget.FIELD #KT-10387 Fixed
Some duplicated checks deleted (UseSiteTargetChecker / JvmFieldApplicabilityChecker)
2015-12-17 15:06:58 +03:00
Michael Bogdanov ca9e8fc5a7 Fix for KT-5910: Can't call Throwable() in Kotlin
#KT-5910 Fixed
2015-12-17 14:09:15 +03:00
Michael Bogdanov 9cad1a912a Choose proper context for accessor generation: skip inline ones; Fix for KT-6102: Bypass synthetic accessor when inlining lambda which calls private member
#KT-6102 Fixed
2015-12-17 09:51:41 +03:00
Michael Bogdanov b0a7706812 Test for obsolete KT-5445: Bad access to protected data in getfield
#KT-5445 Obsolete
2015-12-17 09:50:39 +03:00
Alexander Udalov dc84445e2e Inherit KProperty interfaces from function types
To be able to write the following: listOfStrings.map(String::length)
2015-12-16 19:48:28 +03:00
Mikhail Glukhikh f25f0db10e Fixed long / double / float value merge in OptimizationBasicInterpreter #KT-7401 Fixed 2015-12-16 17:45:38 +03:00
Denis Zharkov 7756644eb1 Introduce KClass<T>.javaPrimitiveType and KClass<T>.javaObjectType
#KT-6319 Fixed
2015-12-15 16:18:31 +03:00
Denis Zharkov 154657a374 Fix wildcards for invariant arguments
See test with Java, we want preserve the invariant that if return type and
value parameter types are same in Kotlin, than we can use such return-value
as argument for that parameter
2015-12-15 16:18:31 +03:00
Denis Zharkov b4bb92d136 Fix overload resolution ambiguity for types intersection
There are two different forms of types intestion:
1. Type parameters with multiple bounds
2. Smart casts

The problem was that when member scope of type intersection contained
effective duplicates and that lead to overload resolution ambiguity in
strange cases like `x.hashCode()`

For first type we do effectively the same thing as when building member
scope for class extending several interfaces: group all descriptors by
both-way-overridability relation and then choose most-specific in each
group.

For smart casts we do basically the same thing but with special
treatments:
1. From all descriptors that _equal_ to most specific we choose
   the one that works without smartcast if possible (i.e. we choose first from candidates list)
2. If smart-cast value seems to be unstable we use only member scope
   of receiver type + all descriptors from smart cast possible types
   that has incompatible signature. If we'd include all of them and
   choose one as more specific, and it would lead to false
   SMART_CAST_IMPOSIBLE (see test unstableSmartCast.kt)

 #KT-3996 Fixed
 #KT-10315 Fixed
2015-12-15 16:18:31 +03:00
Mikhail Glukhikh 19084b8182 Additional codegen test for KT-10107 2015-12-14 12:52:43 +03:00
Ilya Gorbunov 59a9e2549c Fix tests: codegen, completion, decompiler consistency, quickdoc, intentions, navigation, reference resolver, quick fixes 2015-12-14 04:29:25 +03:00
Michael Bogdanov 7c7786f7d0 Generate private methods in TraitImpl as private, don't generate delegation to private trait methods 2015-12-12 11:41:36 +03:00
Michael Bogdanov a2d644f708 Fix for KT-9958: NoSuchMethodError when we call protected method from companion object
#KT-9958 Fixed
2015-12-12 11:41:35 +03:00