Commit Graph

16 Commits

Author SHA1 Message Date
Dmitry Gridin 50506658c0 fix some tests for as36 2020-05-08 19:13:28 +07:00
Dmitry Gridin 11a3482970 tests: apply official code style
#KT-38632 Fixed
2020-05-07 12:36:44 +00:00
Dmitry Gridin c34b417d0c Fix tests after disabling trailing comma
#KT-34744
2020-02-04 21:34:53 +07:00
Dmitry Gridin d06787886a Fix tests after implementing trailing comma in formatter
#KT-34744
2020-01-17 21:02:54 +07:00
Ilya Kirillov b411e8e18e New J2K: Split old j2k and new j2k tests 2019-04-03 11:24:19 +03:00
Ilya Kirillov b13f7431f2 New J2K: Fix existing test data 2019-04-03 11:24:13 +03:00
Ilya Kirillov f752796408 New J2K: Fix existing test data 2019-04-03 11:21:19 +03:00
Denis Grachev 0722c5c13a KT-19565: J2K: Determine mutability using iterator
#KT-19565 fixed
2017-09-18 14:07:57 +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
Valentin Kipyatkov dc909ac166 J2K: coversion of specially mapped built-in methods + replacing "get" with "[]" where possible 2015-10-19 09:43:11 +03:00
Valentin Kipyatkov 0cc2158ec1 J2K: do not produce redundant "internal" words for members in an internal class 2015-09-18 15:44:19 +03:00
Valentin Kipyatkov c3ddd5d32b J2K: adapted for default visibility modifier 'public' 2015-09-18 15:44:18 +03:00
Valentin Kipyatkov fefb828fae J2K: preserving line breaks between parameters 2015-07-06 16:48:50 +03:00
Valentin Kipyatkov c66b20b204 KT-6795 J2K: When converting to type with projections, omit redundant use-site projections
#KT-6795 Fixed
2015-03-31 16:10:24 +03:00
Valentin Kipyatkov 108a1f872c J2K: use of new syntax for class intialization blocks 2015-03-31 16:10:21 +03:00
Alexander Udalov 3c859caf2b j2k: flatten test cases and testData directory structure
Move j2k/test/tests -> j2k/tests, j2k/test/testData -> j2k/testData
2015-01-03 00:52:59 +03:00