Commit Graph

85 Commits

Author SHA1 Message Date
Denis Zharkov d6ee774243 Load some of the TYPE_USE annotations in fast class reading mode
Only top-level types on fields, methods' return types and
value parameters are supported to catch-up how class-files are loaded
in IntelliJ (see IDEA-153093)

NB: this commit also affects
ForeignJava8AnnotationsNoAnnotationInClasspathWithFastClassReadingTestGenerated
that were failing before

 #KT-20016 Fixed
2017-09-26 16:40:47 +03:00
Denis Zharkov fd9025a4fb Add Java8 foreign-annotations tests without jsr305.jar in the classpath
Some of them are expected to fail since neither IntelliJ class reading
nor our fast class reading can read annotations on type arguments
2017-09-26 16:40:47 +03:00
Denis Zharkov 71f85812d6 Improve support for TYPE_USE default qualifiers
- Apply default qualifiers to type arguments if they contain TYPE_USE
in applicability list
- Read TYPE_USE placed default qualifier annotations

 #KT-19592 Fixed
 #KT-20016 In Progress
2017-09-26 16:40:47 +03:00
Denis Zharkov 02d3d9785c Move JSR-305 tests to one directory and strip common name prefix 2017-09-26 16:40:47 +03:00
Ilya Chernikov d61695be55 Fix embeddable compiler dependencies, fix dist task, use runtimeJar...
dependencies where appropriate, some helpers refactoring
2017-09-20 11:52:00 +02:00
Ilya Chernikov fd1b677904 Switch reflect to compiled core classes 2017-09-19 23:58:32 +02:00
Ilya Chernikov d039d191f2 Fix tests in the new build infrastructure 2017-09-19 23:58:30 +02:00
Alexander Podkhalyuzin 3f8170d369 Clean idea files generated on the gradle import, add them to .gitignore 2017-09-19 23:58:27 +02:00
Ilya Chernikov deda50dbbb Continue switching projects to improved dsl: sourceSets and test running 2017-09-19 21:37:26 +02:00
Ilya Chernikov 513ab08edd Refactor and clean preloader project 2017-09-19 21:37:16 +02:00
Ilya Chernikov 61dfb75e0e Implement Gradle Kotlin DSL build 2017-09-19 21:37:06 +02:00
baratynskiy 67fdd9f76e javac-wrapper: fixes after rebase and review 2017-08-29 18:01:36 +03:00
baratynskiy 01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
Alexander Udalov 770441c212 Merge "diagnostic with Java 8" tests with general diagnostic tests 2017-08-17 13:15:18 +03:00
Alexander Udalov 7601666ec0 Minor, remove unused AbstractDiagnosticsWithFullJdkTest 2017-08-17 12:35:55 +03:00
Denis Zharkov e26c210d69 Support TypeQualifierDefault from JSR 305 for nullability qualifiers
#KT-10942 Fixed
2017-07-03 17:55:37 +03:00
Mikhael Bogdanov 69457ef3f1 Generate optimized hashCode for primitive type with jvmTarget 1.8+
#KT-7571 Fixed
2017-06-28 13:44:07 +02:00
Denis Zharkov c970763a7f Fix callable reference resolution regression
The regression appeared after
b5a8ffaddc
when we started trying both static and member methods until
first success and when there is no successful
we were just leaving the last one (e.g. private member)

But the actual problem is that we were commiting the trace
in case of single (but incorrect) result in resolution mode of
SHAPE_FUNCTION_ARGUMENTS when we couldn't yet choose the
correct static method

Also we shouldn't choose a shape for callable reference
using only the knowledge that result is single:
it may lead to the wrong inference result
(see test with Pattern::compile)

 #KT-17597 Fixed
2017-04-27 18:38:10 +03:00
Mikhael Bogdanov 496a21254b Black box update 2017-03-20 18:46:01 +01:00
Mikhael Bogdanov ff9fe85507 Fix for KT-16614: Report inability to inline 1.8 bytecode into 1.6 bytecode as an error, no as an exception 2017-03-06 15:15:22 +01:00
Mikhael Bogdanov a03ed6f742 Fix for KT-16581: VerifyError when calling default value parameter with jvm-target 1.8
#KT-16581 Fixed
2017-03-03 11:21:42 +01:00
Ilya Chernikov 1032f0d39c Fix java 8 repl tests 2017-02-24 16:58:24 +01:00
Denis Zharkov f2aacf774e Get rid of redundant not-null assertion for parameter
The problem was that in `Function<T>.apply(T)` T is now not-platform,
so when checking if not-null assertion is needed for parameter in SAM,
it's defined by the upper bounds of T that is a platform (Any..Any?),
and while it's definitely not marked as nullable it's still nullable
in a sense that it can contain null as a value.

So the solution is obvious

 #KT-16413 Fixed
2017-02-20 15:46:49 +03:00
Denis Zharkov 1bb40afada Simplify compatibility mode with ll=1.0 on JDK dependent built-ins
A lot of problem arise with current solution
(loading them with lowpriority annotation + additional call checkers):
- We errorneously treated ArrayList.stream as an existing method, while
  it's just a fake override from List
- The same problem arises when creating a class delegating to List.
  Also the latter case is failing with codegen internal error
  (see issue KT-16171)

The negative side of this solution is that instead of reporting meaningful
diagnostic, there will be UNRESOLVED_REFERENCE.
But it seems to be better than having strange problems like ones described above.

 #KT-16073 Fixed
 #KT-16171 Fixed
2017-02-08 16:04:19 +03:00
Ilya Chernikov f6ce74edb3 Set jvmTarget property for repl compilation from sys prop or java version, fixes KT-16126
(cherry picked from commit 4cf2bce)
2017-02-07 13:45:12 +01:00
Mikhael Bogdanov 25d75bcd8b Delegates to java defaults methods in compatibility mode 2017-01-26 14:32:33 +01:00
Mikhael Bogdanov fc4be17623 Fix for KT-14966: Regression: VerifyError on access super implementation from delegate
#KT-14966 Fixed
2017-01-25 15:56:55 +01:00
Mikhael Bogdanov 11578c602e Added inline tests for jvm 8 target 2017-01-25 15:56:55 +01:00
Denis Zharkov 2edcd369a8 Fix inference issue with Stream.collect
See doNotCaptureSupertype test for clarification:
When resolving b.collect(toList()) we're building a common system with
two variables T and R.

The problem was that when introducing the constraint
C<T, Inv<T>> <: C<in String, R> we then were seeing the constraint
T <= in String, and add the constaint T=Captured(in String)

That lead to R=Inv<T>=Inv<Captured(in String)>, and after approximation
R=Inv<in String>, that is not the desirable result (Inv<String> suits here)

But the root problem was that we add captured constaint when projection was from supertype,
that seems to be wrong, and for example Java doesn't do that in the similar situation.

 #KT-11259 Fixed
2017-01-22 13:29:08 +03:00
Mikhael Bogdanov da1b8a02ed Exclude builtins members mapped to java default methods from delegation 2017-01-20 13:16:58 +01:00
Denis Zharkov 4ab6b6954d Fix false positive "Null can not be a value of a non-null type"
Inferred type of receiver of orElse  is Optional<T & Any>
Generic descriptor is orElse(E!): E!
Substituted descriptor is orElse(T): T , and that is the problem.

Seems that E!  => (T & Any)!  gets expanded to just T  or T & Any , however it should be expanded to
(T & Any) .. (T & Any)?  => T & Any .. T & Any

T & Any is NotNullTypeParameter(T)

The problem is that (T & Any)?  is expanded to T & Any,
that is seems to be wrong.

 #KT-15236 Fixed
2017-01-19 10:20:35 +03:00
Mikhael Bogdanov 591de36666 Added deprecated diagnostic for invoking default methods within jvm-target 1.6 2017-01-18 10:50:59 +01:00
Mikhael Bogdanov 09eeb414fe New test for jvm8 nondefaults target 2017-01-13 13:52:57 +01:00
Mikhael Bogdanov d278a5c6d5 Move java 8+defaults tests to separate folder 2017-01-13 13:52:57 +01:00
Mikhael Bogdanov 0a363fd1a5 Introduced test flag: JVM8_TARGET_WITH_DEFAULTS 2017-01-13 13:52:56 +01:00
Mikhael Bogdanov 7f8acbb759 Use proper flag for interface method invocation 2017-01-13 13:52:55 +01:00
Mikhail Zarechenskiy 6cccad9647 Update year in license and regenerate tests 2017-01-10 12:01:17 +03:00
Mikhael Bogdanov f1c1fcf0fc Fix for KT-11969: ProGuard issue with private interface methods
#KT-11969 Fixed
2016-12-27 14:07:37 +01:00
Dmitry Petrov 8d16bd1215 Method can be hidden if it is annotated with kotlin.internal.PlatformDependent,
or is a Java method from a Kotlin built-in class (transitively).

https://github.com/Kotlin/KEEP/blob/master/proposals/jdk-dependent-built-ins.md#backward-compatibility-of-overrides
2016-12-23 13:51:08 +03:00
Denis Zharkov 2dd7d89048 Fix built-ins overridability issue
See the comment for clarification

 #KT-15097 Fixed
2016-12-20 16:35:26 +03:00
Mikhael Bogdanov 268d55104c Don't generate delegation to java default methods
#KT-15226  Fixed
2016-12-14 11:20:04 +01:00
Ilya Gorbunov c66b3b8ef9 Nullability for java.lang.ref.Reference.get 2016-12-08 20:22:17 +03:00
Ilya Gorbunov 84a7e3c032 Add tests for enhanced java signatures based on AbstractResolvedCallsTest.
Refactor AbstractResolvedCallsTest to support multiple carets (multiple methods being tested  for resolve) in testdata file.
2016-12-08 20:22:17 +03:00
Mikhael Bogdanov 61da8be260 Generate parameters metadata for java 8 reflection 2016-11-14 14:27:08 +01:00
Dmitry Jemerov 978b70e50b Add test for KT-14751 2016-11-11 18:15:24 +01:00
Zalim Bashorov 1dedb38481 Regenerate tests 2016-11-09 21:41:12 +03:00
Alexander Udalov 8a5c8da757 Simplify module configuration and built-ins dependency in some tests
- In tests on built-ins with no sources, just call
  JvmResolve.analyze(environment) and inspect the resulting module
- In AbstractLocalClassProtoTest, create container via
  TDAForJVM.createContainer
- Inline single module container creation into AbstractDiagnosticsTest
2016-10-26 16:31:04 +03:00
Alexander Udalov 4c52ce37d2 Drop TargetPlatform in utilities for module creation 2016-10-21 17:10:40 +03:00
Michael Bogdanov 5bd045c79c Fix for KT-14243: Wrong invocation descriptor on calling implicitly generated implementation in class
#KT-14243 Fixed
2016-10-10 14:17:50 +03:00
Michael Bogdanov 95a1c254e1 Added error diagnostic on inheriting target 6 interface 2016-10-03 14:13:17 +03:00