Commit Graph

664 Commits

Author SHA1 Message Date
Nikolay Krasko 47c7181f2a Extract tests-common module without any actual tests
The main reasoning for the module is to avoid running any compiler tests while executing run configuration that searches tests across module dependencies.
2016-04-08 17:40:38 +03:00
Nikolay Krasko ef13e8f5bb Prepare building plugins modules against 1.8 JDK 2016-04-05 00:39:46 +03:00
Denis Zharkov 1bc45fb9cf Adjust J2K to latest protected visibility fixes 2016-03-31 14:51:57 +03:00
Pavel V. Talanov f40a04c5a2 Refactor light elements
KtLightElement#delegate -> clsDelegate, KtLightElement#origin -> kotlinOrigin and make them properties
KtLightClassForDecompiledDeclaration stores KtClsFile
KtLightField stores LightMemberOrigin
2016-03-30 21:35:22 +03:00
Natalia Ukhorskaya 68907d05c3 J2K produces unresolved 'toArray' calls for java Collection#toArray(T[])
#KT-11600 Fixed
2016-03-29 11:26:18 +03:00
Alexander Udalov e915e1548c Fix multiple 'unresolved java classifier' errors
Use the same component (NotFoundClasses) as in loading of compiled Kotlin
symbols.

Some tests were changed to avoid a diagnostic that is now reported when a
non-found class is encountered in a signature (e.g. staticMethod.1.java where
JDK seems to be not configured)

 #KT-10493 Fixed
 #KT-10820 Fixed
 #KT-11368 Fixed
2016-03-28 14:13:59 +03:00
Natalia Ukhorskaya 470027bfd8 J2K: specify type for variables with anonymous type if they have write accesses 2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya 23908fb8f3 J2K produces unresolved 'toArray' calls for java Collection#toArray()
#KT-11600 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya 79bac598bf J2K breaks code if applied to a java class with static field which is accessed from another java class
#KT-11587 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya c7ae9981cb J2K: Quote '$' symbols in converted strings
#KT-6800 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya 4bc4f0bce7 J2K: not initialized field of non-primitive type should have null initializer
#KT-11544 Fixed
2016-03-25 20:27:19 +03:00
Natalia Ukhorskaya 8616c9588d J2K, minor: pass nullability as additional parameter for more flexibility 2016-03-25 20:27:19 +03:00
Nikolay Krasko 2db888a646 Accurate work with adding/removing context of tests.
Need this because of KEEP_FIRST_COLUMN_COMMENT setting. Comments accidentally left on first
collumn cause the bad formatting.

 #KT-4175 Fixed
2016-03-16 12:38:24 +03:00
Nikolay Krasko 085deec717 Make J2K pay more attention to original formatting of comments. Better support for KEEP_FIRST_COLUMN_COMMENT
#KT-4175 In Progress
2016-03-16 12:38:20 +03:00
Natalia Ukhorskaya b50f2dc6e5 J2K: Use parameters nullability for method call 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya c928237699 J2K: drop line breaks in some polyadic expressions 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya f1b6bf7817 J2K: convert comments inside qualified expression correctly 2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya 405b0b1df6 J2K: convert annotations in annotations parameters correctly
#KT-11126 Fixed
2016-03-11 12:08:10 +03:00
Natalia Ukhorskaya 7d594970ff J2K: convert protected member used outside of inheritors as public 2016-03-11 12:08:10 +03:00
Pavel V. Talanov a4c005fefd Update existing test data depending on diagnostic parameter rendering 2016-02-26 14:45:11 +03:00
Alexander Udalov 1a5a077bd6 Replace map + filterNotNull -> mapNotNull in project 2016-02-20 19:05:30 +03:00
Stanislav Erokhin 341b251e4d Update copyright in generated tests. 2016-02-16 18:59:10 +03:00
Ilya Gorbunov 78b7fb15f3 J2K, expected errors: for each argument of removed overloads 2016-02-09 02:58:09 +03:00
Ilya Gorbunov 805410bb19 J2K: Remove special conversion for String.format. 2016-02-03 17:14:02 +03:00
Ilya Gorbunov 744a7a83f7 Cleanup RC deprecations in compiler and plugin. 2016-01-27 18:34:30 +03:00
Natalia Ukhorskaya 9d66852ae2 J2K: convert method references according to special methods 2016-01-25 15:02:48 +03:00
Ilya Gorbunov 31ec7bcbea Deprecate String.concat with error severity.
Fix concat j2k conversion.
Add expected deprecation errors for Java String constructors that must be converted to special Kotlin String methods.
2016-01-22 05:54:38 +03:00
Ilya Gorbunov f4822cd757 Fix testData in compiler: add collections and ranges package to fq-names. 2016-01-22 05:54:38 +03:00
Ilya Gorbunov 83ef48d0ac Refer to builtin names in HeuristicSignatures and j2k TypeVisitor 2016-01-22 05:54:38 +03:00
Yan Zhulanow 4cd2ff040d J2K: convert hex Java literal to hex Kotlin literal 2016-01-19 23:29:58 +09:00
Valentin Kipyatkov 552359ce03 KT-7443 Inspection + intention to replace assert (x != null) with "!!" or elvis
#KT-7443 Fixed
2016-01-18 15:34:20 +03:00
Ilya Gorbunov ddcafdd9b3 J2K: Avoid to convert to deprecated String methods, namely toByteArray. 2016-01-14 18:30:44 +03:00
Natalia Ukhorskaya 128440b16f Use intention to simplify for in j2k
#KT-7157 Fixed
2016-01-14 13:41:54 +03:00
Dmitry Jemerov 6684dff14b j2k: cleanup 'public', property access syntax 2016-01-07 18:13:10 +01:00
Natalia Ukhorskaya 0a6dbc91ae Fix EA-75128 - KNPE: IdentifierKt.declarationIdentifier 2015-12-30 14:49:29 +03:00
Ilya Gorbunov fcfb063eca Cleanup in modules: j2k, jps, ant and generators. 2015-12-29 18:04:18 +03:00
Natalia Ukhorskaya 513c4a4562 J2K: transform loops with double, float and char range with while
#KT-899 Fixed
2015-12-18 16:14:17 +03:00
Natalia Ukhorskaya ecdef71580 J2K: cast right operand of equals for primitive types to left operand type
#KT-9997 Fixed
2015-12-18 16:14:16 +03:00
Natalia Ukhorskaya 1d787ed222 J2K: Insert initializer type for properties with primitive type if necessary 2015-12-18 16:14:15 +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
Natalia Ukhorskaya 5e231db631 J2K: convert method from Map (Java8) with cast to java.util.Map
#KT-10400 Fixed
2015-12-17 11:11:21 +03:00
Natalia Ukhorskaya 3f7b8554dd J2K: parenthesize receiver if needed
#KT-10121 Fixed
2015-12-17 11:11:20 +03:00
Natalia Ukhorskaya f3a6c541ec J2K: Convert usages of kotlin functions from library correctly
#KT-6115 Fixed
2015-12-17 11:11:18 +03:00
Natalia Ukhorskaya c79ffbac5c Run code cleanup on j2k module 2015-12-17 11:11:16 +03:00
Natalia Ukhorskaya 68101eeffa J2K: do not drop formatting for expressions with operator 2015-12-17 11:11:15 +03:00
Alexey Tsvetkov 199827635f Reserve 'typeof' as a keyword 2015-12-10 21:26:41 +03:00
Andrey Breslav 434082cadb 'yield' reserved as a keyword 2015-12-09 17:10:30 +03:00
Denis Zharkov 406e31f54a Change default rules for declaration-site wildcards
Mostly this commit is about skipping wildcards that are redundant in some sense.
The motivation is that they looks `long` in Java code.

There are basically two important parts: return types and value parameters.

1. For return types default behaviour is skipping all declaration-site wildcards.
The intuition behind this rule is simple: return types are basically used in subtype position
(as an argument for another call), and here everything works well in case of 'out'-variance.
For example we have 'Out<Out<T>>>' as subtype both for 'Out<Out<T>>>' and 'Out<? extends Out<? extends T>>>',
so values of such type is more flexible in contrast to `Out<? extends Out<? extends T>>>` that could be used only
for the second case.

But we have choosen to treat `in`-variance in a different way: argument itself
should be rendered without wildcard while nested arguments are rendered by the rules
described further (see second part).

For example: 'In<Out<OpenClass>>' will have generic signature 'In<Out<? extends OpenClass>>'.
If we omit all wildcards here, then value of type 'In<Out<OpenClass>>'
will be impossible to use as argument for function expecting 'In<? super Out<? extends Derived>>'
where Derived <: OpenClass (you can check it manually :]).

And this exception should not be very inconvinient because in-variance is rather rare.

2. For value parameters we decided to skip wildcards if it doesn't make obtained signature weaker
in a sense of set of acceptable arguments.

More precisely:
    a. We write wildcard for 'Out<T>' iff T ``can have subtypes ignoring nullability''
    b. We write wildcard for 'In<T>' iff T is not equal to it's class upper bound (ignoring nullability again)

Definition of ``can have subtypes ignoring nullability'' is straightforward and you can see it in commit.

 #KT-9801 Fixed
 #KT-9890 Fixed
2015-12-01 08:20:59 +03:00
Andrey Breslav 8544a5ab5f Remove "This" keyword 2015-11-30 19:36:33 +03:00
Yan Zhulanow a3ff3ffc45 Fix tests: "Placing function type parameters after the function name" error 2015-11-27 15:51:11 +03:00