mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-16 00:21:28 +00:00
Compare commits
826 Commits
master-pus
...
rr/selezne
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3614bdce27 | ||
|
|
8d894929ae | ||
|
|
8a6cdcba29 | ||
|
|
493c287bb0 | ||
|
|
265873becd | ||
|
|
be06c51aa7 | ||
|
|
cba671a3ef | ||
|
|
cc0a787735 | ||
|
|
f7031e65ba | ||
|
|
7872b21914 | ||
|
|
4a803e9d2f | ||
|
|
4027dae594 | ||
|
|
be371c9294 | ||
|
|
be8374a1a8 | ||
|
|
e708e3f1c5 | ||
|
|
300e9581de | ||
|
|
dd20b9062a | ||
|
|
65d3ae6253 | ||
|
|
d3a34a8898 | ||
|
|
241f82c70f | ||
|
|
3f06f8a6ba | ||
|
|
517c3e1020 | ||
|
|
ca5eb40fa5 | ||
|
|
174576af61 | ||
|
|
132960a695 | ||
|
|
b1ce21bc55 | ||
|
|
291d62f653 | ||
|
|
44d283eb07 | ||
|
|
be4dbf2dcd | ||
|
|
29d0e3dbb5 | ||
|
|
1272162a7f | ||
|
|
bb8f857809 | ||
|
|
e5b0498eb6 | ||
|
|
ae0bedd2ac | ||
|
|
38ec3ffb4a | ||
|
|
bf1b85343f | ||
|
|
2d60d2c0e6 | ||
|
|
af367b01ec | ||
|
|
cb60b9e59c | ||
|
|
01ec8b5262 | ||
|
|
0d606e1346 | ||
|
|
4c5cd44e75 | ||
|
|
29e37ee15f | ||
|
|
a866e51402 | ||
|
|
95f6669275 | ||
|
|
6866fdc3e1 | ||
|
|
4de31da0f3 | ||
|
|
e8dfc4dcd0 | ||
|
|
b4334a3a3b | ||
|
|
e1abaa9b51 | ||
|
|
85f692ab40 | ||
|
|
c076d81f0c | ||
|
|
1ef17c6f3a | ||
|
|
710659324c | ||
|
|
95cc35f22e | ||
|
|
0c094b1719 | ||
|
|
67090e1afb | ||
|
|
ee26fd4959 | ||
|
|
41bd013796 | ||
|
|
037ff2fa52 | ||
|
|
f1c68a9080 | ||
|
|
240311d9c7 | ||
|
|
d93885e71c | ||
|
|
e84339a0d3 | ||
|
|
edab3e3ba9 | ||
|
|
c4b4912a71 | ||
|
|
cb15570d75 | ||
|
|
d36d62e226 | ||
|
|
a4457ba7ac | ||
|
|
58ee95c8a3 | ||
|
|
036c359993 | ||
|
|
d9fbaadb2e | ||
|
|
d7a0dbfae8 | ||
|
|
a0154b9851 | ||
|
|
e3f42721e9 | ||
|
|
df5f38fec8 | ||
|
|
7db0bf8195 | ||
|
|
8b9fb6a6cd | ||
|
|
3c01a39846 | ||
|
|
d77d733244 | ||
|
|
9a119a6757 | ||
|
|
def47bdd9d | ||
|
|
d23e9940ec | ||
|
|
708c8b8ef3 | ||
|
|
8c4930da2e | ||
|
|
bb20e4759b | ||
|
|
2b0639d4ad | ||
|
|
fb946a6a3f | ||
|
|
751ed60e42 | ||
|
|
a8ff5d17dc | ||
|
|
a988234bbf | ||
|
|
eecb43d4c9 | ||
|
|
bace1b8055 | ||
|
|
d62a6a2631 | ||
|
|
71730696b2 | ||
|
|
c7f9dc1c40 | ||
|
|
cf884fb048 | ||
|
|
6907decd99 | ||
|
|
221d49a995 | ||
|
|
2e31f95554 | ||
|
|
2b9606becf | ||
|
|
7be9b18ff4 | ||
|
|
6bc44a366a | ||
|
|
bae6037f00 | ||
|
|
fa75518bd7 | ||
|
|
d30c67db14 | ||
|
|
b0ac046b05 | ||
|
|
081248f859 | ||
|
|
4917643583 | ||
|
|
61b5a738da | ||
|
|
e776444459 | ||
|
|
f7beea10a5 | ||
|
|
814bd48148 | ||
|
|
236dfe60f1 | ||
|
|
94ff457e43 | ||
|
|
c94d583e2e | ||
|
|
cf555ef2b6 | ||
|
|
07e12f98b5 | ||
|
|
cedd1c133e | ||
|
|
1ce4eca3a6 | ||
|
|
1c622a5a3f | ||
|
|
1b78950ebb | ||
|
|
9e94189852 | ||
|
|
4083111dab | ||
|
|
a15d3c76b6 | ||
|
|
0c79de1a98 | ||
|
|
d8de37f665 | ||
|
|
bcf1954860 | ||
|
|
b43b238030 | ||
|
|
217428212f | ||
|
|
14766a3e1a | ||
|
|
e49f3b567b | ||
|
|
cd896ae6c8 | ||
|
|
dfc75f3447 | ||
|
|
fea1fb0fc3 | ||
|
|
376d3385d0 | ||
|
|
628b8b56b7 | ||
|
|
4e14f9500f | ||
|
|
e5e50eabe9 | ||
|
|
b351556b1f | ||
|
|
64aaeb52f5 | ||
|
|
a4a398239b | ||
|
|
c901e82a55 | ||
|
|
8e4bc06b3c | ||
|
|
77ba9a1bbb | ||
|
|
111a2ece72 | ||
|
|
11251a93ac | ||
|
|
ccbb2eaba9 | ||
|
|
80e4e7939d | ||
|
|
0c832e30bf | ||
|
|
6de848a15c | ||
|
|
178b5db8de | ||
|
|
d3f9f4f3e8 | ||
|
|
dccac34282 | ||
|
|
d16f246375 | ||
|
|
d2113766e1 | ||
|
|
9f5dd59d75 | ||
|
|
0208fad057 | ||
|
|
fdc06b2c1c | ||
|
|
a153e7fe30 | ||
|
|
10bd3a11b8 | ||
|
|
fcf7a55ccc | ||
|
|
e5bca3ce29 | ||
|
|
27e7116f60 | ||
|
|
80022cccd9 | ||
|
|
13ef97e51e | ||
|
|
f3475fd098 | ||
|
|
a1ffc0b25a | ||
|
|
a6e58edfb9 | ||
|
|
a05681001f | ||
|
|
87cb6372a0 | ||
|
|
a9f4479557 | ||
|
|
5eb0242941 | ||
|
|
fa1e3169df | ||
|
|
026a6ffab2 | ||
|
|
1ea5678932 | ||
|
|
41a0cfe002 | ||
|
|
b9a220c624 | ||
|
|
982f429d6b | ||
|
|
3c4f0d3c9e | ||
|
|
8bbbee8ffd | ||
|
|
c9fdef8233 | ||
|
|
2d723f1c51 | ||
|
|
5b1193407a | ||
|
|
6aa09f61d4 | ||
|
|
39e38c7049 | ||
|
|
c3560e5854 | ||
|
|
4b5464c6cc | ||
|
|
b36a6114aa | ||
|
|
378d0a757a | ||
|
|
f6a16c5203 | ||
|
|
e754585e38 | ||
|
|
5951e7500a | ||
|
|
345528d8f5 | ||
|
|
ab2128f55d | ||
|
|
38543ce2a3 | ||
|
|
609f0ca9bc | ||
|
|
ee23e39b3c | ||
|
|
63ba883a77 | ||
|
|
fb9b3f96de | ||
|
|
8fd16f4a39 | ||
|
|
0ff45f1cc4 | ||
|
|
628efcb189 | ||
|
|
996e529944 | ||
|
|
34c1316ae0 | ||
|
|
2e7cb2b829 | ||
|
|
50f1f8f0eb | ||
|
|
d66c6c7e1e | ||
|
|
85e822e283 | ||
|
|
63f7e95c89 | ||
|
|
3c798502c8 | ||
|
|
c7a37eb6b2 | ||
|
|
02f08b16d6 | ||
|
|
100a6f70ca | ||
|
|
e45cd02b01 | ||
|
|
d2c9fc41f1 | ||
|
|
4ac1b7748a | ||
|
|
cd9f59325e | ||
|
|
d31de6c8de | ||
|
|
d89083cd8c | ||
|
|
005314ce06 | ||
|
|
b0c96a61ec | ||
|
|
9e737156dd | ||
|
|
b9585dabd4 | ||
|
|
1639cadbb7 | ||
|
|
30b91b128a | ||
|
|
ddd26de139 | ||
|
|
9934f7d56e | ||
|
|
92d40c27e2 | ||
|
|
07b0ffef84 | ||
|
|
5c4f978073 | ||
|
|
db9d42c153 | ||
|
|
5600eefea5 | ||
|
|
4e6bd33eca | ||
|
|
1a861b2df9 | ||
|
|
2ea3579281 | ||
|
|
93632d2a18 | ||
|
|
031f03a903 | ||
|
|
9107944b05 | ||
|
|
e2678149cb | ||
|
|
10a1d5c03b | ||
|
|
c1d223dbde | ||
|
|
c46fac3464 | ||
|
|
7a2ea49399 | ||
|
|
5a422b5ef6 | ||
|
|
1bbed6c4ed | ||
|
|
59cc9d4bc6 | ||
|
|
8a29021aad | ||
|
|
521901f09a | ||
|
|
d2f5fbdd08 | ||
|
|
c8b3e622f1 | ||
|
|
d96772444e | ||
|
|
9b8128aaa8 | ||
|
|
1ac9b4c38f | ||
|
|
742b98bed6 | ||
|
|
fb5fb44993 | ||
|
|
e7c88a4349 | ||
|
|
e215d94b7b | ||
|
|
bf23b39d76 | ||
|
|
79d7babb57 | ||
|
|
36a46482c5 | ||
|
|
5954fe528b | ||
|
|
3e3f8aeb93 | ||
|
|
2c67ab924f | ||
|
|
93a82060d4 | ||
|
|
681c2e9492 | ||
|
|
07b566dd02 | ||
|
|
340512e27a | ||
|
|
c552933459 | ||
|
|
ca37c6bfe6 | ||
|
|
9d362875da | ||
|
|
62aed1b53a | ||
|
|
ad9d011ed0 | ||
|
|
d83d3304a5 | ||
|
|
49c8d99f61 | ||
|
|
40311dbe05 | ||
|
|
c5f89ebc0d | ||
|
|
bb23556ead | ||
|
|
09b44b3189 | ||
|
|
1e4c554bcd | ||
|
|
604e270a73 | ||
|
|
7a69cf587e | ||
|
|
d6692a8062 | ||
|
|
be0cde1d70 | ||
|
|
49d4f55c87 | ||
|
|
d1722e3975 | ||
|
|
36f3431559 | ||
|
|
b0dece756a | ||
|
|
5fe1eaea17 | ||
|
|
533507de25 | ||
|
|
5ec93fd74c | ||
|
|
4c273e1fc5 | ||
|
|
aebca19fd7 | ||
|
|
8158ba2be3 | ||
|
|
19dc3f071c | ||
|
|
275ce16faa | ||
|
|
5c88b1e80a | ||
|
|
21026001db | ||
|
|
010e530ac4 | ||
|
|
1878ae8222 | ||
|
|
ce39b75cc8 | ||
|
|
bbb3032e1c | ||
|
|
6a0315fe7a | ||
|
|
b4a774e821 | ||
|
|
8586d5e206 | ||
|
|
cfd91023be | ||
|
|
797449f7e4 | ||
|
|
943d012875 | ||
|
|
0db7806dec | ||
|
|
07e3dd9ec7 | ||
|
|
67e58ff152 | ||
|
|
5340cf5567 | ||
|
|
9c36c74357 | ||
|
|
8d79a6ae03 | ||
|
|
678b76cab1 | ||
|
|
c2e0cd60d7 | ||
|
|
3ef760604b | ||
|
|
8890ae10d4 | ||
|
|
e0bc54cd82 | ||
|
|
8005df42fb | ||
|
|
5276903bea | ||
|
|
aee49c3fde | ||
|
|
be684c784f | ||
|
|
4643d483a0 | ||
|
|
510ac66ce1 | ||
|
|
dd47962ad0 | ||
|
|
cb513b9a70 | ||
|
|
20683d62a6 | ||
|
|
097e0fb46c | ||
|
|
e48d2b9b83 | ||
|
|
1f52c0e0d4 | ||
|
|
a97d718de8 | ||
|
|
aab95f93f2 | ||
|
|
e8c3c70369 | ||
|
|
96f0a8e8e5 | ||
|
|
e674226a3b | ||
|
|
dbad81473e | ||
|
|
689887c94d | ||
|
|
cdb122c698 | ||
|
|
0c8b847ae6 | ||
|
|
c1fd891916 | ||
|
|
644c5a941b | ||
|
|
939f0d0344 | ||
|
|
abc6ecaa1c | ||
|
|
8fcd73e3cb | ||
|
|
916a5f367c | ||
|
|
adf5ee394e | ||
|
|
514ac7dc8f | ||
|
|
3acb4e54d5 | ||
|
|
3e69250f72 | ||
|
|
fbbf4e06ba | ||
|
|
6b964cb61d | ||
|
|
2f3e1dcbc6 | ||
|
|
1a32fdf6d7 | ||
|
|
c85432b2f9 | ||
|
|
c44fd235ce | ||
|
|
dcae6f1415 | ||
|
|
307871a050 | ||
|
|
0baa1c8723 | ||
|
|
e6993e1b88 | ||
|
|
ef94716af5 | ||
|
|
7f9ef5e11d | ||
|
|
551f1f85a9 | ||
|
|
19ec8646b8 | ||
|
|
fd83596c91 | ||
|
|
0691595ed2 | ||
|
|
bba597cdff | ||
|
|
d8a2b92098 | ||
|
|
501fea1202 | ||
|
|
697bb04d46 | ||
|
|
b5ee0e8222 | ||
|
|
1fea01754d | ||
|
|
508036742c | ||
|
|
39601f99ab | ||
|
|
44334fca11 | ||
|
|
9fde2ac269 | ||
|
|
346df07adc | ||
|
|
4c4af9971e | ||
|
|
202a55cb39 | ||
|
|
1c4d7c5772 | ||
|
|
81869b282b | ||
|
|
2487f9369c | ||
|
|
16aee6c8d6 | ||
|
|
3af937ea9a | ||
|
|
4d21455e72 | ||
|
|
593fd646b1 | ||
|
|
ca44242f37 | ||
|
|
d8f5b50cd8 | ||
|
|
79af726872 | ||
|
|
bc979a33f7 | ||
|
|
d3e858645f | ||
|
|
4ab5bfef22 | ||
|
|
5e383e9d71 | ||
|
|
7a283c64cb | ||
|
|
c37f339d8c | ||
|
|
550c53c2ac | ||
|
|
e3a5df1aaa | ||
|
|
340deb01dd | ||
|
|
6ef597a4ee | ||
|
|
3d91c410e7 | ||
|
|
93d7015139 | ||
|
|
8bb3c0796d | ||
|
|
3afc37438e | ||
|
|
7f472ba24e | ||
|
|
3d9353f7f5 | ||
|
|
2e2a5a0156 | ||
|
|
2bb9838a80 | ||
|
|
78a4563baf | ||
|
|
53b2fe9fd8 | ||
|
|
d2deff4864 | ||
|
|
a5bfa3ae63 | ||
|
|
86791f1fef | ||
|
|
58af8d68a1 | ||
|
|
d1cb776e29 | ||
|
|
a3a79e4295 | ||
|
|
29849b1330 | ||
|
|
943b59b5d8 | ||
|
|
38535c4fe1 | ||
|
|
ebc4910834 | ||
|
|
4a988f467a | ||
|
|
d163853c97 | ||
|
|
1d45dc8d81 | ||
|
|
45600830d3 | ||
|
|
77ccb3767c | ||
|
|
a460b8f2f4 | ||
|
|
6c7a40627f | ||
|
|
6bc654ee49 | ||
|
|
b48dfe9b3d | ||
|
|
bf1c3777ab | ||
|
|
0de70d295a | ||
|
|
b401443dbd | ||
|
|
6095ec66ed | ||
|
|
8c71d8f126 | ||
|
|
50b2ea7053 | ||
|
|
a5f34a880c | ||
|
|
8772fabc4f | ||
|
|
50d2b963cc | ||
|
|
496b8d5bd4 | ||
|
|
0885d608d8 | ||
|
|
bb35509c38 | ||
|
|
1b3b2e539c | ||
|
|
a18bd1bb75 | ||
|
|
81345bcc26 | ||
|
|
c588bc604d | ||
|
|
eec3a4720c | ||
|
|
989e4293a3 | ||
|
|
40cd30f7f6 | ||
|
|
80561ec125 | ||
|
|
74aa3ac79a | ||
|
|
b3a84ba081 | ||
|
|
6ec13ab38a | ||
|
|
16c5ba0988 | ||
|
|
5871628f2b | ||
|
|
637d3430ff | ||
|
|
5cf6b860a6 | ||
|
|
91fa5d38b3 | ||
|
|
75de352ce2 | ||
|
|
ec087e8f3d | ||
|
|
871bb30dbe | ||
|
|
6b5c31e2fc | ||
|
|
aeed7fe52d | ||
|
|
574aa0affe | ||
|
|
48c5f48af0 | ||
|
|
cb3d7349a3 | ||
|
|
56afd763dc | ||
|
|
6c0d91837c | ||
|
|
03bc61c80a | ||
|
|
f76a1f0e86 | ||
|
|
5c968acb13 | ||
|
|
a2d5cda716 | ||
|
|
a4ad3d88c6 | ||
|
|
974dfbc9ab | ||
|
|
a2040f01bf | ||
|
|
a0f8ada285 | ||
|
|
4707f4fc3f | ||
|
|
7b9fad00a1 | ||
|
|
b75de60afb | ||
|
|
d8f701ee61 | ||
|
|
03d5fe8d6c | ||
|
|
a830c69a30 | ||
|
|
75b1cf8a23 | ||
|
|
6ecd2e57fb | ||
|
|
357746e344 | ||
|
|
51375ed278 | ||
|
|
0b2e15d20c | ||
|
|
01f2b0e26b | ||
|
|
9a08085146 | ||
|
|
a0ecfce7b7 | ||
|
|
87a520fc30 | ||
|
|
d63728afe5 | ||
|
|
0ee7306d9c | ||
|
|
026f54f3d8 | ||
|
|
761e47264a | ||
|
|
1450cf5f63 | ||
|
|
d1455d0d22 | ||
|
|
62e252ec26 | ||
|
|
e31ea0c243 | ||
|
|
82b6ecfa64 | ||
|
|
59bedaaa55 | ||
|
|
1db2ba51d2 | ||
|
|
1429cba2d4 | ||
|
|
8311c1f0e2 | ||
|
|
a882a9dff5 | ||
|
|
44d0af8597 | ||
|
|
1798542db7 | ||
|
|
e88bef4275 | ||
|
|
d51bb2c053 | ||
|
|
92a51b9794 | ||
|
|
cc4b50fdc1 | ||
|
|
54945b7fbc | ||
|
|
d0f6997e6d | ||
|
|
17c15cfe0a | ||
|
|
6e0bb0b468 | ||
|
|
ea042eb6c4 | ||
|
|
a238d6a890 | ||
|
|
8da988b18e | ||
|
|
62d2581faf | ||
|
|
dc4b9d3887 | ||
|
|
5cfac8fa3f | ||
|
|
f88ebed1a3 | ||
|
|
5f548fc459 | ||
|
|
799a49649c | ||
|
|
75a96f0153 | ||
|
|
f10f6c6360 | ||
|
|
18d46a86ae | ||
|
|
a26063b3f8 | ||
|
|
226d514788 | ||
|
|
66933ea2fe | ||
|
|
8368284817 | ||
|
|
c44756bbfd | ||
|
|
8a52954bf8 | ||
|
|
20b93507ab | ||
|
|
749afbd141 | ||
|
|
82866176fb | ||
|
|
ba948cda38 | ||
|
|
181965f6e8 | ||
|
|
15a969b3ba | ||
|
|
4475325ffa | ||
|
|
7997d4afd3 | ||
|
|
ef58f1e72e | ||
|
|
74ce26cdc2 | ||
|
|
18d71c7907 | ||
|
|
8e1269cc32 | ||
|
|
3bb234b17c | ||
|
|
ffd0c69698 | ||
|
|
57aefbcd57 | ||
|
|
1124887aa0 | ||
|
|
543efffa5c | ||
|
|
89d5c030dc | ||
|
|
efdeb7b449 | ||
|
|
5bf18c09bb | ||
|
|
a73dac75d4 | ||
|
|
f46970219f | ||
|
|
68b84722c4 | ||
|
|
24c8eb43a2 | ||
|
|
6229d2e215 | ||
|
|
31765a4abc | ||
|
|
f4d5070a7b | ||
|
|
a7ed9c7dc5 | ||
|
|
102c9c08d0 | ||
|
|
b49b3245af | ||
|
|
648953085f | ||
|
|
624b9306f0 | ||
|
|
c9e423bf64 | ||
|
|
8e24256f95 | ||
|
|
385d522d27 | ||
|
|
3270c7e016 | ||
|
|
5ec110c33f | ||
|
|
c7c7ffb0e0 | ||
|
|
5cdf053c8e | ||
|
|
3113281e2d | ||
|
|
07feb2185b | ||
|
|
697c8637ee | ||
|
|
e7f33ac051 | ||
|
|
d4605f5816 | ||
|
|
d794c9dc4d | ||
|
|
ccac23f5b2 | ||
|
|
6a699c9384 | ||
|
|
1e3019798a | ||
|
|
6985c5fd2a | ||
|
|
4e65b2fb9e | ||
|
|
31e45d4f4c | ||
|
|
cbc57351f5 | ||
|
|
0d71b7ac2c | ||
|
|
ca7169b84f | ||
|
|
ef562598ea | ||
|
|
3187bb2aa4 | ||
|
|
5c95c48c90 | ||
|
|
536c4bbab1 | ||
|
|
046030e301 | ||
|
|
8fb82c2cb7 | ||
|
|
264094861d | ||
|
|
853503d75f | ||
|
|
1a82c94979 | ||
|
|
d9fc71b8c0 | ||
|
|
3ce980fd88 | ||
|
|
6b81cc8b77 | ||
|
|
94dcff5bab | ||
|
|
f37f89a151 | ||
|
|
b5b5c8aebc | ||
|
|
3e42b9d527 | ||
|
|
21fa2bf98c | ||
|
|
50863b6985 | ||
|
|
2c1b01fcf6 | ||
|
|
3b2e1cfa39 | ||
|
|
86fe10ba44 | ||
|
|
7be5410877 | ||
|
|
d846a22e33 | ||
|
|
0392fe75fc | ||
|
|
d37b616e1f | ||
|
|
f753824429 | ||
|
|
7536da788c | ||
|
|
34174d6e7d | ||
|
|
3580c7c28c | ||
|
|
f372a0fe6c | ||
|
|
343e645282 | ||
|
|
48a9226e1c | ||
|
|
0a230905ae | ||
|
|
f179b39c70 | ||
|
|
b9b068ff63 | ||
|
|
8ba131290a | ||
|
|
1f5fa5eb7c | ||
|
|
cb936dd82e | ||
|
|
5b1d019bb0 | ||
|
|
e6bca819d4 | ||
|
|
c3b5b21845 | ||
|
|
2693664aa7 | ||
|
|
9baced20c4 | ||
|
|
5acdad29ec | ||
|
|
650f2dd713 | ||
|
|
1c564e1bd6 | ||
|
|
94967bcd00 | ||
|
|
f6e653b242 | ||
|
|
309050d956 | ||
|
|
1d3c0f56a9 | ||
|
|
25fd5cd4ac | ||
|
|
840d3975cc | ||
|
|
cfa250957a | ||
|
|
fab9ee47f9 | ||
|
|
9308525d93 | ||
|
|
787d22c93e | ||
|
|
09a111239e | ||
|
|
866e5397d9 | ||
|
|
ed80b431f0 | ||
|
|
8920e68584 | ||
|
|
41a472693a | ||
|
|
bf419bc243 | ||
|
|
d90c383287 | ||
|
|
e08b800eb9 | ||
|
|
e61960f333 | ||
|
|
de79e3bec3 | ||
|
|
f127a0f593 | ||
|
|
d7df6e1e0c | ||
|
|
28e6028af4 | ||
|
|
da12532669 | ||
|
|
b0b8d40b71 | ||
|
|
e4198466b8 | ||
|
|
eefa621c56 | ||
|
|
b94a4d9fc3 | ||
|
|
4bb670e667 | ||
|
|
1ef68dfffd | ||
|
|
5198020c29 | ||
|
|
63b7350046 | ||
|
|
77a8cf4e66 | ||
|
|
a32f901ab9 | ||
|
|
507a718632 | ||
|
|
87014f816c | ||
|
|
d798071e06 | ||
|
|
c3fc524c0d | ||
|
|
4f36697737 | ||
|
|
6cb3687d5d | ||
|
|
69ec8f2d89 | ||
|
|
c4d41f48a3 | ||
|
|
a6234eb261 | ||
|
|
19d115778b | ||
|
|
90f9b9c1c9 | ||
|
|
2d5e6bb90b | ||
|
|
efd614194b | ||
|
|
ca5e560f1f | ||
|
|
fcabd02fe8 | ||
|
|
c1609ed490 | ||
|
|
2fefa682b7 | ||
|
|
9a0e763761 | ||
|
|
34a2196295 | ||
|
|
bf009a4949 | ||
|
|
2cffbadbd5 | ||
|
|
456508a332 | ||
|
|
7243d04f58 | ||
|
|
a8db7b3ba6 | ||
|
|
f7be373711 | ||
|
|
13f7b6a22e | ||
|
|
de2b20482a | ||
|
|
6fa03297f9 | ||
|
|
c87b12ec2f | ||
|
|
032fdd63d9 | ||
|
|
6ea0c37e52 | ||
|
|
6efa7a51c6 | ||
|
|
beca7fca30 | ||
|
|
bcaa635a4e | ||
|
|
9be8c5b527 | ||
|
|
b7df9ec05a | ||
|
|
a2da00eb49 | ||
|
|
790433984b | ||
|
|
67100d5ebe | ||
|
|
5d88058928 | ||
|
|
2f55a3fa0d | ||
|
|
0f2c96c64d | ||
|
|
158013ef3a | ||
|
|
60c51476f2 | ||
|
|
0aaf29c045 | ||
|
|
b2022144e6 | ||
|
|
ee22488ab2 | ||
|
|
2c3fe8b8ec | ||
|
|
c6124f6d56 | ||
|
|
e817f919c2 | ||
|
|
285b6d28af | ||
|
|
1d90302848 | ||
|
|
1766c22f6f | ||
|
|
604c68b3a0 | ||
|
|
1ac0e8449b | ||
|
|
fd1de9b298 | ||
|
|
57b9baac53 | ||
|
|
43bb60addb | ||
|
|
7834284bec | ||
|
|
2b2f9b3386 | ||
|
|
9c6ed2ea02 | ||
|
|
dbbb999952 | ||
|
|
6a9504f26a | ||
|
|
d0affc6c6a | ||
|
|
de1b5cd056 | ||
|
|
7ab3dd04a0 | ||
|
|
ac51e5dbd1 | ||
|
|
3f5db6b86e | ||
|
|
e76f3f93f6 | ||
|
|
d3fb9cc5f3 | ||
|
|
ab20b3e083 | ||
|
|
a9444c386d | ||
|
|
30f98e6730 | ||
|
|
c3b726f10a | ||
|
|
45234c9784 | ||
|
|
f4e9acb233 | ||
|
|
90dae320c3 | ||
|
|
b795e50e61 | ||
|
|
a382bef144 | ||
|
|
4474077963 | ||
|
|
5e115c48b3 | ||
|
|
8a393ec041 | ||
|
|
901d8f3e7a | ||
|
|
5208bbcd21 | ||
|
|
7ea1700b78 | ||
|
|
2137a4b1e5 | ||
|
|
5684e694b5 | ||
|
|
da79f93c61 | ||
|
|
deb5dc1057 | ||
|
|
5239ab477c | ||
|
|
9a1d9814de | ||
|
|
2e68526b44 | ||
|
|
a1c9ee1013 | ||
|
|
955087868a | ||
|
|
66e53305bf | ||
|
|
09bb755088 | ||
|
|
cea38771f1 | ||
|
|
b607cecc2b | ||
|
|
f3e4e9b162 | ||
|
|
a017109d7d | ||
|
|
396c6377f8 | ||
|
|
9668a60151 | ||
|
|
e058c578a8 | ||
|
|
24d7d208a0 | ||
|
|
9b5b882dcb | ||
|
|
be2d6b99f6 | ||
|
|
4bfcb4b041 | ||
|
|
89c1af4feb | ||
|
|
891071e074 | ||
|
|
405412f6c1 | ||
|
|
f584fb1576 | ||
|
|
1a9f236a60 | ||
|
|
007970ded8 | ||
|
|
bd05b447c0 | ||
|
|
9468670980 | ||
|
|
64e47265e1 | ||
|
|
e822e871f5 | ||
|
|
a87b25d10e | ||
|
|
ea5fef76d1 | ||
|
|
c2c139ef4f | ||
|
|
c5a2ab2512 | ||
|
|
bc40669598 | ||
|
|
e3050cd997 | ||
|
|
94ab50a21a | ||
|
|
366a75e222 | ||
|
|
35d5936829 | ||
|
|
7ea17f0d31 | ||
|
|
0b29a3e5c1 | ||
|
|
76550d3c5d | ||
|
|
c0634217e1 | ||
|
|
59e63f549b | ||
|
|
5c70f973a5 | ||
|
|
e4c8c14e3e | ||
|
|
e43932f147 | ||
|
|
f76befa84e | ||
|
|
407d1365bd | ||
|
|
36102504a1 | ||
|
|
20ed42dd38 | ||
|
|
2fd3af73eb | ||
|
|
bc34f7f7f5 | ||
|
|
a04f70fb36 | ||
|
|
684ca5029f | ||
|
|
9844607d0f | ||
|
|
f06e116bf7 | ||
|
|
27c139926c | ||
|
|
e72a06bdf4 | ||
|
|
3f266aafb4 | ||
|
|
cbd8b58d5c | ||
|
|
1ee8e615fc | ||
|
|
c21820c615 | ||
|
|
a6f14c206b | ||
|
|
b95d3e711e | ||
|
|
034623f82a | ||
|
|
448e0ceae1 | ||
|
|
8dfcebf542 | ||
|
|
53cbcfac5a | ||
|
|
d41e8ed4ad | ||
|
|
e8659d4b37 | ||
|
|
3585f80c67 | ||
|
|
12cd3785b0 | ||
|
|
9c8904f165 |
13
.bunch
13
.bunch
@@ -1,7 +1,8 @@
|
||||
193
|
||||
201
|
||||
202_201
|
||||
192
|
||||
as36_192
|
||||
as40
|
||||
as41_201
|
||||
202
|
||||
203_202
|
||||
193
|
||||
192_193
|
||||
as36_192_193
|
||||
as40_193
|
||||
as41
|
||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -3,5 +3,6 @@
|
||||
* text=auto
|
||||
* eol=lf
|
||||
*.png binary
|
||||
*.jar binary
|
||||
compiler/cli/bin/* eol=lf
|
||||
compiler/cli/bin/*.bat eol=crlf
|
||||
|
||||
15
.idea/codeStyles/Project.xml
generated
15
.idea/codeStyles/Project.xml
generated
@@ -13,21 +13,6 @@
|
||||
</option>
|
||||
</JavaCodeStyleSettings>
|
||||
<JetCodeStyleSettings>
|
||||
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
|
||||
<value>
|
||||
<package name="java.util" alias="false" withSubpackages="false" />
|
||||
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PACKAGES_IMPORT_LAYOUT">
|
||||
<value>
|
||||
<package name="" alias="false" withSubpackages="true" />
|
||||
<package name="java" alias="false" withSubpackages="true" />
|
||||
<package name="javax" alias="false" withSubpackages="true" />
|
||||
<package name="kotlin" alias="false" withSubpackages="true" />
|
||||
<package name="" alias="true" withSubpackages="true" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
|
||||
</JetCodeStyleSettings>
|
||||
<MarkdownNavigatorCodeStyleSettings>
|
||||
|
||||
20
.idea/runConfigurations/Test__KMM.xml
generated
Normal file
20
.idea/runConfigurations/Test__KMM.xml
generated
Normal file
@@ -0,0 +1,20 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Test: KMM" type="GradleRunConfiguration" factoryName="Gradle">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="kmmTest" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
</ExternalSystemSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -4,12 +4,13 @@
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="--tests "org.jetbrains.kotlin.js.test.ApiTest" -Poverwrite.output=true" />
|
||||
<option name="scriptParameters" value="--tests "org.jetbrains.kotlin.js.test.ApiTest" -Poverwrite.output=true --parallel" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value=":js:js.tests:cleanTest" />
|
||||
<option value=":js:js.tests:test" />
|
||||
</list>
|
||||
</option>
|
||||
|
||||
2
.idea/scopes/Apply_copyright.xml
generated
2
.idea/scopes/Apply_copyright.xml
generated
@@ -1,3 +1,3 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name="Apply copyright" pattern="!file[*]:*//testData//*&&!file[*]:testData//*&&!file[*]:*.gradle.kts&&!file[*]:*.gradle&&!file[kotlin.kotlin-ultimate]:*/&&!file[kotlin.kotlin-ultimate.*]:*/&&!file[kotlin.libraries]:stdlib/api//*" />
|
||||
<scope name="Apply copyright" pattern="!file[*]:*//testData//*&&!file[*]:testData//*&&!file[*]:*.gradle.kts&&!file[*]:*.gradle&&!file[group:kotlin-ultimate]:*/&&!file[kotlin.libraries]:stdlib/api//*" />
|
||||
</component>
|
||||
530
ChangeLog.md
530
ChangeLog.md
@@ -1,5 +1,504 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 1.4-M3
|
||||
|
||||
### Compiler
|
||||
|
||||
#### New Features
|
||||
|
||||
- [`KT-23575`](https://youtrack.jetbrains.com/issue/KT-23575) Deprecate with replacement and SinceKotlin
|
||||
- [`KT-38652`](https://youtrack.jetbrains.com/issue/KT-38652) Do not generate optional annotations to class files on JVM
|
||||
- [`KT-38777`](https://youtrack.jetbrains.com/issue/KT-38777) Hide Throwable.addSuppressed member and prefer extension instead
|
||||
|
||||
#### Performance Improvements
|
||||
|
||||
- [`KT-38489`](https://youtrack.jetbrains.com/issue/KT-38489) Compilation of kotlin html DSL increasingly slow
|
||||
- [`KT-28650`](https://youtrack.jetbrains.com/issue/KT-28650) Type inference for argument type is very slow if several interfaces with a type parameter is used as an upper bound of a type parameter
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-15971`](https://youtrack.jetbrains.com/issue/KT-15971) Incorrect bytecode generated when inheriting default arguments not from the first supertype
|
||||
- [`KT-25290`](https://youtrack.jetbrains.com/issue/KT-25290) NI: "AssertionError: If original type is SAM type, then candidate should have same type constructor" on out projection of Java class
|
||||
- [`KT-28672`](https://youtrack.jetbrains.com/issue/KT-28672) Contracts on calls with implicit receivers
|
||||
- [`KT-30279`](https://youtrack.jetbrains.com/issue/KT-30279) Support non-reified type parameters in typeOf
|
||||
- [`KT-31908`](https://youtrack.jetbrains.com/issue/KT-31908) NI: CCE on passing lambda to function which accepts vararg SAM interface
|
||||
- [`KT-32156`](https://youtrack.jetbrains.com/issue/KT-32156) New inference issue with generics
|
||||
- [`KT-32229`](https://youtrack.jetbrains.com/issue/KT-32229) New inference algorithm not taking into account the upper bound class
|
||||
- [`KT-33455`](https://youtrack.jetbrains.com/issue/KT-33455) Override equals/hashCode in functional interface wrappers
|
||||
- [`KT-34902`](https://youtrack.jetbrains.com/issue/KT-34902) AnalyzerException: Argument 1: expected I, but found R for unsigned types in generic data class
|
||||
- [`KT-35075`](https://youtrack.jetbrains.com/issue/KT-35075) AssertionError: "No resolved call for ..." with conditional function references
|
||||
- [`KT-35468`](https://youtrack.jetbrains.com/issue/KT-35468) Overcome ambiguity between typealias kotlin.Throws and the aliased type kotlin.jvm.Throws
|
||||
- [`KT-35494`](https://youtrack.jetbrains.com/issue/KT-35494) NI: Multiple duplicate error diagnostics (in IDE popup) with NULL_FOR_NONNULL_TYPE
|
||||
- [`KT-35681`](https://youtrack.jetbrains.com/issue/KT-35681) Wrong common supertype between raw and integer literal type leads to unsound code
|
||||
- [`KT-35937`](https://youtrack.jetbrains.com/issue/KT-35937) Error "Declaration has several compatible actuals" on incremental build
|
||||
- [`KT-36013`](https://youtrack.jetbrains.com/issue/KT-36013) Functional interface conversion not happens on a value of functional type with smart cast to a relevant functional type
|
||||
- [`KT-36045`](https://youtrack.jetbrains.com/issue/KT-36045) Do not depend on the order of lambda arguments to coerce result to `Unit`
|
||||
- [`KT-36448`](https://youtrack.jetbrains.com/issue/KT-36448) NI: fix tests after enabling NI in the compiler
|
||||
- [`KT-36706`](https://youtrack.jetbrains.com/issue/KT-36706) Prohibit functional interface constructor references
|
||||
- [`KT-36969`](https://youtrack.jetbrains.com/issue/KT-36969) Generate @NotNull on instance parameters of Interface$DefaultImpls methods
|
||||
- [`KT-37058`](https://youtrack.jetbrains.com/issue/KT-37058) Incorrect overload resolution ambiguity on callable reference in a conditional expression with new inference
|
||||
- [`KT-37120`](https://youtrack.jetbrains.com/issue/KT-37120) [FIR] False UNRESOLVED_REFERENCE for public and protected member functions and properties which are declared in object inner class
|
||||
- [`KT-37149`](https://youtrack.jetbrains.com/issue/KT-37149) Conversion when generic specified by type argument of SAM type
|
||||
- [`KT-37249`](https://youtrack.jetbrains.com/issue/KT-37249) false TYPE_MISMATCH when When-expression branches have try-catch blocks
|
||||
- [`KT-37341`](https://youtrack.jetbrains.com/issue/KT-37341) NI: Type mismatch with combination of lambda and function reference
|
||||
- [`KT-37436`](https://youtrack.jetbrains.com/issue/KT-37436) AME: "Receiver class does not define or inherit an implementation of the resolved method" in runtime on usage of non-abstract method of fun interface
|
||||
- [`KT-37510`](https://youtrack.jetbrains.com/issue/KT-37510) NI infers `java.lang.Void` from the expression in a lazy property delegate and throws ClassCastException at runtime
|
||||
- [`KT-37541`](https://youtrack.jetbrains.com/issue/KT-37541) SAM conversion with fun interface without a function fails on compiling and IDE analysis in SamAdapterFunctionsScope.getSamConstructor()
|
||||
- [`KT-37574`](https://youtrack.jetbrains.com/issue/KT-37574) NI: Type mismatch with Kotlin object extending functional type passed as @FunctionalInterface to Java
|
||||
- [`KT-37630`](https://youtrack.jetbrains.com/issue/KT-37630) NI: ILT suitability in a call is broken if there are CST calculation and calling function's type parameters
|
||||
- [`KT-37665`](https://youtrack.jetbrains.com/issue/KT-37665) NI: applicability error due to implicitly inferred Nothing for returning T with expected type
|
||||
- [`KT-37712`](https://youtrack.jetbrains.com/issue/KT-37712) No extension receiver in functional interface created with lambda
|
||||
- [`KT-37715`](https://youtrack.jetbrains.com/issue/KT-37715) NI: VerifyError: Bad type on operand stack with varargs generic value when type is inferred
|
||||
- [`KT-37721`](https://youtrack.jetbrains.com/issue/KT-37721) NI: Function reference with vararg parameter treated as array and missing default parameter is rejected
|
||||
- [`KT-37887`](https://youtrack.jetbrains.com/issue/KT-37887) NI: Smart casting for Map doesn't work if the variable is already "smart casted"
|
||||
- [`KT-37914`](https://youtrack.jetbrains.com/issue/KT-37914) NI: broken inference for a casting to subtype function within the common constraint system with this subtype
|
||||
- [`KT-37952`](https://youtrack.jetbrains.com/issue/KT-37952) NI: improve lambdas completion through separation the lambdas analysis into several steps
|
||||
- [`KT-38069`](https://youtrack.jetbrains.com/issue/KT-38069) Callable reference adaptation should have dependency on API version 1.4
|
||||
- [`KT-38143`](https://youtrack.jetbrains.com/issue/KT-38143) New type inference fails when calling extension function defined on generic type with type arguments nested too deep
|
||||
- [`KT-38156`](https://youtrack.jetbrains.com/issue/KT-38156) FIR Metadata generation
|
||||
- [`KT-38197`](https://youtrack.jetbrains.com/issue/KT-38197) java.lang.OutOfMemoryError: Java heap space: failed reallocation of scalar replaced objects
|
||||
- [`KT-38259`](https://youtrack.jetbrains.com/issue/KT-38259) NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER for provideDelegate
|
||||
- [`KT-38337`](https://youtrack.jetbrains.com/issue/KT-38337) Map delegation fails for inline classes
|
||||
- [`KT-38401`](https://youtrack.jetbrains.com/issue/KT-38401) FIR: protected effective visibility is handled unprecisely
|
||||
- [`KT-38416`](https://youtrack.jetbrains.com/issue/KT-38416) FIR: infinite loop in BB coroutine test 'overrideDefaultArgument.kt'
|
||||
- [`KT-38432`](https://youtrack.jetbrains.com/issue/KT-38432) FIR: incorrect effective visibility in anonymous object
|
||||
- [`KT-38434`](https://youtrack.jetbrains.com/issue/KT-38434) Implement resolution of suspend-conversion on FE only, but give error if suspend conversion is called
|
||||
- [`KT-38437`](https://youtrack.jetbrains.com/issue/KT-38437) [FIR] String(CharArray) is resolved to java.lang.String constructor instead of kotlin.text.String pseudo-constructor
|
||||
- [`KT-38439`](https://youtrack.jetbrains.com/issue/KT-38439) NI: anonymous functions without receiver is allowed if there is an expected type with receiver
|
||||
- [`KT-38473`](https://youtrack.jetbrains.com/issue/KT-38473) FIR: ConeIntegerLiteralType in signature
|
||||
- [`KT-38537`](https://youtrack.jetbrains.com/issue/KT-38537) IllegalArgumentException: "marginPrefix must be non-blank string" with raw strings and space as margin prefix in trimMargin() call
|
||||
- [`KT-38604`](https://youtrack.jetbrains.com/issue/KT-38604) Implicit suspend conversion on call arguments doesn't work on vararg elements
|
||||
- [`KT-38680`](https://youtrack.jetbrains.com/issue/KT-38680) NSME when calling generic interface method with default parameters overriden with inline class type argument
|
||||
- [`KT-38681`](https://youtrack.jetbrains.com/issue/KT-38681) Wrong bytecode generated when calling generic interface method with default parameters overriden with primitive type argument
|
||||
- [`KT-38691`](https://youtrack.jetbrains.com/issue/KT-38691) NI: overload resolution ambiguity if take `R` and `() -> R`, and pass literal lambda, which returns `R`
|
||||
- [`KT-38799`](https://youtrack.jetbrains.com/issue/KT-38799) False positive USELESS_CAST for lambda parameter
|
||||
- [`KT-38802`](https://youtrack.jetbrains.com/issue/KT-38802) Generated code crashes by ClassCastException when delegating with inline class
|
||||
- [`KT-38853`](https://youtrack.jetbrains.com/issue/KT-38853) Backend Internal error: Error type encountered: Unresolved type for nested class used in an annotation argument on an interface method
|
||||
- [`KT-38890`](https://youtrack.jetbrains.com/issue/KT-38890) NI: false negative Type mismatch for values with fun keyword
|
||||
- [`KT-39010`](https://youtrack.jetbrains.com/issue/KT-39010) NI: Regression with false-positive smartcast on var of generic type
|
||||
- [`KT-39013`](https://youtrack.jetbrains.com/issue/KT-39013) 202, ASM 8: "AnalyzerException: Execution can fall off the end of the code"
|
||||
- [`KT-39260`](https://youtrack.jetbrains.com/issue/KT-39260) "AssertionError: Unsigned type expected: Int" in range
|
||||
- [`KT-39305`](https://youtrack.jetbrains.com/issue/KT-39305) NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER: unable to infer deeply nested type bound when class implements generic interface
|
||||
- [`KT-39408`](https://youtrack.jetbrains.com/issue/KT-39408) Using unsigned arrays as generics fails in 1.4-M2 with class cast exception
|
||||
- [`KT-39533`](https://youtrack.jetbrains.com/issue/KT-39533) NI: Wrong overload resolution for methods with SAM converted function reference arguments
|
||||
- [`KT-39535`](https://youtrack.jetbrains.com/issue/KT-39535) NI: Inference fails for the parameters of SAM converted lambdas with type parameters
|
||||
- [`KT-39603`](https://youtrack.jetbrains.com/issue/KT-39603) Require explicit override in JVM default compatibility mode on implicit generic specialization of inherited methods in classes
|
||||
- [`KT-39671`](https://youtrack.jetbrains.com/issue/KT-39671) Couldn't inline method call 'expectBody'
|
||||
- [`KT-39816`](https://youtrack.jetbrains.com/issue/KT-39816) NI:ClassCastException and no IDE error with provideDelegate when DELEGATE_SPECIAL_FUNCTION_MISSING in OI
|
||||
- [`KT-32779`](https://youtrack.jetbrains.com/issue/KT-32779) `Rewrite at slice` in array access resolution in coroutine inference
|
||||
- [`KT-39387`](https://youtrack.jetbrains.com/issue/KT-39387) Can't build Kotlin project due to overload resolution ambiguity on flatMap calls
|
||||
- [`KT-39229`](https://youtrack.jetbrains.com/issue/KT-39229) NI: resolution to wrong candidate (SAM-type against similar functional type)
|
||||
|
||||
### Docs & Examples
|
||||
|
||||
- [`KT-36245`](https://youtrack.jetbrains.com/issue/KT-36245) Document that @kotlin.native.ThreadLocal annotation doesn't work anywhere except in Kotlin/Native
|
||||
- [`KT-37943`](https://youtrack.jetbrains.com/issue/KT-37943) Conflicting overloads in the factory functions sample code in Coding Conventions Page
|
||||
|
||||
### IDE
|
||||
|
||||
#### New Features
|
||||
|
||||
- [`KT-10974`](https://youtrack.jetbrains.com/issue/KT-10974) Add Code Style: Import Layout Configuration Table
|
||||
- [`KT-39065`](https://youtrack.jetbrains.com/issue/KT-39065) "Join lines" should remove trailing comma on call site
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-9065`](https://youtrack.jetbrains.com/issue/KT-9065) Wrong result when move statement through if block with call with lambda
|
||||
- [`KT-14757`](https://youtrack.jetbrains.com/issue/KT-14757) Move statement up breaks code in function parameter list
|
||||
- [`KT-14946`](https://youtrack.jetbrains.com/issue/KT-14946) Move statement up/down (with Ctrl+Shift+Up/Down) messes with empty lines
|
||||
- [`KT-15143`](https://youtrack.jetbrains.com/issue/KT-15143) Kotlin: Colors&Fonts -> "Enum entry" should use Language Default -> Classes - Static field
|
||||
- [`KT-17887`](https://youtrack.jetbrains.com/issue/KT-17887) Moving statement (Ctrl/Cmd+Shift+Down) messes with use block
|
||||
- [`KT-34187`](https://youtrack.jetbrains.com/issue/KT-34187) UAST cannot get type of array access
|
||||
- [`KT-34524`](https://youtrack.jetbrains.com/issue/KT-34524) "PSI and index do not match" and IDE freeze with library import from `square/workflow`
|
||||
- [`KT-35574`](https://youtrack.jetbrains.com/issue/KT-35574) UAST: UBreakExpression in when expression should be UYieldExpression
|
||||
- [`KT-36801`](https://youtrack.jetbrains.com/issue/KT-36801) IDE: Unsupported language version value is represented with "latest stable" in GUI
|
||||
- [`KT-37378`](https://youtrack.jetbrains.com/issue/KT-37378) Remove IDE option "Enable new type inference algorithm..." in 1.4
|
||||
- [`KT-38003`](https://youtrack.jetbrains.com/issue/KT-38003) "Analyze Data Flow from Here" should work on parameter of abstract method
|
||||
- [`KT-38173`](https://youtrack.jetbrains.com/issue/KT-38173) Reified types do no have extends information
|
||||
- [`KT-38217`](https://youtrack.jetbrains.com/issue/KT-38217) Make Kotlin plugin settings searchable
|
||||
- [`KT-38247`](https://youtrack.jetbrains.com/issue/KT-38247) "IncorrectOperationException: Incorrect expression" through UltraLightUtils.kt: inlined string is not escaped before parsing
|
||||
- [`KT-38293`](https://youtrack.jetbrains.com/issue/KT-38293) Throwable: "'codestyle.name.kotlin' is not found in java.util.PropertyResourceBundle" at KotlinLanguageCodeStyleSettingsProvider.getConfigurableDisplayName()
|
||||
- [`KT-38407`](https://youtrack.jetbrains.com/issue/KT-38407) Drop components from plugin.xml
|
||||
- [`KT-38443`](https://youtrack.jetbrains.com/issue/KT-38443) No error on change in property initializer
|
||||
- [`KT-38521`](https://youtrack.jetbrains.com/issue/KT-38521) ISE: Loop in parent structure when converting a DOT_QUALIFIED_EXPRESSION with parent ANNOTATED_EXPRESSION
|
||||
- [`KT-38571`](https://youtrack.jetbrains.com/issue/KT-38571) Rework deprecated EPs
|
||||
- [`KT-38632`](https://youtrack.jetbrains.com/issue/KT-38632) Change the code style to official in tests
|
||||
|
||||
### IDE. Code Style, Formatting
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-24750`](https://youtrack.jetbrains.com/issue/KT-24750) Formatter: Minimum blank lines after class header does nothing
|
||||
- [`KT-31169`](https://youtrack.jetbrains.com/issue/KT-31169) IDEA settings search fails to find "Tabs and Indents" tab in Kotlin code style settings
|
||||
- [`KT-35359`](https://youtrack.jetbrains.com/issue/KT-35359) Incorrect indent for multiline expression in string template
|
||||
- [`KT-37420`](https://youtrack.jetbrains.com/issue/KT-37420) Add setting to disable inserting empty line between declaration and declaration with comment
|
||||
- [`KT-37891`](https://youtrack.jetbrains.com/issue/KT-37891) Formatter inserts empty lines between annotated properties
|
||||
- [`KT-38036`](https://youtrack.jetbrains.com/issue/KT-38036) Use trailing comma setting does not apply to code example in Settings dialog
|
||||
- [`KT-38568`](https://youtrack.jetbrains.com/issue/KT-38568) False positive: weak warning "Missing line break" on -> in when expression
|
||||
- [`KT-39024`](https://youtrack.jetbrains.com/issue/KT-39024) Add option for blank lines before declaration with comment or annotation on separate line
|
||||
- [`KT-39079`](https://youtrack.jetbrains.com/issue/KT-39079) Trailing comma: add base support for call site
|
||||
- [`KT-39123`](https://youtrack.jetbrains.com/issue/KT-39123) Option `Align 'when' branches in columns` does nothing
|
||||
- [`KT-39180`](https://youtrack.jetbrains.com/issue/KT-39180) Move trailing comma settings in Other tab
|
||||
|
||||
### IDE. Completion
|
||||
|
||||
- [`KT-18538`](https://youtrack.jetbrains.com/issue/KT-18538) Completion of static members of grand-super java class inserts unnecessary qualifier
|
||||
- [`KT-38445`](https://youtrack.jetbrains.com/issue/KT-38445) Fully qualified class name is used instead after insertion of `delay` method
|
||||
|
||||
### IDE. Debugger
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-14057`](https://youtrack.jetbrains.com/issue/KT-14057) Debugger couldn't step into Reader.read
|
||||
- [`KT-14828`](https://youtrack.jetbrains.com/issue/KT-14828) Bad step into/over behavior for functions with default parameters
|
||||
- [`KT-36403`](https://youtrack.jetbrains.com/issue/KT-36403) Method breakpoints don't work for libraries
|
||||
- [`KT-36404`](https://youtrack.jetbrains.com/issue/KT-36404) Evaluate: "AssertionError: Argument expression is not saved for a SAM constructor"
|
||||
- [`KT-37486`](https://youtrack.jetbrains.com/issue/KT-37486) Kotlin plugin keeps reference to stream debugger support classes after stream debugger plugin is disabled
|
||||
- [`KT-38484`](https://youtrack.jetbrains.com/issue/KT-38484) Coroutines Debugger: IAE “Requested element count -1 is less than zero.” is thrown by calling dumpCoroutines
|
||||
- [`KT-38606`](https://youtrack.jetbrains.com/issue/KT-38606) Coroutine Debugger: OCE from org.jetbrains.kotlin.idea.debugger.coroutine.proxy.mirror.BaseMirror.isCompatible
|
||||
- [`KT-39143`](https://youtrack.jetbrains.com/issue/KT-39143) NPE on setCurrentStackFrame to Kotlin inner compiled class content
|
||||
- [`KT-39412`](https://youtrack.jetbrains.com/issue/KT-39412) Failed to find Premain-Class manifest attribute when debugging main method with ktor
|
||||
- [`KT-39634`](https://youtrack.jetbrains.com/issue/KT-39634) (CoroutineDebugger) Agent doesn't start if using kotlinx-coroutines-core only dependency
|
||||
- [`KT-39648`](https://youtrack.jetbrains.com/issue/KT-39648) Coroutines debugger doesn't see stacktraces in case of the project has kotlinx-coroutines-debug dependency
|
||||
|
||||
### IDE. Gradle Integration
|
||||
|
||||
#### Performance Improvements
|
||||
|
||||
- [`KT-39059`](https://youtrack.jetbrains.com/issue/KT-39059) Poor performance of `modifyDependenciesOnMppModules`
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-35921`](https://youtrack.jetbrains.com/issue/KT-35921) Gradle Import fails with "Unsupported major.minor version 52.0" on pure Java project in case "Gradle JDK" is lower 1.8 and Kotlin plugin is enabled
|
||||
- [`KT-36673`](https://youtrack.jetbrains.com/issue/KT-36673) Gradle Project importing: move ModelBuilders and ModelProviders to kotlin-gradle-tooling jar
|
||||
- [`KT-36792`](https://youtrack.jetbrains.com/issue/KT-36792) IDEA 2020.1: Some module->module dependencies in HMPP project are missed after import from Gradle
|
||||
- [`KT-37125`](https://youtrack.jetbrains.com/issue/KT-37125) Imported modules structure for MPP project is displayed messy in UI in IDEA 2020.1
|
||||
- [`KT-37428`](https://youtrack.jetbrains.com/issue/KT-37428) NPE at KotlinFacetSettings.setLanguageLevel() on the first project import
|
||||
- [`KT-38706`](https://youtrack.jetbrains.com/issue/KT-38706) IDE Gradle import creates 4 JavaScript modules for MPP source sets with BOTH compiler type
|
||||
- [`KT-38767`](https://youtrack.jetbrains.com/issue/KT-38767) Published hierarchical multiplatform library symbols are unresolved in IDE (master)
|
||||
- [`KT-38842`](https://youtrack.jetbrains.com/issue/KT-38842) False positive [INVISIBLE_MEMBER] for `internal` declaration of commonMain called from commonTest
|
||||
- [`KT-39213`](https://youtrack.jetbrains.com/issue/KT-39213) IDE: references from MPP project to JavaScript library are unresolved, when project and library are compiled with "both" mode
|
||||
- [`KT-39657`](https://youtrack.jetbrains.com/issue/KT-39657) Language settings for intermediate source-sets are lost during import
|
||||
|
||||
### IDE. Gradle. Script
|
||||
|
||||
#### New Features
|
||||
|
||||
- [`KT-34481`](https://youtrack.jetbrains.com/issue/KT-34481) `*.gradle.kts`: use Intellij IDEA Gradle project sync mechanics for updating script configuration
|
||||
|
||||
#### Performance Improvements
|
||||
|
||||
- [`KT-34138`](https://youtrack.jetbrains.com/issue/KT-34138) Deadlock in `ScriptTemplatesFromDependenciesProvider`
|
||||
- [`KT-38875`](https://youtrack.jetbrains.com/issue/KT-38875) Deadlock in ScriptClassRootsUpdater.checkInvalidSdks
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-34265`](https://youtrack.jetbrains.com/issue/KT-34265) Bogus "build configuration failed, run 'gradle tasks' for more information" message and other issues related to "script dependencies"
|
||||
- [`KT-34444`](https://youtrack.jetbrains.com/issue/KT-34444) *.gradle.kts: special storage of all scripts configuration on one file
|
||||
- [`KT-35153`](https://youtrack.jetbrains.com/issue/KT-35153) build.gradle.kts: scripts in removed subproject remain imported, but shouldn't
|
||||
- [`KT-35573`](https://youtrack.jetbrains.com/issue/KT-35573) Request for gradle build script configuration only after explicit click on notification
|
||||
- [`KT-36675`](https://youtrack.jetbrains.com/issue/KT-36675) move .gradle.kts ModelBuilders and ModelProviders to kotlin-gradle-tooling jar
|
||||
- [`KT-37178`](https://youtrack.jetbrains.com/issue/KT-37178) build.gradle.kts: Rework the notification for scripts out of project
|
||||
- [`KT-37631`](https://youtrack.jetbrains.com/issue/KT-37631) Unnecessary loading dependencies after opening build.gradle.kts after project import with Gradle 6
|
||||
- [`KT-37863`](https://youtrack.jetbrains.com/issue/KT-37863) Scanning dependencies for script definitions takes too long or indefinitely during Gradle import
|
||||
- [`KT-38296`](https://youtrack.jetbrains.com/issue/KT-38296) MISSING_DEPENDENCY_SUPERCLASS in the build.gradle.kts editor while Gradle runs Ok
|
||||
- [`KT-38541`](https://youtrack.jetbrains.com/issue/KT-38541) "Invalid file" exception in ScriptChangeListener.getAnalyzableKtFileForScript()
|
||||
- [`KT-39104`](https://youtrack.jetbrains.com/issue/KT-39104) “Gradle Kotlin DSL script configuration is missing” after importing project in IJ201, Gradle 6.3
|
||||
- [`KT-39469`](https://youtrack.jetbrains.com/issue/KT-39469) Gradle version is not updated in script dependencies if the version of gradle was changed in gradle-wrapper.properties
|
||||
- [`KT-39771`](https://youtrack.jetbrains.com/issue/KT-39771) Freeze 30s from org.jetbrains.kotlin.scripting.resolve.ApiChangeDependencyResolverWrapper.resolve on loading script configuration with Gradle 5.6.4
|
||||
|
||||
### IDE. Inspections and Intentions
|
||||
|
||||
#### New Features
|
||||
|
||||
- [`KT-14884`](https://youtrack.jetbrains.com/issue/KT-14884) Intention to add missing "class" keyword for enum and annotation top-level declarations
|
||||
- [`KT-17209`](https://youtrack.jetbrains.com/issue/KT-17209) Provide intention to fix platform declaration clash (CONFLICTING_JVM_DECLARATIONS)
|
||||
- [`KT-24522`](https://youtrack.jetbrains.com/issue/KT-24522) Suggest to move typealias outside the class
|
||||
- [`KT-30263`](https://youtrack.jetbrains.com/issue/KT-30263) Detect redundant conversions of unsigned types
|
||||
- [`KT-35893`](https://youtrack.jetbrains.com/issue/KT-35893) Support Inspection for unnecessary asSequence() call
|
||||
- [`KT-38559`](https://youtrack.jetbrains.com/issue/KT-38559) "Change JVM name" (@JvmName) quickfix: improve name suggester for generic functions
|
||||
- [`KT-38597`](https://youtrack.jetbrains.com/issue/KT-38597) Expand Boolean intention
|
||||
- [`KT-38982`](https://youtrack.jetbrains.com/issue/KT-38982) Add "Logger initialized with foreign class" inspection
|
||||
- [`KT-39131`](https://youtrack.jetbrains.com/issue/KT-39131) TrailingCommaInspection: should suggest fixes for call-site without warnings
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-5271`](https://youtrack.jetbrains.com/issue/KT-5271) Missing QuickFix for Multiple supertypes available
|
||||
- [`KT-11865`](https://youtrack.jetbrains.com/issue/KT-11865) "Create secondary constructor" quick fix always inserts parameter-less call to `this()`
|
||||
- [`KT-14021`](https://youtrack.jetbrains.com/issue/KT-14021) Quickfix to add parameter to function gives strange name to parameter
|
||||
- [`KT-17121`](https://youtrack.jetbrains.com/issue/KT-17121) "Implement members" quick fix is not suggested
|
||||
- [`KT-17368`](https://youtrack.jetbrains.com/issue/KT-17368) Don't highlight members annotated with @JsName as unused
|
||||
- [`KT-20795`](https://youtrack.jetbrains.com/issue/KT-20795) "replace explicit parameter with it" creates invalid code in case of overload ambiguities
|
||||
- [`KT-22014`](https://youtrack.jetbrains.com/issue/KT-22014) Intention "convert lambda to reference" should be available for implicit 'this'
|
||||
- [`KT-22015`](https://youtrack.jetbrains.com/issue/KT-22015) Intention "Convert lambda to reference" should be available in spite of the lambda in or out of parentheses
|
||||
- [`KT-22142`](https://youtrack.jetbrains.com/issue/KT-22142) Intentions: "Convert to primary constructor" changes semantics for property with custom setter
|
||||
- [`KT-22878`](https://youtrack.jetbrains.com/issue/KT-22878) Empty argument list at the call site of custom function named "suspend" shouldn't be reported as unnecessary
|
||||
- [`KT-24281`](https://youtrack.jetbrains.com/issue/KT-24281) Importing of invoke() from the same file is reported as unused even if it isn't
|
||||
- [`KT-25050`](https://youtrack.jetbrains.com/issue/KT-25050) False-positive inspection "Call replaceable with binary operator" for 'equals'
|
||||
- [`KT-26361`](https://youtrack.jetbrains.com/issue/KT-26361) @Deprecated "ReplaceWith" quickfix inserts 'this' incorrectly when using function imports
|
||||
- [`KT-27651`](https://youtrack.jetbrains.com/issue/KT-27651) 'Condition is always true' inspection should not be triggered when the condition has references to a named constant
|
||||
- [`KT-29934`](https://youtrack.jetbrains.com/issue/KT-29934) False negative `Change type` quickfix on primary constructor override val parameter when it has wrong type
|
||||
- [`KT-31682`](https://youtrack.jetbrains.com/issue/KT-31682) 'Convert lambda to reference' intention inside class with function which return object produces uncompilable code
|
||||
- [`KT-31760`](https://youtrack.jetbrains.com/issue/KT-31760) Implement Abstract Function/Property intentions position generated member improperly
|
||||
- [`KT-32511`](https://youtrack.jetbrains.com/issue/KT-32511) Create class quick fix is not suggested in super type list in case of missing primary constructor
|
||||
- [`KT-32565`](https://youtrack.jetbrains.com/issue/KT-32565) False positive "Variable is the same as 'credentials' and should be inlined" with object declared and returned from lambda
|
||||
- [`KT-32801`](https://youtrack.jetbrains.com/issue/KT-32801) False positive "Call on collection type may be reduced" with mapNotNull, generic lambda block and new inference
|
||||
- [`KT-33951`](https://youtrack.jetbrains.com/issue/KT-33951) ReplaceWith quickfix with unqualified object member call doesn't substitute argument for parameter
|
||||
- [`KT-34378`](https://youtrack.jetbrains.com/issue/KT-34378) "Convert lambda to reference" refactoring does not work for suspend functions
|
||||
- [`KT-34677`](https://youtrack.jetbrains.com/issue/KT-34677) False positive "Collection count can be converted to size" with `Iterable`
|
||||
- [`KT-34696`](https://youtrack.jetbrains.com/issue/KT-34696) Wrong 'Redundant qualifier name' for 'MyEnum.values' usage
|
||||
- [`KT-34713`](https://youtrack.jetbrains.com/issue/KT-34713) "Condition is always 'false'": quickfix "Delete expression" doesn't remove `else` keyword (may break control flow)
|
||||
- [`KT-35015`](https://youtrack.jetbrains.com/issue/KT-35015) ReplaceWith doesn't substitute parameters with argument expressions
|
||||
- [`KT-35329`](https://youtrack.jetbrains.com/issue/KT-35329) Replace 'when' with 'if' intention: do not suggest if 'when' is used as expression and it has no 'else' branch
|
||||
- [`KT-36194`](https://youtrack.jetbrains.com/issue/KT-36194) "Add braces to 'for' statement" inserts extra line break and moves the following single-line comment
|
||||
- [`KT-36406`](https://youtrack.jetbrains.com/issue/KT-36406) "To ordinary string literal" intention adds unnecessary escapes to characters in template expression
|
||||
- [`KT-36461`](https://youtrack.jetbrains.com/issue/KT-36461) "Create enum constant" quick fix adds after semicolon, if the last entry has a comma
|
||||
- [`KT-36462`](https://youtrack.jetbrains.com/issue/KT-36462) "Create enum constant" quick fix doesn't add trailing comma
|
||||
- [`KT-36508`](https://youtrack.jetbrains.com/issue/KT-36508) False positive "Replace 'to' with infix form" when 'to' lambda generic type argument is specified explicitly
|
||||
- [`KT-36930`](https://youtrack.jetbrains.com/issue/KT-36930) Intention "Specify type explicitly" adds NotNull annotation when calling java method with the annotation
|
||||
- [`KT-37148`](https://youtrack.jetbrains.com/issue/KT-37148) "Remove redundant `.let` call doesn't remove extra calls
|
||||
- [`KT-37156`](https://youtrack.jetbrains.com/issue/KT-37156) "Unused unary operator" inspection highlighting is hard to see
|
||||
- [`KT-37173`](https://youtrack.jetbrains.com/issue/KT-37173) "Replace with string templates" intention for String.format produces uncompilable string template
|
||||
- [`KT-37181`](https://youtrack.jetbrains.com/issue/KT-37181) Don't show "Remove redundant qualifier name" inspection on qualified Companion imported with star import
|
||||
- [`KT-37214`](https://youtrack.jetbrains.com/issue/KT-37214) "Convert lambda to reference" with a labeled "this" receiver fails
|
||||
- [`KT-37256`](https://youtrack.jetbrains.com/issue/KT-37256) False positive `PlatformExtensionReceiverOfInline` inspection if a platform type value is passed to a nullable receiver
|
||||
- [`KT-37744`](https://youtrack.jetbrains.com/issue/KT-37744) "Convert lambda to reference" inspection quick fix create incompilable code when type is inferred from lambda parameter
|
||||
- [`KT-37746`](https://youtrack.jetbrains.com/issue/KT-37746) "Redundant suspend modifier" should not be reported for functions with actual keyword
|
||||
- [`KT-37842`](https://youtrack.jetbrains.com/issue/KT-37842) "Convert to anonymous function" creates broken code with suspend functions
|
||||
- [`KT-37908`](https://youtrack.jetbrains.com/issue/KT-37908) "Convert to anonymous object" quickfix: false negative when interface has concrete functions
|
||||
- [`KT-37967`](https://youtrack.jetbrains.com/issue/KT-37967) Replace 'invoke' with direct call intention adds unnecessary parenthesis
|
||||
- [`KT-37977`](https://youtrack.jetbrains.com/issue/KT-37977) "Replace 'invoke' with direct call" intention: false positive when function is not operator
|
||||
- [`KT-38062`](https://youtrack.jetbrains.com/issue/KT-38062) Reactor Quickfix throws `NotImplementedError` for Kotlin
|
||||
- [`KT-38240`](https://youtrack.jetbrains.com/issue/KT-38240) False positive redundant semicolon with `as` cast and `not` unary operator on next line
|
||||
- [`KT-38261`](https://youtrack.jetbrains.com/issue/KT-38261) Redundant 'let' call removal leaves ?. operator and makes code uncompilable
|
||||
- [`KT-38310`](https://youtrack.jetbrains.com/issue/KT-38310) Remove explicit type annotation intention drops 'suspend'
|
||||
- [`KT-38492`](https://youtrack.jetbrains.com/issue/KT-38492) False positive "Add import" intention for already imported class
|
||||
- [`KT-38520`](https://youtrack.jetbrains.com/issue/KT-38520) SetterBackingFieldAssignmentInspection throws exception
|
||||
- [`KT-38649`](https://youtrack.jetbrains.com/issue/KT-38649) False positive quickfix "Assignment should be lifted out of when" in presence of smartcasts
|
||||
- [`KT-38677`](https://youtrack.jetbrains.com/issue/KT-38677) Invalid psi tree after `Lift assigment out of...`
|
||||
- [`KT-38790`](https://youtrack.jetbrains.com/issue/KT-38790) "Convert sealed subclass to object" for data classes doesn't remove 'data' keyword
|
||||
- [`KT-38829`](https://youtrack.jetbrains.com/issue/KT-38829) 'Remove redundant backticks' can be broken with @ in name
|
||||
- [`KT-38831`](https://youtrack.jetbrains.com/issue/KT-38831) 'Replace with assignment' can be broken with fast code change
|
||||
- [`KT-38832`](https://youtrack.jetbrains.com/issue/KT-38832) "Remove curly braces" intention may produce CCE
|
||||
- [`KT-38948`](https://youtrack.jetbrains.com/issue/KT-38948) False positive quickfix "Make containing function suspend" for anonymous function
|
||||
- [`KT-38961`](https://youtrack.jetbrains.com/issue/KT-38961) "Useless call on collection type" for filterNotNull on non-null array where list return type is expected
|
||||
- [`KT-39069`](https://youtrack.jetbrains.com/issue/KT-39069) Improve TrailingCommaInspection
|
||||
- [`KT-39151`](https://youtrack.jetbrains.com/issue/KT-39151) False positive inspection to replace Java forEach with Kotlin forEach when using ConcurrentHashMap
|
||||
|
||||
### IDE. JS
|
||||
|
||||
- [`KT-39275`](https://youtrack.jetbrains.com/issue/KT-39275) Kotlin JS Browser template for kotlin dsl doesn't include index.html
|
||||
|
||||
### IDE. KDoc
|
||||
|
||||
- [`KT-32163`](https://youtrack.jetbrains.com/issue/KT-32163) Open Quick Documentation when cursor inside function / constructor brackets
|
||||
|
||||
### IDE. Navigation
|
||||
|
||||
- [`KT-32245`](https://youtrack.jetbrains.com/issue/KT-32245) Method in Kotlin class is not listed among implementing methods
|
||||
- [`KT-33510`](https://youtrack.jetbrains.com/issue/KT-33510) There is no gutter icon to navigate from `actual` to `expect` if `expect` and the corresponding `actual` declarations are in the same file
|
||||
- [`KT-38260`](https://youtrack.jetbrains.com/issue/KT-38260) Navigation bar doesn't show directories of files with a single top level Kotlin class
|
||||
- [`KT-38466`](https://youtrack.jetbrains.com/issue/KT-38466) Top level functions/properties aren't shown in navigation panel
|
||||
|
||||
### IDE. Project View
|
||||
|
||||
- [`KT-36444`](https://youtrack.jetbrains.com/issue/KT-36444) Structure view: add ability to sort by visibility
|
||||
- [`KT-38276`](https://youtrack.jetbrains.com/issue/KT-38276) Structure view: support visibility filter for class properties
|
||||
|
||||
### IDE. REPL
|
||||
|
||||
- [`KT-38454`](https://youtrack.jetbrains.com/issue/KT-38454) Kotlin REPL in IntelliJ doesn't take module's JVM target setting into account
|
||||
|
||||
### IDE. Refactorings
|
||||
|
||||
- [`KT-12878`](https://youtrack.jetbrains.com/issue/KT-12878) "Change signature" forces line breaks after every parameter declaration
|
||||
- [`KT-30128`](https://youtrack.jetbrains.com/issue/KT-30128) Change Signature should move lambda outside of parentheses if the arguments are reordered so that the lambda goes last
|
||||
- [`KT-35338`](https://youtrack.jetbrains.com/issue/KT-35338) Move/rename refactorings mess up code formatting by wrapping lines
|
||||
- [`KT-38449`](https://youtrack.jetbrains.com/issue/KT-38449) Extract variable refactoring is broken by NPE
|
||||
- [`KT-38543`](https://youtrack.jetbrains.com/issue/KT-38543) Copy can't work to package with escaped package
|
||||
- [`KT-38627`](https://youtrack.jetbrains.com/issue/KT-38627) Rename package refactorings mess up code formatting by wrapping lines
|
||||
|
||||
### IDE. Run Configurations
|
||||
|
||||
- [`KT-34516`](https://youtrack.jetbrains.com/issue/KT-34516) Don't suggest incompatible targets in a drop-down list for run test gutter icon in multiplatform projects
|
||||
- [`KT-38102`](https://youtrack.jetbrains.com/issue/KT-38102) DeprecatedMethodException ConfigurationFactory.getId
|
||||
|
||||
### IDE. Scratch
|
||||
|
||||
- [`KT-38455`](https://youtrack.jetbrains.com/issue/KT-38455) Kotlin scratch files don't take module's JVM target setting into account
|
||||
|
||||
### IDE. Script
|
||||
|
||||
- [`KT-39791`](https://youtrack.jetbrains.com/issue/KT-39791) Kotlin plugin loads VFS in the output directories
|
||||
|
||||
### IDE. Structural Search
|
||||
|
||||
- [`KT-39721`](https://youtrack.jetbrains.com/issue/KT-39721) Optimize Kotlin SSR by using the index
|
||||
- [`KT-39733`](https://youtrack.jetbrains.com/issue/KT-39733) Augmented assignment matching
|
||||
- [`KT-39769`](https://youtrack.jetbrains.com/issue/KT-39769) "When expressions" predefined template doesn't match all when expressions
|
||||
|
||||
### IDE. Wizards
|
||||
|
||||
- [`KT-38673`](https://youtrack.jetbrains.com/issue/KT-38673) New Project Wizard: multiplatform templates are generated having unsupported Gradle version in a wrapper
|
||||
- [`KT-38810`](https://youtrack.jetbrains.com/issue/KT-38810) Incorrect order of build phases in Xcode project from new wizard
|
||||
- [`KT-38952`](https://youtrack.jetbrains.com/issue/KT-38952) Remove old new_project_wizards
|
||||
- [`KT-39503`](https://youtrack.jetbrains.com/issue/KT-39503) New Project wizard 1.4+: release kotlinx.html version is added to dependencies with milestone IDE plugin
|
||||
- [`KT-39700`](https://youtrack.jetbrains.com/issue/KT-39700) Wizard: group project templates on the first step by the project type
|
||||
- [`KT-39770`](https://youtrack.jetbrains.com/issue/KT-39770) CSS Support in Kotlin wizards
|
||||
- [`KT-39826`](https://youtrack.jetbrains.com/issue/KT-39826) Fix Android app in New Template Wizard
|
||||
- [`KT-39843`](https://youtrack.jetbrains.com/issue/KT-39843) Change imports in JS/browser wizard
|
||||
|
||||
### JS. Tools
|
||||
|
||||
- [`KT-32273`](https://youtrack.jetbrains.com/issue/KT-32273) Kotlin/JS console error on hot reload
|
||||
- [`KT-39498`](https://youtrack.jetbrains.com/issue/KT-39498) Update dukat version in toolchain near to release of 1.4-M3
|
||||
|
||||
### JavaScript
|
||||
|
||||
- [`KT-29916`](https://youtrack.jetbrains.com/issue/KT-29916) Implement `typeOf` on JS
|
||||
- [`KT-35857`](https://youtrack.jetbrains.com/issue/KT-35857) Kotlin/JS CLI bundled to IDEA plugin can't compile using IR back-end out of the box
|
||||
- [`KT-36798`](https://youtrack.jetbrains.com/issue/KT-36798) KJS: prohibit using @JsExport on a non-top-level declaration
|
||||
- [`KT-37771`](https://youtrack.jetbrains.com/issue/KT-37771) KJS: Generated TypeScript does not recursively export base classes (can fail with generics)
|
||||
- [`KT-38113`](https://youtrack.jetbrains.com/issue/KT-38113) Review public API of JS stdlib for IR BE
|
||||
- [`KT-38765`](https://youtrack.jetbrains.com/issue/KT-38765) [JS / IR] AssertionError: class EventEmitter: Super class should be any: with nested class extending parent class
|
||||
- [`KT-38768`](https://youtrack.jetbrains.com/issue/KT-38768) KJS IR: generate ES2015 (aka ES6) classes
|
||||
|
||||
### Libraries
|
||||
|
||||
#### New Features
|
||||
|
||||
- [`KT-11253`](https://youtrack.jetbrains.com/issue/KT-11253) Function to sum long or other numeric property of items in a collection
|
||||
- [`KT-28933`](https://youtrack.jetbrains.com/issue/KT-28933) capitalize() with Locale argument in the JDK stdlib
|
||||
- [`KT-34142`](https://youtrack.jetbrains.com/issue/KT-34142) Create SortedMap with Comparator and items
|
||||
- [`KT-34506`](https://youtrack.jetbrains.com/issue/KT-34506) Add Sequence.flatMap overload that works on Iterable
|
||||
- [`KT-36894`](https://youtrack.jetbrains.com/issue/KT-36894) Support flatMapIndexed in the Collections API
|
||||
- [`KT-38480`](https://youtrack.jetbrains.com/issue/KT-38480) Introduce experimental annotation for enabling overload resolution by lambda result
|
||||
- [`KT-38708`](https://youtrack.jetbrains.com/issue/KT-38708) minOf/maxOf functions to return min/max value provided by selector
|
||||
- [`KT-39707`](https://youtrack.jetbrains.com/issue/KT-39707) Make some interfaces in stdlib functional
|
||||
|
||||
#### Performance Improvements
|
||||
|
||||
- [`KT-23142`](https://youtrack.jetbrains.com/issue/KT-23142) toHashSet is suboptimal for inputs with a lot of duplicates
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-21266`](https://youtrack.jetbrains.com/issue/KT-21266) Add module-info for standard library artifacts
|
||||
- [`KT-23322`](https://youtrack.jetbrains.com/issue/KT-23322) Document 'reduce' operation behavior on empty collections
|
||||
- [`KT-28753`](https://youtrack.jetbrains.com/issue/KT-28753) Comparing floating point values in array/list operations 'contains', 'indexOf', 'lastIndexOf': IEEE 754 or total order
|
||||
- [`KT-30083`](https://youtrack.jetbrains.com/issue/KT-30083) Annotate KTypeProjection.STAR with JvmField in a compatible way
|
||||
- [`KT-30084`](https://youtrack.jetbrains.com/issue/KT-30084) Annotate functions in KTypeProjection.Companion with JvmStatic
|
||||
- [`KT-31343`](https://youtrack.jetbrains.com/issue/KT-31343) Deprecate old String <-> CharArray, ByteArray conversion api
|
||||
- [`KT-34596`](https://youtrack.jetbrains.com/issue/KT-34596) Add some validation to KTypeProjection constructor
|
||||
- [`KT-35978`](https://youtrack.jetbrains.com/issue/KT-35978) Review and remove experimental stdlib API status for 1.4
|
||||
- [`KT-38388`](https://youtrack.jetbrains.com/issue/KT-38388) Document `fromIndex` and `toIndex` parameters
|
||||
- [`KT-38854`](https://youtrack.jetbrains.com/issue/KT-38854) Gradually change the return type of collection min/max functions to non-nullable
|
||||
- [`KT-39023`](https://youtrack.jetbrains.com/issue/KT-39023) Document split(Pattern) extension differences from Pattern.split
|
||||
- [`KT-39064`](https://youtrack.jetbrains.com/issue/KT-39064) Introduce minOrNull and maxOrNull extension functions on collections
|
||||
- [`KT-39235`](https://youtrack.jetbrains.com/issue/KT-39235) Lift experimental annotation from bit operations
|
||||
- [`KT-39237`](https://youtrack.jetbrains.com/issue/KT-39237) Lift experimental annotation from common StringBuilder
|
||||
- [`KT-39238`](https://youtrack.jetbrains.com/issue/KT-39238) Appendable.appendRange - remove nullability
|
||||
- [`KT-39239`](https://youtrack.jetbrains.com/issue/KT-39239) Lift experimental annotation from String <-> utf8 conversion api
|
||||
- [`KT-39244`](https://youtrack.jetbrains.com/issue/KT-39244) KJS: update polyfills, all or most of them must not be enumerable
|
||||
- [`KT-39330`](https://youtrack.jetbrains.com/issue/KT-39330) Migrate declarations from kotlin.dom and kotlin.browser packages to kotlinx.*
|
||||
|
||||
### Middle-end. IR
|
||||
|
||||
- [`KT-31088`](https://youtrack.jetbrains.com/issue/KT-31088) need a way to compute fake overrides for pure IR
|
||||
- [`KT-33207`](https://youtrack.jetbrains.com/issue/KT-33207) Kotlin/Native: KNPE during deserialization of an inner class
|
||||
- [`KT-33267`](https://youtrack.jetbrains.com/issue/KT-33267) Kotlin/Native: Deserialization error for an "inner" extension property imported from a class
|
||||
- [`KT-37255`](https://youtrack.jetbrains.com/issue/KT-37255) Make psi2ir aware of declarations provided by compiler plugins
|
||||
|
||||
### Reflection
|
||||
|
||||
- [`KT-22936`](https://youtrack.jetbrains.com/issue/KT-22936) Not all things can be changed to `createType` yet, and now `defaultType` methods are starting to fail
|
||||
- [`KT-32241`](https://youtrack.jetbrains.com/issue/KT-32241) Move KType.javaType into stdlib from reflect
|
||||
- [`KT-34344`](https://youtrack.jetbrains.com/issue/KT-34344) KType.javaType implementation throws when invoked with a typeOf<T>()
|
||||
- [`KT-38491`](https://youtrack.jetbrains.com/issue/KT-38491) IllegalArgumentException when using callBy on function with inline class parameters and default arguments
|
||||
- [`KT-38881`](https://youtrack.jetbrains.com/issue/KT-38881) Add KClass.isFun modifier of functional interfaces to reflection
|
||||
|
||||
### Tools. Android Extensions
|
||||
|
||||
- [`KT-25807`](https://youtrack.jetbrains.com/issue/KT-25807) Kotlin extension annotation @Parcelize in AIDL returns Object instead of original T
|
||||
|
||||
### Tools. CLI
|
||||
|
||||
- [`KT-30211`](https://youtrack.jetbrains.com/issue/KT-30211) Support a way to pass arguments to the underlying JVM in kotlinc batch scripts on Windows
|
||||
- [`KT-30778`](https://youtrack.jetbrains.com/issue/KT-30778) kotlin-compiler.jar contains shaded but not relocated kotlinx.coroutines
|
||||
- [`KT-38070`](https://youtrack.jetbrains.com/issue/KT-38070) Compiler option to bypass prerelease metadata incompatibility error
|
||||
- [`KT-38413`](https://youtrack.jetbrains.com/issue/KT-38413) Add JVM target bytecode version 14
|
||||
|
||||
### Tools. Compiler Plugins
|
||||
|
||||
- [`KT-39274`](https://youtrack.jetbrains.com/issue/KT-39274) [KJS / IR] Custom serializer for class without zero argument constructor doesn't compile
|
||||
|
||||
### Tools. Gradle
|
||||
|
||||
- [`KT-25428`](https://youtrack.jetbrains.com/issue/KT-25428) Kotlin Gradle Plugin: Use new Gradle API for Lazy tasks
|
||||
- [`KT-34487`](https://youtrack.jetbrains.com/issue/KT-34487) Gradle build fails with "Cannot run program "java": error=7, Argument list too long
|
||||
- [`KT-35957`](https://youtrack.jetbrains.com/issue/KT-35957) MPP IC fails with "X has several compatible actual declarations" error
|
||||
- [`KT-38250`](https://youtrack.jetbrains.com/issue/KT-38250) Drop support for Gradle versions older than 5.3 in the Kotlin Gradle plugin
|
||||
|
||||
### Tools. Gradle. JS
|
||||
|
||||
#### New Features
|
||||
|
||||
- [`KT-30619`](https://youtrack.jetbrains.com/issue/KT-30619) Support NPM transitive dependencies in multi-platform JS target
|
||||
- [`KT-38286`](https://youtrack.jetbrains.com/issue/KT-38286) [Gradle, JS] Error handling on Webpack problems
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-31669`](https://youtrack.jetbrains.com/issue/KT-31669) Gradle/JS: rise error when plugin loaded more than once
|
||||
- [`KT-32531`](https://youtrack.jetbrains.com/issue/KT-32531) [Gradle/JS] Add scoped NPM dependencies
|
||||
- [`KT-34832`](https://youtrack.jetbrains.com/issue/KT-34832) [Kotlin/JS] Failed build after webpack run (Karma not found)
|
||||
- [`KT-35194`](https://youtrack.jetbrains.com/issue/KT-35194) Kotlin/JS: browserRun fails with "address already in use" when trying to connect to local server
|
||||
- [`KT-35611`](https://youtrack.jetbrains.com/issue/KT-35611) Kotlin Gradle plugin should report `kotlin2js` plugin ID as deprecated
|
||||
- [`KT-35641`](https://youtrack.jetbrains.com/issue/KT-35641) Kotlin Gradle plugin should report `kotlin-dce-js` plugin ID as deprecated
|
||||
- [`KT-36410`](https://youtrack.jetbrains.com/issue/KT-36410) JS: Collect stats about IR backend usage
|
||||
- [`KT-36451`](https://youtrack.jetbrains.com/issue/KT-36451) KJS Adding npm dependency breaks Webpack devserver reloading
|
||||
- [`KT-37258`](https://youtrack.jetbrains.com/issue/KT-37258) Kotlin/JS + Gradle: in continuous mode kotlinNpmInstall time to time outputs "ENOENT: no such file or directory" error
|
||||
- [`KT-38109`](https://youtrack.jetbrains.com/issue/KT-38109) [Gradle, JS] Error handling on Karma launcher problems
|
||||
- [`KT-38331`](https://youtrack.jetbrains.com/issue/KT-38331) Add an ability to control generating externals for npm deps individually
|
||||
- [`KT-38485`](https://youtrack.jetbrains.com/issue/KT-38485) [Gradle, JS] Unable to configure JS compiler with string
|
||||
- [`KT-38683`](https://youtrack.jetbrains.com/issue/KT-38683) Remove possibility to set NPM dependency without version
|
||||
- [`KT-38990`](https://youtrack.jetbrains.com/issue/KT-38990) Support multiple range versions for NPM dependencies
|
||||
- [`KT-38994`](https://youtrack.jetbrains.com/issue/KT-38994) Remove possibility to set NPM dependency with npm(org, name, version)
|
||||
- [`KT-39109`](https://youtrack.jetbrains.com/issue/KT-39109) ArithmeticException: "/ by zero" caused by kotlinNodeJsSetup task with enabled gradle caching on Windows
|
||||
- [`KT-39210`](https://youtrack.jetbrains.com/issue/KT-39210) Kotlin/JS: with both JS and MPP modules in the same project Gradle configuration fails on `nodejs {}` and `browser {}`
|
||||
- [`KT-39377`](https://youtrack.jetbrains.com/issue/KT-39377) Use standard source-map-loader instead of custom one
|
||||
|
||||
### Tools. Gradle. Multiplatform
|
||||
|
||||
- [`KT-39184`](https://youtrack.jetbrains.com/issue/KT-39184) Support publication of Kotlin-distributed libraries with Gradle Metadata
|
||||
- [`KT-39304`](https://youtrack.jetbrains.com/issue/KT-39304) Gradle import error `java.util.NoSuchElementException: Key source set foo is missing in the map` on unused source set
|
||||
|
||||
### Tools. Gradle. Native
|
||||
|
||||
- [`KT-37514`](https://youtrack.jetbrains.com/issue/KT-37514) CocoaPods Gradle plugin: Support building from terminal projects for several platforms
|
||||
- [`KT-38440`](https://youtrack.jetbrains.com/issue/KT-38440) Make error message about missing Podfile path for cocoapods integration actionable for a user
|
||||
- [`KT-38991`](https://youtrack.jetbrains.com/issue/KT-38991) Gradle MPP plugin: Enable parallel in-process execution for K/N compiler
|
||||
- [`KT-39935`](https://youtrack.jetbrains.com/issue/KT-39935) Support overriding the `KotlinNativeCompile` task sources
|
||||
- [`KT-37512`](https://youtrack.jetbrains.com/issue/KT-37512) Cocoapods Gradle plugin: Improve error logging for external tools
|
||||
|
||||
### Tools. J2K
|
||||
|
||||
- [`KT-35169`](https://youtrack.jetbrains.com/issue/KT-35169) Do not show "Inline local variable" popup during "Cleaning up code" phase of J2K
|
||||
- [`KT-38004`](https://youtrack.jetbrains.com/issue/KT-38004) J2K breaks java getter call in java code
|
||||
- [`KT-38450`](https://youtrack.jetbrains.com/issue/KT-38450) J2K should convert Java SAM interfaces to Kotlin fun interfaces
|
||||
|
||||
### Tools. JPS
|
||||
|
||||
- [`KT-27458`](https://youtrack.jetbrains.com/issue/KT-27458) The Kotlin standard library is not found in the module graph ... in a non-Kotlin project.
|
||||
- [`KT-29552`](https://youtrack.jetbrains.com/issue/KT-29552) Project is completely rebuilt after each gradle sync.
|
||||
|
||||
### Tools. Scripts
|
||||
|
||||
- [`KT-37766`](https://youtrack.jetbrains.com/issue/KT-37766) Impossible to apply compiler plugins onto scripts with the new scripting API
|
||||
|
||||
### Tools. kapt
|
||||
|
||||
- [`KT-29355`](https://youtrack.jetbrains.com/issue/KT-29355) Provide access to default values for primary constructor properties
|
||||
|
||||
|
||||
## 1.4-M2
|
||||
|
||||
### Compiler
|
||||
@@ -100,6 +599,8 @@
|
||||
- [`KT-38668`](https://youtrack.jetbrains.com/issue/KT-38668) Project with module dependency in KN, build fails with Kotlin 1.3.71 and associated libs but passes with 1.3.61.
|
||||
- [`KT-38857`](https://youtrack.jetbrains.com/issue/KT-38857) Class versions V1_5 or less must use F_NEW frames.
|
||||
- [`KT-39113`](https://youtrack.jetbrains.com/issue/KT-39113) "AssertionError: Uninitialized value on stack" with EXACTLY_ONCE contract in non-inline function and lambda destructuring
|
||||
- [`KT-28483`](https://youtrack.jetbrains.com/issue/KT-28483) Override of generic-return-typed function with inline class should lead to a boxing
|
||||
- [`KT-37963`](https://youtrack.jetbrains.com/issue/KT-37963) ClassCastException: Value of inline class represented as 'java.lang.Object' is not boxed properly on return from lambda
|
||||
|
||||
### Docs & Examples
|
||||
|
||||
@@ -325,6 +826,7 @@
|
||||
- [`KT-38579`](https://youtrack.jetbrains.com/issue/KT-38579) New Project wizard 1.4+: multiplatform mobile application: build fails on lint task: Configuration with name 'compileClasspath' not found
|
||||
- [`KT-38929`](https://youtrack.jetbrains.com/issue/KT-38929) New project wizard: update libraries in project template according to kotlin IDE plugin version
|
||||
- [`KT-38417`](https://youtrack.jetbrains.com/issue/KT-38417) Enable new project wizard by-default
|
||||
- [`KT-38158`](https://youtrack.jetbrains.com/issue/KT-38158) java.lang.NullPointerException when try to create new project via standard wizard on Mac os
|
||||
|
||||
### JS. Tools
|
||||
|
||||
@@ -377,6 +879,7 @@
|
||||
- [`KT-16529`](https://youtrack.jetbrains.com/issue/KT-16529) Names of KProperty's type parameters are inconsistent with ReadOnlyProperty/ReadWriteProperty
|
||||
- [`KT-36356`](https://youtrack.jetbrains.com/issue/KT-36356) Specify which element Iterable.distinctBy(selector) retains
|
||||
- [`KT-38060`](https://youtrack.jetbrains.com/issue/KT-38060) runningFold and runningReduce instead of scanReduce
|
||||
- [`KT-38566`](https://youtrack.jetbrains.com/issue/KT-38566) Kotlin/JS IR: kx.serialization & ktor+JsonFeature: SerializationException: Can't locate argument-less serializer for class
|
||||
|
||||
### Reflection
|
||||
|
||||
@@ -1006,6 +1509,33 @@
|
||||
- [`KT-35414`](https://youtrack.jetbrains.com/issue/KT-35414) Switch for `-Xexpression` to `-expression`/`-e` cli argument syntax for JVM cli compiler in 1.4
|
||||
|
||||
|
||||
## 1.3.72 - IDE plugins update
|
||||
|
||||
### Backend. JVM
|
||||
|
||||
- [`KT-39013`](https://youtrack.jetbrains.com/issue/KT-39013) 202, ASM 8: "AnalyzerException: Execution can fall off the end of the code"
|
||||
|
||||
### IDE. Decompiler, Indexing, Stubs
|
||||
|
||||
- [`KT-37896`](https://youtrack.jetbrains.com/issue/KT-37896) IAE: "Argument for @NotNull parameter 'file' of IndexTodoCacheManagerImpl.getTodoCount must not be null" through KotlinTodoSearcher.processQuery()
|
||||
|
||||
### IDE. Gradle Integration
|
||||
|
||||
- [`KT-38037`](https://youtrack.jetbrains.com/issue/KT-38037) UnsupportedOperationException on sync gradle Kotlin project with at least two multiplatform modules
|
||||
|
||||
### IDE. Highlighting
|
||||
|
||||
- [`KT-39590`](https://youtrack.jetbrains.com/issue/KT-39590) Turn new inference in IDE for 1.3.70 version off
|
||||
|
||||
### IDE. Refactorings
|
||||
|
||||
- [`KT-38527`](https://youtrack.jetbrains.com/issue/KT-38527) Move nested class to upper level fails silently: MissingResourceException
|
||||
|
||||
### Tools.JPS
|
||||
|
||||
- [`KT-27458`](https://youtrack.jetbrains.com/issue/KT-27458) The Kotlin standard library is not found in the module graph ... in a non-Kotlin project.
|
||||
|
||||
|
||||
## 1.3.72
|
||||
|
||||
### Compiler
|
||||
|
||||
@@ -41,7 +41,12 @@ For local development, if you're not working on bytecode generation or the stand
|
||||
|
||||
You also can use [Gradle properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties) to setup `JDK_*` variables.
|
||||
|
||||
> Note: The JDK 6 for MacOS is not available on Oracle's site. You can [download it here](https://support.apple.com/kb/DL1572).
|
||||
Note: The JDK 6 for MacOS is not available on Oracle's site. You can install it by
|
||||
|
||||
```bash
|
||||
$ brew tap caskroom/versions
|
||||
$ brew cask install java6
|
||||
```
|
||||
|
||||
On Windows you might need to add long paths setting to the repo:
|
||||
|
||||
@@ -81,6 +86,8 @@ command line parameters on the first run:
|
||||
- `compilerTest` - build and run all compiler tests
|
||||
- `ideaPluginTest` - build and run all IDEA plugin tests
|
||||
|
||||
To reproduce TeamCity build use `-Pteamcity=true` flag. Local builds don't run proguard and have jar compression disabled by default.
|
||||
|
||||
**OPTIONAL:** Some artifacts, mainly Maven plugin ones, are built separately with Maven.
|
||||
Refer to [libraries/ReadMe.md](libraries/ReadMe.md) for details.
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ repositories {
|
||||
dependencies {
|
||||
compile(kotlinStdlib())
|
||||
compile(project(":compiler:frontend"))
|
||||
compile(projectTests(":compiler:tests-common"))
|
||||
compile(project(":compiler:cli"))
|
||||
compile(intellijCoreDep()) { includeJars("intellij-core") }
|
||||
compile(jpsStandalone()) { includeJars("jps-model") }
|
||||
@@ -95,3 +96,52 @@ benchmark {
|
||||
register("main")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("classes") {
|
||||
doLast {
|
||||
tasks.named("mainBenchmarkJar", Zip::class.java) {
|
||||
isZip64 = true
|
||||
archiveName = "benchmarks.jar"
|
||||
}
|
||||
listOf("mainBenchmark", "mainFirBenchmark", "mainNiBenchmark").forEach {
|
||||
tasks.named(it, JavaExec::class.java) {
|
||||
systemProperty("idea.home.path", intellijRootDir().canonicalPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*tasks.register<JavaExec>("runBenchmark") {
|
||||
val jmhArgs: String by project // example: -PjmhArgs='CommonCalls -p size=500 -p isIR=true -p useNI=true -f 1'
|
||||
val resultFilePath = "$buildDir/benchmarks/jmh-result.json"
|
||||
val ideaHome = intellijRootDir().canonicalPath
|
||||
|
||||
val benchmarkJarPath = "$buildDir/benchmarks/main/jars/benchmarks.jar"
|
||||
args = mutableListOf("-Didea.home.path=$ideaHome", benchmarkJarPath, "-rf", "json", "-rff", resultFilePath) + jmhArgs.split("\\s".toRegex())
|
||||
main = "-jar"
|
||||
|
||||
|
||||
doLast {
|
||||
if (project.kotlinBuildProperties.isTeamcityBuild) {
|
||||
val jsonArray = com.google.gson.JsonParser.parseString(File(resultFilePath).readText()).asJsonArray
|
||||
jsonArray.forEach {
|
||||
val benchmark = it.asJsonObject
|
||||
// remove unnecessary name parts from string like this "org.jetbrains.kotlin.benchmarks.CommonCallsBenchmark.benchmark"
|
||||
val name = benchmark["benchmark"].asString.removeSuffix(".benchmark").let {
|
||||
val indexOfLastDot = it.indexOfLast { it == '.' }
|
||||
it.removeRange(0..indexOfLastDot)
|
||||
}
|
||||
val params = benchmark["params"].asJsonObject
|
||||
val isIR = if (params.has("isIR")) params["isIR"].asString else "false"
|
||||
val useNI = if (params.has("useNI")) params["useNI"].asString else "false"
|
||||
val size = params["size"].asString
|
||||
val score = "%.3f".format(benchmark["primaryMetric"].asJsonObject["score"].asString.toFloat())
|
||||
|
||||
val irPostfix = if (isIR.toBoolean()) " isIR=true" else ""
|
||||
val niPostfix = if (useNI.toBoolean() && !isIR.toBoolean()) " isNI=true" else ""
|
||||
|
||||
println("""##teamcity[buildStatisticValue key='$name size=$size${irPostfix}$niPostfix' value='$score']""")
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.intellij.psi.PsiFileFactory
|
||||
import com.intellij.psi.impl.PsiFileFactoryImpl
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import com.intellij.testFramework.LightVirtualFile
|
||||
import org.jetbrains.kotlin.analyzer.ModuleInfo
|
||||
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
|
||||
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
|
||||
import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys
|
||||
@@ -26,21 +25,15 @@ import org.jetbrains.kotlin.context.withModule
|
||||
import org.jetbrains.kotlin.context.withProject
|
||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||
import org.jetbrains.kotlin.diagnostics.Severity
|
||||
import org.jetbrains.kotlin.fir.FirSession
|
||||
import org.jetbrains.kotlin.fir.builder.RawFirBuilder
|
||||
import org.jetbrains.kotlin.fir.java.FirJavaModuleBasedSession
|
||||
import org.jetbrains.kotlin.fir.java.FirLibrarySession
|
||||
import org.jetbrains.kotlin.fir.java.FirProjectSessionProvider
|
||||
import org.jetbrains.kotlin.fir.createSession
|
||||
import org.jetbrains.kotlin.fir.java.FirJavaElementFinder
|
||||
import org.jetbrains.kotlin.fir.resolve.firProvider
|
||||
import org.jetbrains.kotlin.fir.resolve.providers.impl.FirProviderImpl
|
||||
import org.jetbrains.kotlin.fir.resolve.transformers.FirTotalResolveProcessor
|
||||
import org.jetbrains.kotlin.idea.KotlinLanguage
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
import org.jetbrains.kotlin.platform.jvm.JvmPlatforms
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.PlatformDependentAnalyzerServices
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatformAnalyzerServices
|
||||
import org.jetbrains.kotlin.storage.ExceptionTracker
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
@@ -170,43 +163,10 @@ abstract class AbstractSimpleFileBenchmark {
|
||||
totalTransformer.process(listOf(firFile))
|
||||
|
||||
bh.consume(firFile.hashCode())
|
||||
Extensions.getArea(env.project)
|
||||
.getExtensionPoint(PsiElementFinder.EP_NAME)
|
||||
.unregisterExtension(FirJavaElementFinder::class.java)
|
||||
}
|
||||
|
||||
protected abstract fun buildText(): String
|
||||
}
|
||||
|
||||
fun createSession(
|
||||
environment: KotlinCoreEnvironment,
|
||||
sourceScope: GlobalSearchScope,
|
||||
librariesScope: GlobalSearchScope = GlobalSearchScope.notScope(sourceScope)
|
||||
): FirSession {
|
||||
val moduleInfo = FirTestModuleInfo()
|
||||
val project = environment.project
|
||||
val provider = FirProjectSessionProvider(project)
|
||||
return FirJavaModuleBasedSession.create(moduleInfo, provider, sourceScope).also {
|
||||
createSessionForDependencies(provider, moduleInfo, librariesScope, environment)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createSessionForDependencies(
|
||||
provider: FirProjectSessionProvider,
|
||||
moduleInfo: FirTestModuleInfo,
|
||||
librariesScope: GlobalSearchScope,
|
||||
environment: KotlinCoreEnvironment
|
||||
) {
|
||||
val dependenciesInfo = FirTestModuleInfo()
|
||||
moduleInfo.dependencies.add(dependenciesInfo)
|
||||
FirLibrarySession.create(
|
||||
dependenciesInfo, provider, librariesScope, environment.project,
|
||||
environment.createPackagePartProvider(librariesScope)
|
||||
)
|
||||
}
|
||||
|
||||
class FirTestModuleInfo(
|
||||
override val name: Name = Name.identifier("TestModule"),
|
||||
val dependencies: MutableList<ModuleInfo> = mutableListOf(),
|
||||
override val platform: TargetPlatform = JvmPlatforms.unspecifiedJvmPlatform,
|
||||
override val analyzerServices: PlatformDependentAnalyzerServices = JvmPlatformAnalyzerServices
|
||||
) : ModuleInfo {
|
||||
override fun dependencies(): List<ModuleInfo> = dependencies
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.incremental.storage
|
||||
|
||||
import com.intellij.util.io.DataExternalizer
|
||||
import com.intellij.util.io.KeyDescriptor
|
||||
import com.intellij.util.io.JpsPersistentHashMap
|
||||
import com.intellij.util.io.PersistentHashMap
|
||||
import java.io.File
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ class NonCachingLazyStorage<K, V>(
|
||||
private val valueExternalizer: DataExternalizer<V>
|
||||
) : LazyStorage<K, V> {
|
||||
@Volatile
|
||||
private var storage: JpsPersistentHashMap<K, V>? = null
|
||||
private var storage: PersistentHashMap<K, V>? = null
|
||||
|
||||
@Synchronized
|
||||
private fun getStorageIfExists(): JpsPersistentHashMap<K, V>? {
|
||||
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
|
||||
if (storage != null) return storage
|
||||
|
||||
if (storageFile.exists()) {
|
||||
@@ -43,7 +43,7 @@ class NonCachingLazyStorage<K, V>(
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun getStorageOrCreateNew(): JpsPersistentHashMap<K, V> {
|
||||
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
|
||||
if (storage == null) {
|
||||
storage = createMap()
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class NonCachingLazyStorage<K, V>(
|
||||
}
|
||||
|
||||
override fun append(key: K, value: V) {
|
||||
getStorageOrCreateNew().appendDataWithoutCache(key, value)
|
||||
getStorageOrCreateNew().appendData(key) { dataOutput -> valueExternalizer.save(dataOutput, value) }
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
@@ -79,7 +79,7 @@ class NonCachingLazyStorage<K, V>(
|
||||
} catch (ignored: Throwable) {
|
||||
}
|
||||
|
||||
JpsPersistentHashMap.deleteFilesStartingWith(storageFile)
|
||||
PersistentHashMap.deleteFilesStartingWith(storageFile)
|
||||
storage = null
|
||||
}
|
||||
|
||||
@@ -101,6 +101,6 @@ class NonCachingLazyStorage<K, V>(
|
||||
storage?.close()
|
||||
}
|
||||
|
||||
private fun createMap(): JpsPersistentHashMap<K, V> =
|
||||
JpsPersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
|
||||
private fun createMap(): PersistentHashMap<K, V> =
|
||||
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.incremental.storage
|
||||
|
||||
import com.intellij.util.io.DataExternalizer
|
||||
import com.intellij.util.io.KeyDescriptor
|
||||
import com.intellij.util.io.PersistentHashMap
|
||||
import com.intellij.util.io.JpsPersistentHashMap
|
||||
import java.io.File
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ class NonCachingLazyStorage<K, V>(
|
||||
private val valueExternalizer: DataExternalizer<V>
|
||||
) : LazyStorage<K, V> {
|
||||
@Volatile
|
||||
private var storage: PersistentHashMap<K, V>? = null
|
||||
private var storage: JpsPersistentHashMap<K, V>? = null
|
||||
|
||||
@Synchronized
|
||||
private fun getStorageIfExists(): PersistentHashMap<K, V>? {
|
||||
private fun getStorageIfExists(): JpsPersistentHashMap<K, V>? {
|
||||
if (storage != null) return storage
|
||||
|
||||
if (storageFile.exists()) {
|
||||
@@ -43,7 +43,7 @@ class NonCachingLazyStorage<K, V>(
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
private fun getStorageOrCreateNew(): PersistentHashMap<K, V> {
|
||||
private fun getStorageOrCreateNew(): JpsPersistentHashMap<K, V> {
|
||||
if (storage == null) {
|
||||
storage = createMap()
|
||||
}
|
||||
@@ -69,7 +69,7 @@ class NonCachingLazyStorage<K, V>(
|
||||
}
|
||||
|
||||
override fun append(key: K, value: V) {
|
||||
getStorageOrCreateNew().appendData(key) { dataOutput -> valueExternalizer.save(dataOutput, value) }
|
||||
getStorageOrCreateNew().appendDataWithoutCache(key, value)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
@@ -79,7 +79,7 @@ class NonCachingLazyStorage<K, V>(
|
||||
} catch (ignored: Throwable) {
|
||||
}
|
||||
|
||||
PersistentHashMap.deleteFilesStartingWith(storageFile)
|
||||
JpsPersistentHashMap.deleteFilesStartingWith(storageFile)
|
||||
storage = null
|
||||
}
|
||||
|
||||
@@ -101,6 +101,6 @@ class NonCachingLazyStorage<K, V>(
|
||||
storage?.close()
|
||||
}
|
||||
|
||||
private fun createMap(): PersistentHashMap<K, V> =
|
||||
PersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
|
||||
private fun createMap(): JpsPersistentHashMap<K, V> =
|
||||
JpsPersistentHashMap(storageFile, keyDescriptor, valueExternalizer)
|
||||
}
|
||||
@@ -27,7 +27,7 @@ buildscript {
|
||||
dependencies {
|
||||
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
|
||||
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.19")
|
||||
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
|
||||
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
|
||||
}
|
||||
@@ -152,6 +152,7 @@ rootProject.apply {
|
||||
from(rootProject.file("gradle/jps.gradle.kts"))
|
||||
from(rootProject.file("gradle/checkArtifacts.gradle.kts"))
|
||||
from(rootProject.file("gradle/checkCacheability.gradle.kts"))
|
||||
from(rootProject.file("gradle/retryPublishing.gradle.kts"))
|
||||
}
|
||||
|
||||
IdeVersionConfigurator.setCurrentIde(project)
|
||||
@@ -192,6 +193,7 @@ if (!project.hasProperty("versions.kotlin-native")) {
|
||||
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
|
||||
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
|
||||
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
|
||||
val useJvmIrBackend by extra(project.getBooleanProperty("kotlin.build.useIR") ?: false)
|
||||
|
||||
val intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
|
||||
|
||||
@@ -365,6 +367,15 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
configurations.maybeCreate("embeddedElements").apply {
|
||||
extendsFrom(configurations["embedded"])
|
||||
isCanBeConsumed = true
|
||||
isCanBeResolved = false
|
||||
attributes {
|
||||
attribute(Usage.USAGE_ATTRIBUTE, objects.named("embedded-java-runtime"))
|
||||
}
|
||||
}
|
||||
|
||||
jvmTarget = defaultJvmTarget
|
||||
javaHome = defaultJavaHome
|
||||
|
||||
@@ -395,9 +406,6 @@ allprojects {
|
||||
val commonCompilerArgs = listOfNotNull(
|
||||
"-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xread-deserialized-contracts",
|
||||
"-Xjvm-default=compatibility",
|
||||
"-Xno-optimized-callable-references",
|
||||
"-Xno-kotlin-nothing-value-exception",
|
||||
"-progressive".takeIf { hasProperty("test.progressive.mode") }
|
||||
)
|
||||
|
||||
@@ -409,9 +417,20 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
val jvmCompilerArgs = listOf(
|
||||
"-Xjvm-default=compatibility",
|
||||
"-Xno-optimized-callable-references",
|
||||
"-Xno-kotlin-nothing-value-exception",
|
||||
"-Xnormalize-constructor-calls=enable"
|
||||
)
|
||||
|
||||
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinJvmCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = commonCompilerArgs + listOf("-Xnormalize-constructor-calls=enable")
|
||||
freeCompilerArgs = commonCompilerArgs + jvmCompilerArgs
|
||||
|
||||
if (useJvmIrBackend) {
|
||||
useIR = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,6 +460,7 @@ allprojects {
|
||||
ignore("META-INF/MANIFEST.MF")
|
||||
ignore("META-INF/compiler.version")
|
||||
ignore("META-INF/plugin.xml")
|
||||
ignore("kotlin/KotlinVersionCurrentValue.class")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -497,9 +517,12 @@ gradle.taskGraph.whenReady {
|
||||
fun Boolean.toOnOff(): String = if (this) "on" else "off"
|
||||
val profile = if (isTeamcityBuild) "CI" else "Local"
|
||||
|
||||
logger.warn("$profile build profile is active (proguard is ${kotlinBuildProperties.proguard.toOnOff()}" +
|
||||
", jar compression is ${kotlinBuildProperties.jarCompression.toOnOff()})." +
|
||||
" Use -Pteamcity=<true|false> to reproduce CI/local build")
|
||||
val proguardMessage = "proguard is ${kotlinBuildProperties.proguard.toOnOff()}"
|
||||
val jarCompressionMessage = "jar compression is ${kotlinBuildProperties.jarCompression.toOnOff()}"
|
||||
val profileMessage = "$profile build profile is active ($proguardMessage, $jarCompressionMessage). " +
|
||||
"Use -Pteamcity=<true|false> to reproduce CI/local build"
|
||||
|
||||
logger.warn("\n\n$profileMessage")
|
||||
|
||||
allTasks.filterIsInstance<org.gradle.jvm.tasks.Jar>().forEach { task ->
|
||||
task.entryCompression = if (kotlinBuildProperties.jarCompression)
|
||||
@@ -513,6 +536,10 @@ val dist = tasks.register("dist") {
|
||||
dependsOn(":kotlin-compiler:dist")
|
||||
}
|
||||
|
||||
val syncMutedTests = tasks.register("syncMutedTests") {
|
||||
dependsOn(":compiler:tests-mutes:run")
|
||||
}
|
||||
|
||||
val copyCompilerToIdeaPlugin by task<Copy> {
|
||||
dependsOn(dist)
|
||||
into(ideaPluginDir)
|
||||
@@ -637,6 +664,7 @@ tasks {
|
||||
dependsOn(":kotlin-scripting-jsr223-test:embeddableTest")
|
||||
dependsOn(":kotlin-main-kts-test:test")
|
||||
dependsOn(":kotlin-scripting-ide-services-test:test")
|
||||
dependsOn(":kotlin-scripting-ide-services-test:embeddableTest")
|
||||
dependsOn(":kotlin-scripting-js-test:test")
|
||||
}
|
||||
|
||||
@@ -701,8 +729,6 @@ tasks {
|
||||
register("idea-plugin-additional-tests") {
|
||||
dependsOn("dist")
|
||||
dependsOn(
|
||||
":idea:idea-gradle:test",
|
||||
":idea:idea-gradle-native:test",
|
||||
":idea:idea-maven:test",
|
||||
":j2k:test",
|
||||
":nj2k:test",
|
||||
@@ -769,15 +795,33 @@ tasks {
|
||||
|
||||
|
||||
register("ideaPluginTest") {
|
||||
dependsOn(
|
||||
"gradleIdeTest",
|
||||
"androidIdeTest",
|
||||
"miscIdeTests"
|
||||
)
|
||||
}
|
||||
|
||||
register("miscIdeTests") {
|
||||
dependsOn(
|
||||
"idea-plugin-tests",
|
||||
"jps-tests",
|
||||
"plugins-tests",
|
||||
"android-ide-tests",
|
||||
":generators:test"
|
||||
)
|
||||
}
|
||||
|
||||
register("androidIdeTest") {
|
||||
dependsOn("android-ide-tests")
|
||||
}
|
||||
|
||||
register("gradleIdeTest") {
|
||||
dependsOn(
|
||||
":idea:idea-gradle:test",
|
||||
":idea:idea-gradle-native:test"
|
||||
)
|
||||
}
|
||||
|
||||
register("publishIdeArtifacts") {
|
||||
idePluginDependency {
|
||||
dependsOn(
|
||||
@@ -812,6 +856,21 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
register("kmmTest", AggregateTest::class) {
|
||||
dependsOn(
|
||||
":idea:idea-gradle:test",
|
||||
":idea:test",
|
||||
":compiler:test",
|
||||
":js:js.tests:test"
|
||||
)
|
||||
if (Ide.IJ193.orHigher())
|
||||
dependsOn(":kotlin-gradle-plugin-integration-tests:test")
|
||||
if (Ide.AS40.orHigher())
|
||||
dependsOn(":kotlin-ultimate:ide:android-studio-native:test")
|
||||
|
||||
testPatternFile = file("tests/mpp/kmm-patterns.csv")
|
||||
}
|
||||
|
||||
register("test") {
|
||||
doLast {
|
||||
throw GradleException("Don't use directly, use aggregate tasks *-check instead")
|
||||
@@ -1061,4 +1120,4 @@ if (disableVerificationTasks) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.19")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${project.bootstrapKotlinVersion}")
|
||||
}
|
||||
@@ -96,7 +96,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib", embeddedKotlinVersion))
|
||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.19")
|
||||
implementation("com.gradle.publish:plugin-publish-plugin:0.11.0")
|
||||
|
||||
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
@file:Suppress("PropertyName", "HasPlatformType", "UnstableApiUsage")
|
||||
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import org.jetbrains.kotlin.gradle.tasks.internal.CleanableStore
|
||||
import java.io.Closeable
|
||||
import java.io.OutputStreamWriter
|
||||
import java.net.URI
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import javax.xml.stream.XMLOutputFactory
|
||||
|
||||
import org.jetbrains.kotlin.gradle.tasks.internal.CleanableStore
|
||||
import java.time.Duration
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
import javax.xml.stream.XMLOutputFactory
|
||||
|
||||
plugins {
|
||||
base
|
||||
@@ -180,6 +179,7 @@ val mergeSources by tasks.creating(Jar::class.java) {
|
||||
dependsOn(sources)
|
||||
isPreserveFileTimestamps = false
|
||||
isReproducibleFileOrder = true
|
||||
isZip64 = true
|
||||
if (!kotlinBuildProperties.isTeamcityBuild) {
|
||||
from(provider { sources.map(::zipTree) })
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.17")
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.19")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
72
buildSrc/src/main/kotlin/AggregateTest.kt
Normal file
72
buildSrc/src/main/kotlin/AggregateTest.kt
Normal file
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
import org.gradle.api.GradleException
|
||||
import org.gradle.api.tasks.*
|
||||
import org.gradle.api.tasks.testing.Test
|
||||
import java.io.File
|
||||
|
||||
// You can see "How To" via link: https://jetbrains.quip.com/xQ2WAUy9bZmy/How-to-use-AggregateTest-task
|
||||
open class AggregateTest : Test() { // Inherit from Test to see test results in IDEA Test viewer
|
||||
private var patterns: MutableMap<String, MutableList<String>> = mutableMapOf()
|
||||
|
||||
@InputFile
|
||||
lateinit var testPatternFile: File
|
||||
|
||||
init {
|
||||
// Set empty FileCollection to avoid NPE when initializing a base 'Test' class
|
||||
classpath = project.objects.fileCollection()
|
||||
testClassesDirs = project.objects.fileCollection()
|
||||
|
||||
project.gradle.taskGraph.whenReady {
|
||||
if (allTasks.filterIsInstance<AggregateTest>().isNotEmpty()) {
|
||||
initPatterns()
|
||||
allTasks.filterIsInstance<Test>().forEach { testTask -> subTaskConfigure(testTask) }
|
||||
|
||||
if (!project.gradle.startParameter.taskNames.all { project.tasks.findByPath(it) is AggregateTest }) {
|
||||
logger.warn("Please, don't use AggregateTest and non-AggregateTest test tasks together. You can get incorrect results.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun initPatterns() {
|
||||
if (!testPatternFile.exists())
|
||||
throw GradleException("File with test patterns is not found")
|
||||
testPatternFile
|
||||
.readLines()
|
||||
.asSequence()
|
||||
.filter { it.isNotEmpty() }
|
||||
.forEach { line ->
|
||||
// patternType is exclude or include value
|
||||
val (pattern, patternType) = line.split(',').map { it.trim() }
|
||||
patterns.getOrPut(patternType) { mutableListOf() }.add(pattern)
|
||||
}
|
||||
}
|
||||
|
||||
private fun subTaskConfigure(testTask: Test) {
|
||||
testTask.outputs.upToDateWhen { false }
|
||||
testTask.ignoreFailures = true
|
||||
testTask.filter {
|
||||
isFailOnNoMatchingTests = false
|
||||
patterns["include"]?.let {
|
||||
it.forEach { pattern ->
|
||||
includeTestsMatching(pattern)
|
||||
}
|
||||
}
|
||||
patterns["exclude"]?.let {
|
||||
it.forEach { pattern ->
|
||||
excludeTestsMatching(pattern)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@TaskAction
|
||||
override fun executeTests() {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
@@ -56,7 +56,7 @@ var Project.javaHome: String?
|
||||
|
||||
fun Project.generator(fqName: String, sourceSet: SourceSet? = null) = smartJavaExec {
|
||||
classpath = (sourceSet ?: testSourceSet).runtimeClasspath
|
||||
main = fqName
|
||||
mainClass.set(fqName)
|
||||
workingDir = rootDir
|
||||
systemProperty("line.separator", "\n")
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ fun CompatibilityPredicate.or(other: CompatibilityPredicate): CompatibilityPredi
|
||||
}
|
||||
|
||||
enum class Platform : CompatibilityPredicate {
|
||||
P183, P191, P192, P193, P201, P202;
|
||||
P183, P191, P192, P193, P201, P202, P203;
|
||||
|
||||
val version: Int = name.drop(1).toInt()
|
||||
|
||||
@@ -48,6 +48,7 @@ enum class Ide(val platform: Platform) : CompatibilityPredicate {
|
||||
IJ193(Platform.P193),
|
||||
IJ201(Platform.P201),
|
||||
IJ202(Platform.P202),
|
||||
IJ203(Platform.P203),
|
||||
|
||||
AS35(Platform.P183),
|
||||
AS36(Platform.P192),
|
||||
|
||||
@@ -23,6 +23,10 @@ fun JavaExec.passClasspathInJar() {
|
||||
dependsOn(classpath)
|
||||
inputs.files(classpath)
|
||||
inputs.property("main", main)
|
||||
|
||||
archiveFileName.set("$main.${this@passClasspathInJar.name}.classpath.container.jar")
|
||||
destinationDirectory.set(temporaryDir)
|
||||
|
||||
doFirst {
|
||||
val classPathString = classpath.joinToString(" ") { project.file(it).toURI().toString() }
|
||||
manifest {
|
||||
@@ -34,16 +38,11 @@ fun JavaExec.passClasspathInJar() {
|
||||
)
|
||||
}
|
||||
}
|
||||
archiveName = "$main.${this@passClasspathInJar.name}.classpath.container.$extension"
|
||||
destinationDir = temporaryDir
|
||||
}
|
||||
|
||||
dependsOn(jarTask)
|
||||
|
||||
doFirst {
|
||||
main = "-jar"
|
||||
|
||||
classpath = project.files()
|
||||
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
|
||||
}
|
||||
main = "-jar"
|
||||
classpath = project.files()
|
||||
args = listOf(jarTask.outputs.files.singleFile.path) + args.orEmpty()
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.gradle.api.tasks.javadoc.Javadoc
|
||||
import org.gradle.jvm.tasks.Jar
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||
import org.gradle.kotlin.dsl.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetContainer
|
||||
import plugins.KotlinBuildPublishingPlugin
|
||||
|
||||
|
||||
@@ -129,10 +130,16 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||
}
|
||||
|
||||
val sourcesJar = getOrCreateTask<Jar>("sourcesJar") {
|
||||
fun Project.mainJavaPluginSourceSet() = findJavaPluginConvention()?.sourceSets?.findByName("main")
|
||||
fun Project.mainKotlinSourceSet() =
|
||||
(extensions.findByName("kotlin") as? KotlinSourceSetContainer)?.sourceSets?.findByName("main")
|
||||
|
||||
fun Project.sources() = mainJavaPluginSourceSet()?.allSource ?: mainKotlinSourceSet()?.kotlin
|
||||
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
archiveClassifier.set("sources")
|
||||
|
||||
from(project.mainSourceSet.allSource)
|
||||
from(project.sources())
|
||||
|
||||
project.configurations.findByName("embedded")?.let { embedded ->
|
||||
from(provider {
|
||||
@@ -141,10 +148,7 @@ fun Project.sourcesJar(body: Jar.() -> Unit = {}): TaskProvider<Jar> {
|
||||
.map { it.id.componentIdentifier }
|
||||
.filterIsInstance<ProjectComponentIdentifier>()
|
||||
.mapNotNull {
|
||||
project(it.projectPath)
|
||||
.findJavaPluginConvention()
|
||||
?.mainSourceSet
|
||||
?.allSource
|
||||
project(it.projectPath).sources()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("unused")
|
||||
|
||||
// usages in build scripts are not tracked properly
|
||||
@@ -97,9 +102,11 @@ fun Project.kotlinStdlib(suffix: String? = null, classifier: String? = null): An
|
||||
dependencies.project(listOfNotNull(":kotlin-stdlib", suffix).joinToString("-"), classifier)
|
||||
}
|
||||
|
||||
fun Project.kotlinBuiltins(): Any =
|
||||
fun Project.kotlinBuiltins(): Any = kotlinBuiltins(forJvm = false)
|
||||
|
||||
fun Project.kotlinBuiltins(forJvm: Boolean): Any =
|
||||
if (kotlinBuildProperties.useBootstrapStdlib) "org.jetbrains.kotlin:builtins:$bootstrapKotlinVersion"
|
||||
else dependencies.project(":core:builtins")
|
||||
else dependencies.project(":core:builtins", configuration = "runtimeElementsJvm".takeIf { forJvm })
|
||||
|
||||
fun DependencyHandler.projectTests(name: String): ProjectDependency = project(name, configuration = "tests-jar")
|
||||
fun DependencyHandler.projectRuntimeJar(name: String): ProjectDependency = project(name, configuration = "runtimeJar")
|
||||
|
||||
@@ -165,7 +165,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
|
||||
|
||||
classpath = mainSourceSet.runtimeClasspath
|
||||
|
||||
main = "com.intellij.idea.Main"
|
||||
mainClass.set("com.intellij.idea.Main")
|
||||
|
||||
workingDir = File(intellijRootDir(), "bin")
|
||||
|
||||
@@ -184,7 +184,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
|
||||
"-Dplugin.path=${ideaPluginDir.absolutePath}"
|
||||
)
|
||||
|
||||
if (Platform[201].orHigher()) {
|
||||
if (Platform[201].orHigher() && !isIntellijUltimateSdkAvailable()) {
|
||||
jvmArgs("-Didea.platform.prefix=Idea")
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,44 @@ import java.lang.Character.isUpperCase
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
|
||||
fun Task.dependsOnKotlinPluginInstall() {
|
||||
dependsOn(
|
||||
":kotlin-allopen:install",
|
||||
":kotlin-noarg:install",
|
||||
":kotlin-sam-with-receiver:install",
|
||||
":kotlin-android-extensions:install",
|
||||
":kotlin-build-common:install",
|
||||
":kotlin-compiler-embeddable:install",
|
||||
":native:kotlin-native-utils:install",
|
||||
":kotlin-util-klib:install",
|
||||
":kotlin-util-io:install",
|
||||
":kotlin-compiler-runner:install",
|
||||
":kotlin-daemon-embeddable:install",
|
||||
":kotlin-daemon-client:install",
|
||||
":kotlin-gradle-plugin-api:install",
|
||||
":kotlin-gradle-plugin:install",
|
||||
":kotlin-gradle-plugin-model:install",
|
||||
":kotlin-reflect:install",
|
||||
":kotlin-annotation-processing-gradle:install",
|
||||
":kotlin-test:kotlin-test-common:install",
|
||||
":kotlin-test:kotlin-test-annotations-common:install",
|
||||
":kotlin-test:kotlin-test-jvm:install",
|
||||
":kotlin-test:kotlin-test-js:install",
|
||||
":kotlin-gradle-subplugin-example:install",
|
||||
":kotlin-stdlib-common:install",
|
||||
":kotlin-stdlib:install",
|
||||
":kotlin-stdlib-jdk8:install",
|
||||
":kotlin-stdlib-js:install",
|
||||
":examples:annotation-processor-example:install",
|
||||
":kotlin-script-runtime:install",
|
||||
":kotlin-scripting-common:install",
|
||||
":kotlin-scripting-jvm:install",
|
||||
":kotlin-scripting-compiler-embeddable:install",
|
||||
":kotlin-scripting-compiler-impl-embeddable:install",
|
||||
":kotlin-test-js-runner:install"
|
||||
)
|
||||
}
|
||||
|
||||
fun Project.projectTest(
|
||||
taskName: String = "test",
|
||||
parallel: Boolean = false,
|
||||
|
||||
@@ -90,12 +90,18 @@ public abstract class AnnotationCodegen {
|
||||
private final KotlinTypeMapper typeMapper;
|
||||
private final ModuleDescriptor module;
|
||||
private final GenerationState state;
|
||||
private final boolean skipNullabilityAnnotations;
|
||||
|
||||
private AnnotationCodegen(@NotNull InnerClassConsumer innerClassConsumer, @NotNull GenerationState state) {
|
||||
this(innerClassConsumer, state, false);
|
||||
}
|
||||
|
||||
private AnnotationCodegen(@NotNull InnerClassConsumer innerClassConsumer, @NotNull GenerationState state, boolean skipNullabilityAnnotations) {
|
||||
this.innerClassConsumer = innerClassConsumer;
|
||||
this.typeMapper = state.getTypeMapper();
|
||||
this.module = state.getModule();
|
||||
this.state = state;
|
||||
this.skipNullabilityAnnotations = skipNullabilityAnnotations;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,9 +202,7 @@ public abstract class AnnotationCodegen {
|
||||
return;
|
||||
}
|
||||
|
||||
if (returnType != null && !AsmUtil.isPrimitive(returnType) &&
|
||||
!(descriptor instanceof PropertyDescriptor && ((PropertyDescriptor) descriptor).isDelegated())
|
||||
) {
|
||||
if (returnType != null && !AsmUtil.isPrimitive(returnType) && !skipNullabilityAnnotations) {
|
||||
generateNullabilityAnnotation(descriptor.getReturnType(), annotationDescriptorsAlreadyPresent);
|
||||
}
|
||||
}
|
||||
@@ -624,7 +628,16 @@ public abstract class AnnotationCodegen {
|
||||
@NotNull InnerClassConsumer innerClassConsumer,
|
||||
@NotNull GenerationState state
|
||||
) {
|
||||
return new AnnotationCodegen(innerClassConsumer, state) {
|
||||
return forMethod(mv, innerClassConsumer, state, false);
|
||||
}
|
||||
|
||||
public static AnnotationCodegen forMethod(
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull InnerClassConsumer innerClassConsumer,
|
||||
@NotNull GenerationState state,
|
||||
boolean skipNullabilityAnnotations
|
||||
) {
|
||||
return new AnnotationCodegen(innerClassConsumer, state, skipNullabilityAnnotations) {
|
||||
@NotNull
|
||||
@Override
|
||||
AnnotationVisitor visitAnnotation(String descr, boolean visible) {
|
||||
@@ -644,7 +657,16 @@ public abstract class AnnotationCodegen {
|
||||
@NotNull InnerClassConsumer innerClassConsumer,
|
||||
@NotNull GenerationState state
|
||||
) {
|
||||
return new AnnotationCodegen(innerClassConsumer, state) {
|
||||
return forField(fv, innerClassConsumer, state, false);
|
||||
}
|
||||
|
||||
public static AnnotationCodegen forField(
|
||||
@NotNull FieldVisitor fv,
|
||||
@NotNull InnerClassConsumer innerClassConsumer,
|
||||
@NotNull GenerationState state,
|
||||
boolean skipNullabilityAnnotations
|
||||
) {
|
||||
return new AnnotationCodegen(innerClassConsumer, state, skipNullabilityAnnotations) {
|
||||
@NotNull
|
||||
@Override
|
||||
AnnotationVisitor visitAnnotation(String descr, boolean visible) {
|
||||
@@ -663,9 +685,10 @@ public abstract class AnnotationCodegen {
|
||||
int parameter,
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull InnerClassConsumer innerClassConsumer,
|
||||
@NotNull GenerationState state
|
||||
@NotNull GenerationState state,
|
||||
boolean skipNullabilityAnnotations
|
||||
) {
|
||||
return new AnnotationCodegen(innerClassConsumer, state) {
|
||||
return new AnnotationCodegen(innerClassConsumer, state, skipNullabilityAnnotations) {
|
||||
@NotNull
|
||||
@Override
|
||||
AnnotationVisitor visitAnnotation(String descr, boolean visible) {
|
||||
|
||||
@@ -153,18 +153,18 @@ class DefaultParameterValueSubstitutor(val state: GenerationState) {
|
||||
signature.genericsSignature,
|
||||
FunctionCodegen.getThrownExceptions(functionDescriptor, typeMapper)
|
||||
)
|
||||
val skipNullabilityAnnotations = flags and Opcodes.ACC_PRIVATE != 0 || flags and Opcodes.ACC_SYNTHETIC != 0
|
||||
|
||||
AnnotationCodegen.forMethod(mv, memberCodegen, state).genAnnotations(
|
||||
functionDescriptor,
|
||||
signature.returnType,
|
||||
functionDescriptor.returnType
|
||||
)
|
||||
AnnotationCodegen.forMethod(mv, memberCodegen, state, skipNullabilityAnnotations)
|
||||
.genAnnotations(functionDescriptor, signature.returnType, functionDescriptor.returnType)
|
||||
|
||||
if (state.classBuilderMode == ClassBuilderMode.KAPT3) {
|
||||
mv.visitAnnotation(ANNOTATION_TYPE_DESCRIPTOR_FOR_JVM_OVERLOADS_GENERATED_METHODS, false)
|
||||
}
|
||||
|
||||
FunctionCodegen.generateParameterAnnotations(functionDescriptor, mv, signature, remainingParameters, memberCodegen, state)
|
||||
FunctionCodegen.generateParameterAnnotations(
|
||||
functionDescriptor, mv, signature, remainingParameters, memberCodegen, state, skipNullabilityAnnotations
|
||||
)
|
||||
|
||||
if (!state.classBuilderMode.generateBodies) {
|
||||
FunctionCodegen.generateLocalVariablesForParameters(
|
||||
|
||||
@@ -33,10 +33,7 @@ import org.jetbrains.kotlin.load.java.JvmAbi;
|
||||
import org.jetbrains.kotlin.load.java.SpecialBuiltinMembers;
|
||||
import org.jetbrains.kotlin.load.java.descriptors.JavaClassDescriptor;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
|
||||
import org.jetbrains.kotlin.resolve.*;
|
||||
import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.util.UnderscoreUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.constants.ArrayValue;
|
||||
@@ -205,12 +202,13 @@ public class FunctionCodegen {
|
||||
|
||||
MethodVisitor mv =
|
||||
strategy.wrapMethodVisitor(
|
||||
newMethod(origin,
|
||||
flags,
|
||||
asmMethod.getName(),
|
||||
asmMethod.getDescriptor(),
|
||||
strategy.skipGenericSignature() ? null : jvmSignature.getGenericsSignature(),
|
||||
getThrownExceptions(functionDescriptor, typeMapper)
|
||||
newMethod(
|
||||
origin,
|
||||
flags,
|
||||
asmMethod.getName(),
|
||||
asmMethod.getDescriptor(),
|
||||
strategy.skipGenericSignature() ? null : jvmSignature.getGenericsSignature(),
|
||||
getThrownExceptions(functionDescriptor, typeMapper)
|
||||
),
|
||||
flags, asmMethod.getName(),
|
||||
asmMethod.getDescriptor()
|
||||
@@ -218,10 +216,14 @@ public class FunctionCodegen {
|
||||
|
||||
recordMethodForFunctionIfAppropriate(functionDescriptor, asmMethod);
|
||||
|
||||
generateMethodAnnotationsIfRequired(functionDescriptor, asmMethod, jvmSignature, mv, isCompatibilityStubInDefaultImpls
|
||||
? Collections.singletonList(Deprecated.class)
|
||||
: Collections.emptyList());
|
||||
|
||||
boolean skipNullabilityAnnotations =
|
||||
(flags & ACC_PRIVATE) != 0 || (flags & ACC_SYNTHETIC) != 0 ||
|
||||
InlineClassDescriptorResolver.isSpecializedEqualsMethod(functionDescriptor);
|
||||
generateMethodAnnotationsIfRequired(
|
||||
functionDescriptor, asmMethod, jvmSignature, mv,
|
||||
isCompatibilityStubInDefaultImpls ? Collections.singletonList(Deprecated.class) : Collections.emptyList(),
|
||||
skipNullabilityAnnotations
|
||||
);
|
||||
GenerateJava8ParameterNamesKt.generateParameterNames(functionDescriptor, mv, jvmSignature, state, (flags & ACC_SYNTHETIC) != 0);
|
||||
|
||||
if (contextKind != OwnerKind.ERASED_INLINE_CLASS) {
|
||||
@@ -283,7 +285,8 @@ public class FunctionCodegen {
|
||||
@NotNull Method asmMethod,
|
||||
@NotNull JvmMethodGenericSignature jvmSignature,
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull List<Class<?>> additionalNoArgAnnotations
|
||||
@NotNull List<Class<?>> additionalNoArgAnnotations,
|
||||
boolean skipNullabilityAnnotations
|
||||
) {
|
||||
FunctionDescriptor annotationsOwner;
|
||||
if (shouldHideConstructorDueToInlineClassTypeValueParameters(functionDescriptor)) {
|
||||
@@ -298,10 +301,14 @@ public class FunctionCodegen {
|
||||
annotationsOwner = functionDescriptor;
|
||||
}
|
||||
|
||||
AnnotationCodegen.forMethod(mv, memberCodegen, state)
|
||||
AnnotationCodegen.forMethod(mv, memberCodegen, state, skipNullabilityAnnotations)
|
||||
.genAnnotations(annotationsOwner, asmMethod.getReturnType(), functionDescriptor.getReturnType(), null, additionalNoArgAnnotations);
|
||||
|
||||
generateParameterAnnotations(annotationsOwner, mv, jvmSignature, memberCodegen, state);
|
||||
generateParameterAnnotations(
|
||||
annotationsOwner, mv, jvmSignature,
|
||||
annotationsOwner.getValueParameters(),
|
||||
memberCodegen, state, skipNullabilityAnnotations
|
||||
);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -495,25 +502,14 @@ public class FunctionCodegen {
|
||||
return descriptor != null && !InlineUtil.isInlineOrContainingInline(descriptor);
|
||||
}
|
||||
|
||||
public static void generateParameterAnnotations(
|
||||
@NotNull FunctionDescriptor functionDescriptor,
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull JvmMethodSignature jvmSignature,
|
||||
@NotNull MemberCodegen<?> memberCodegen,
|
||||
@NotNull GenerationState state
|
||||
) {
|
||||
generateParameterAnnotations(
|
||||
functionDescriptor, mv, jvmSignature, functionDescriptor.getValueParameters(), memberCodegen, state
|
||||
);
|
||||
}
|
||||
|
||||
public static void generateParameterAnnotations(
|
||||
@NotNull FunctionDescriptor functionDescriptor,
|
||||
@NotNull MethodVisitor mv,
|
||||
@NotNull JvmMethodSignature jvmSignature,
|
||||
@NotNull List<ValueParameterDescriptor> valueParameters,
|
||||
@NotNull MemberCodegen<?> memberCodegen,
|
||||
@NotNull GenerationState state
|
||||
@NotNull GenerationState state,
|
||||
boolean skipNullabilityAnnotations
|
||||
) {
|
||||
if (isAccessor(functionDescriptor)) return;
|
||||
|
||||
@@ -536,14 +532,18 @@ public class FunctionCodegen {
|
||||
? iterator.next()
|
||||
: kind == JvmMethodParameterKind.RECEIVER
|
||||
? JvmCodegenUtil.getDirectMember(functionDescriptor).getExtensionReceiverParameter()
|
||||
: isDefaultImpl && kind == JvmMethodParameterKind.THIS ? JvmCodegenUtil.getDirectMember(functionDescriptor)
|
||||
.getDispatchReceiverParameter() : null;
|
||||
: kind == JvmMethodParameterKind.THIS && isDefaultImpl
|
||||
? JvmCodegenUtil.getDirectMember(functionDescriptor).getDispatchReceiverParameter()
|
||||
: null;
|
||||
|
||||
if (annotated != null) {
|
||||
//noinspection ConstantConditions
|
||||
int parameterIndex = i - syntheticParameterCount;
|
||||
AnnotationCodegen.forParameter(parameterIndex, mv, memberCodegen, state)
|
||||
.genAnnotations(annotated, parameterSignature.getAsmType(), annotated.getReturnType(), functionDescriptor, Collections.emptyList());
|
||||
AnnotationCodegen
|
||||
.forParameter(parameterIndex, mv, memberCodegen, state, skipNullabilityAnnotations)
|
||||
.genAnnotations(
|
||||
annotated, parameterSignature.getAsmType(), annotated.getReturnType(), functionDescriptor,
|
||||
Collections.emptyList()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor;
|
||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject;
|
||||
import org.jetbrains.kotlin.resolve.BindingContext;
|
||||
import org.jetbrains.kotlin.resolve.InlineClassesUtilsKt;
|
||||
@@ -46,6 +45,7 @@ public class FunctionsFromAnyGeneratorImpl extends FunctionsFromAnyGenerator {
|
||||
private final GenerationState generationState;
|
||||
private final KotlinTypeMapper typeMapper;
|
||||
private final JvmKotlinType underlyingType;
|
||||
private final boolean isInErasedInlineClass;
|
||||
|
||||
public FunctionsFromAnyGeneratorImpl(
|
||||
@NotNull KtClassOrObject declaration,
|
||||
@@ -67,23 +67,27 @@ public class FunctionsFromAnyGeneratorImpl extends FunctionsFromAnyGenerator {
|
||||
typeMapper.mapType(descriptor),
|
||||
InlineClassesUtilsKt.substitutedUnderlyingType(descriptor.getDefaultType())
|
||||
);
|
||||
this.isInErasedInlineClass = fieldOwnerContext.getContextKind() == OwnerKind.ERASED_INLINE_CLASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void generateToStringMethod(
|
||||
@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties
|
||||
@NotNull FunctionDescriptor function,
|
||||
@NotNull List<? extends PropertyDescriptor> properties
|
||||
) {
|
||||
MethodContext context = fieldOwnerContext.intoFunction(function);
|
||||
JvmDeclarationOrigin methodOrigin = JvmDeclarationOriginKt.OtherOrigin(function);
|
||||
String toStringMethodName = mapFunctionName(function);
|
||||
MethodVisitor mv = v.newMethod(methodOrigin, getAccess(), toStringMethodName, getToStringDesc(), null, null);
|
||||
|
||||
if (fieldOwnerContext.getContextKind() != OwnerKind.ERASED_INLINE_CLASS && classDescriptor.isInline()) {
|
||||
if (!isInErasedInlineClass && classDescriptor.isInline()) {
|
||||
FunctionCodegen.generateMethodInsideInlineClassWrapper(methodOrigin, function, classDescriptor, mv, typeMapper);
|
||||
return;
|
||||
}
|
||||
|
||||
visitEndForAnnotationVisitor(mv.visitAnnotation(Type.getDescriptor(NotNull.class), false));
|
||||
if (!isInErasedInlineClass) {
|
||||
visitEndForAnnotationVisitor(mv.visitAnnotation(Type.getDescriptor(NotNull.class), false));
|
||||
}
|
||||
|
||||
if (!generationState.getClassBuilderMode().generateBodies) {
|
||||
FunctionCodegen.endVisit(mv, toStringMethodName, getDeclaration());
|
||||
@@ -144,7 +148,7 @@ public class FunctionsFromAnyGeneratorImpl extends FunctionsFromAnyGenerator {
|
||||
String hashCodeMethodName = mapFunctionName(function);
|
||||
MethodVisitor mv = v.newMethod(methodOrigin, getAccess(), hashCodeMethodName, getHashCodeDesc(), null, null);
|
||||
|
||||
if (fieldOwnerContext.getContextKind() != OwnerKind.ERASED_INLINE_CLASS && classDescriptor.isInline()) {
|
||||
if (!isInErasedInlineClass && classDescriptor.isInline()) {
|
||||
FunctionCodegen.generateMethodInsideInlineClassWrapper(methodOrigin, function, classDescriptor, mv, typeMapper);
|
||||
return;
|
||||
}
|
||||
@@ -213,15 +217,14 @@ public class FunctionsFromAnyGeneratorImpl extends FunctionsFromAnyGenerator {
|
||||
String equalsMethodName = mapFunctionName(function);
|
||||
MethodVisitor mv = v.newMethod(methodOrigin, getAccess(), equalsMethodName, getEqualsDesc(), null, null);
|
||||
|
||||
boolean isErasedInlineClassKind = fieldOwnerContext.getContextKind() == OwnerKind.ERASED_INLINE_CLASS;
|
||||
if (!isErasedInlineClassKind && classDescriptor.isInline()) {
|
||||
if (!isInErasedInlineClass && classDescriptor.isInline()) {
|
||||
FunctionCodegen.generateMethodInsideInlineClassWrapper(methodOrigin, function, classDescriptor, mv, typeMapper);
|
||||
return;
|
||||
}
|
||||
|
||||
visitEndForAnnotationVisitor(
|
||||
mv.visitParameterAnnotation(isErasedInlineClassKind ? 1 : 0, Type.getDescriptor(Nullable.class), false)
|
||||
);
|
||||
if (!isInErasedInlineClass) {
|
||||
visitEndForAnnotationVisitor(mv.visitParameterAnnotation(0, Type.getDescriptor(Nullable.class), false));
|
||||
}
|
||||
|
||||
if (!generationState.getClassBuilderMode().generateBodies) {
|
||||
FunctionCodegen.endVisit(mv, equalsMethodName, getDeclaration());
|
||||
|
||||
@@ -210,7 +210,6 @@ public class PropertyCodegen {
|
||||
if (kind == OwnerKind.DEFAULT_IMPLS && isDefaultAccessor) return false;
|
||||
|
||||
// Delegated or extension properties can only be referenced via accessors
|
||||
//noinspection deprecation
|
||||
if (descriptor.isDelegated() || descriptor.getExtensionReceiverParameter() != null) return true;
|
||||
|
||||
// Companion object properties should have accessors for non-private properties because these properties can be referenced
|
||||
@@ -337,11 +336,8 @@ public class PropertyCodegen {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
boolean isDelegate = descriptor.isDelegated();
|
||||
|
||||
Object defaultValue;
|
||||
if (isDelegate) {
|
||||
if (descriptor.isDelegated()) {
|
||||
defaultValue = null;
|
||||
}
|
||||
else if (Boolean.TRUE.equals(bindingContext.get(BindingContext.BACKING_FIELD_REQUIRED, descriptor))) {
|
||||
@@ -357,7 +353,7 @@ public class PropertyCodegen {
|
||||
return;
|
||||
}
|
||||
|
||||
generateBackingField(descriptor, isDelegate, defaultValue, isBackingFieldOwner);
|
||||
generateBackingField(descriptor, descriptor.isDelegated(), defaultValue, isBackingFieldOwner);
|
||||
}
|
||||
|
||||
// Annotations on properties are stored in bytecode on an empty synthetic method. This way they're still
|
||||
@@ -438,7 +434,13 @@ public class PropertyCodegen {
|
||||
);
|
||||
|
||||
if (annotatedField != null) {
|
||||
AnnotationCodegen.forField(fv, memberCodegen, state)
|
||||
// Don't emit nullability annotations for backing field if:
|
||||
// - backing field is synthetic;
|
||||
// - property is lateinit (since corresponding field is actually nullable).
|
||||
boolean skipNullabilityAnnotations =
|
||||
(modifiers & ACC_SYNTHETIC) != 0 ||
|
||||
propertyDescriptor.isLateInit();
|
||||
AnnotationCodegen.forField(fv, memberCodegen, state, skipNullabilityAnnotations)
|
||||
.genAnnotations(annotatedField, type, propertyDescriptor.getType());
|
||||
}
|
||||
}
|
||||
@@ -516,9 +518,7 @@ public class PropertyCodegen {
|
||||
|
||||
FunctionGenerationStrategy strategy;
|
||||
if (accessor == null || !accessor.hasBody()) {
|
||||
@SuppressWarnings("deprecation")
|
||||
boolean isDelegated = descriptor.getCorrespondingProperty().isDelegated();
|
||||
if (isDelegated) {
|
||||
if (descriptor.getCorrespondingProperty().isDelegated()) {
|
||||
strategy = new DelegatedPropertyAccessorStrategy(state, descriptor);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -590,7 +590,7 @@ private fun generateLambdaForRunSuspend(
|
||||
|
||||
lambdaBuilder.newField(
|
||||
JvmDeclarationOrigin.NO_ORIGIN,
|
||||
ACC_PRIVATE or ACC_FINAL,
|
||||
ACC_PRIVATE or ACC_FINAL or ACC_SYNTHETIC,
|
||||
"args",
|
||||
ARRAY_OF_STRINGS_TYPE.descriptor, null, null
|
||||
)
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.codegen.context.MethodContext
|
||||
import org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings.METHOD_FOR_FUNCTION
|
||||
import org.jetbrains.kotlin.codegen.serialization.JvmSerializerExtension
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||
import org.jetbrains.kotlin.config.JVMConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.isReleaseCoroutines
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
@@ -235,7 +236,7 @@ class CoroutineCodegenForLambda private constructor(
|
||||
val fieldInfo = parameter.getFieldInfoForCoroutineLambdaParameter()
|
||||
v.newField(
|
||||
OtherOrigin(parameter),
|
||||
Opcodes.ACC_PRIVATE,
|
||||
Opcodes.ACC_PRIVATE + Opcodes.ACC_SYNTHETIC,
|
||||
fieldInfo.fieldName,
|
||||
fieldInfo.fieldType.descriptor, null, null
|
||||
)
|
||||
@@ -512,7 +513,8 @@ class CoroutineCodegenForLambda private constructor(
|
||||
containingClassInternalName = v.thisName,
|
||||
isForNamedFunction = false,
|
||||
languageVersionSettings = languageVersionSettings,
|
||||
disableTailCallOptimizationForFunctionReturningUnit = false
|
||||
disableTailCallOptimizationForFunctionReturningUnit = false,
|
||||
useOldSpilledVarTypeAnalysis = state.configuration.getBoolean(JVMConfigurationKeys.USE_OLD_SPILLED_VAR_TYPE_ANALYSIS)
|
||||
)
|
||||
val maybeWithForInline = if (forInline)
|
||||
SuspendForInlineCopyingMethodVisitor(stateMachineBuilder, access, name, desc, functionCodegen::newMethod)
|
||||
|
||||
@@ -5,14 +5,10 @@
|
||||
|
||||
package org.jetbrains.kotlin.codegen.coroutines
|
||||
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.codegen.ClassBuilder
|
||||
import org.jetbrains.kotlin.codegen.StackValue
|
||||
import org.jetbrains.kotlin.codegen.TransformationMethodVisitor
|
||||
import org.jetbrains.kotlin.codegen.*
|
||||
import org.jetbrains.kotlin.codegen.inline.*
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.*
|
||||
import org.jetbrains.kotlin.codegen.optimization.fixStack.FixStackMethodTransformer
|
||||
import org.jetbrains.kotlin.codegen.linkWithLabel
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.config.isReleaseCoroutines
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
@@ -65,7 +61,9 @@ class CoroutineTransformerMethodVisitor(
|
||||
// May differ from containingClassInternalName in case of DefaultImpls
|
||||
private val internalNameForDispatchReceiver: String? = null,
|
||||
// JVM_IR backend generates $completion, while old backend does not
|
||||
private val putContinuationParameterToLvt: Boolean = true
|
||||
private val putContinuationParameterToLvt: Boolean = true,
|
||||
// New SourceInterpreter-less analyser can be somewhat unstable, disable it
|
||||
private val useOldSpilledVarTypeAnalysis: Boolean = false
|
||||
) : TransformationMethodVisitor(delegate, access, name, desc, signature, exceptions) {
|
||||
|
||||
private val classBuilderForCoroutineState: ClassBuilder by lazy(obtainClassBuilderForCoroutineState)
|
||||
@@ -594,7 +592,10 @@ class CoroutineTransformerMethodVisitor(
|
||||
|
||||
private fun spillVariables(suspensionPoints: List<SuspensionPoint>, methodNode: MethodNode): List<List<SpilledVariableDescriptor>> {
|
||||
val instructions = methodNode.instructions
|
||||
val frames = performRefinedTypeAnalysis(methodNode, containingClassInternalName)
|
||||
val frames =
|
||||
if (useOldSpilledVarTypeAnalysis) performRefinedTypeAnalysis(methodNode, containingClassInternalName)
|
||||
else performSpilledVariableFieldTypesAnalysis(methodNode, containingClassInternalName)
|
||||
|
||||
fun AbstractInsnNode.index() = instructions.indexOf(this)
|
||||
|
||||
// We postpone these actions because they change instruction indices that we use when obtaining frames
|
||||
@@ -642,11 +643,11 @@ class CoroutineTransformerMethodVisitor(
|
||||
.map { Pair(it, frame.getLocal(it)) }
|
||||
.filter { (index, value) ->
|
||||
(index == 0 && needDispatchReceiver && isForNamedFunction) ||
|
||||
(value != StrictBasicValue.UNINITIALIZED_VALUE && livenessFrame.isAlive(index))
|
||||
(value.type != null && livenessFrame.isAlive(index))
|
||||
}
|
||||
|
||||
for ((index, basicValue) in variablesToSpill) {
|
||||
if (basicValue === StrictBasicValue.NULL_VALUE) {
|
||||
if (basicValue == StrictBasicValue.NULL_VALUE) {
|
||||
postponedActions.add {
|
||||
with(instructions) {
|
||||
insert(suspension.tryCatchBlockEndLabelAfterSuspensionCall, withInstructionAdapter {
|
||||
@@ -658,7 +659,7 @@ class CoroutineTransformerMethodVisitor(
|
||||
continue
|
||||
}
|
||||
|
||||
val type = basicValue.type
|
||||
val type = basicValue.type!!
|
||||
val normalizedType = type.normalize()
|
||||
|
||||
val indexBySort = varsCountByType[normalizedType]?.plus(1) ?: 0
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen.coroutines
|
||||
|
||||
import org.jetbrains.kotlin.codegen.inline.nodeText
|
||||
import org.jetbrains.kotlin.codegen.optimization.boxing.isUnitInstance
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.MethodAnalyzer
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.asSequence
|
||||
@@ -13,169 +12,136 @@ import org.jetbrains.kotlin.codegen.optimization.common.removeAll
|
||||
import org.jetbrains.kotlin.codegen.optimization.fixStack.top
|
||||
import org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.tree.*
|
||||
import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode
|
||||
import org.jetbrains.org.objectweb.asm.tree.LabelNode
|
||||
import org.jetbrains.org.objectweb.asm.tree.MethodNode
|
||||
import org.jetbrains.org.objectweb.asm.tree.VarInsnNode
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicInterpreter
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.Frame
|
||||
import java.util.*
|
||||
|
||||
private class PossibleSpilledValue(val source: AbstractInsnNode, type: Type?) : BasicValue(type) {
|
||||
val usages = mutableSetOf<AbstractInsnNode>()
|
||||
|
||||
override fun toString(): String = when {
|
||||
source.opcode == Opcodes.ALOAD -> "" + (source as VarInsnNode).`var`
|
||||
source.isUnitInstance() -> "U"
|
||||
else -> error("unreachable")
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is PossibleSpilledValue && source == other.source
|
||||
|
||||
override fun hashCode(): Int = super.hashCode() xor source.hashCode()
|
||||
}
|
||||
|
||||
private object NonSpillableValue : BasicValue(AsmTypes.OBJECT_TYPE) {
|
||||
override fun equals(other: Any?): Boolean = other is NonSpillableValue
|
||||
|
||||
override fun toString(): String = "N"
|
||||
}
|
||||
|
||||
private object ConstructedValue : BasicValue(AsmTypes.OBJECT_TYPE) {
|
||||
override fun equals(other: Any?): Boolean = other is ConstructedValue
|
||||
|
||||
override fun toString(): String = "C"
|
||||
}
|
||||
|
||||
fun BasicValue?.nonspillable(): BasicValue? = if (this?.type?.sort == Type.OBJECT) NonSpillableValue else this
|
||||
|
||||
private class RedundantSpillingInterpreter : BasicInterpreter(Opcodes.API_VERSION) {
|
||||
val possibleSpilledValues = mutableSetOf<PossibleSpilledValue>()
|
||||
|
||||
override fun newOperation(insn: AbstractInsnNode): BasicValue? {
|
||||
if (insn.opcode == Opcodes.NEW) return ConstructedValue
|
||||
val basicValue = super.newOperation(insn)
|
||||
return if (insn.isUnitInstance())
|
||||
// Unit instances come from inlining suspend functions returning Unit.
|
||||
// They can be spilled before they are eventually popped.
|
||||
// Track them.
|
||||
PossibleSpilledValue(insn, basicValue.type).also { possibleSpilledValues += it }
|
||||
else basicValue.nonspillable()
|
||||
}
|
||||
|
||||
override fun copyOperation(insn: AbstractInsnNode, value: BasicValue?): BasicValue? =
|
||||
when (value) {
|
||||
is ConstructedValue -> value
|
||||
is PossibleSpilledValue -> {
|
||||
value.usages += insn
|
||||
if (insn.opcode == Opcodes.ALOAD || insn.opcode == Opcodes.ASTORE) value
|
||||
else value.nonspillable()
|
||||
}
|
||||
else -> value?.nonspillable()
|
||||
}
|
||||
|
||||
override fun naryOperation(insn: AbstractInsnNode, values: MutableList<out BasicValue?>): BasicValue? {
|
||||
for (value in values.filterIsInstance<PossibleSpilledValue>()) {
|
||||
value.usages += insn
|
||||
}
|
||||
return super.naryOperation(insn, values)?.nonspillable()
|
||||
}
|
||||
|
||||
override fun merge(v: BasicValue?, w: BasicValue?): BasicValue? =
|
||||
if (v is PossibleSpilledValue && w is PossibleSpilledValue && v.source == w.source) v
|
||||
else v?.nonspillable()
|
||||
}
|
||||
|
||||
// Inliner emits a lot of locals during inlining.
|
||||
// Remove all of them since these locals are
|
||||
// 1) going to be spilled into continuation object
|
||||
// 2) breaking tail-call elimination
|
||||
/**
|
||||
* This pass removes unused Unit values. These typically occur as a result of inlining and could end up spilling
|
||||
* into the continuation object or break tail-call elimination.
|
||||
*
|
||||
* Concretely, we remove "GETSTATIC kotlin/Unit.INSTANCE" instructions if they are unused, or all uses are either
|
||||
* POP instructions, or ASTORE instructions to locals which are never read and are not named local variables.
|
||||
*
|
||||
* This pass does not touch [suspensionPoints], as later passes rely on the bytecode patterns around suspension points.
|
||||
*/
|
||||
internal class RedundantLocalsEliminationMethodTransformer(private val suspensionPoints: List<SuspensionPoint>) : MethodTransformer() {
|
||||
override fun transform(internalClassName: String, methodNode: MethodNode) {
|
||||
val interpreter = RedundantSpillingInterpreter()
|
||||
val frames = MethodAnalyzer<BasicValue>(internalClassName, methodNode, interpreter).analyze()
|
||||
val interpreter = UnitSourceInterpreter(methodNode.localVariables?.mapTo(mutableSetOf()) { it.index } ?: setOf())
|
||||
val frames = interpreter.run(internalClassName, methodNode)
|
||||
|
||||
// Mark all unused instructions for deletion (except for labels which may be used in debug information)
|
||||
val toDelete = mutableSetOf<AbstractInsnNode>()
|
||||
for (spilledValue in interpreter.possibleSpilledValues.filter { it.usages.isNotEmpty() }) {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val aloads = spilledValue.usages.filter { it.opcode == Opcodes.ALOAD } as List<VarInsnNode>
|
||||
|
||||
if (aloads.isEmpty()) continue
|
||||
|
||||
val slot = aloads.first().`var`
|
||||
|
||||
if (aloads.any { it.`var` != slot }) continue
|
||||
for (aload in aloads) {
|
||||
methodNode.instructions.set(aload, spilledValue.source.clone())
|
||||
}
|
||||
|
||||
toDelete.addAll(spilledValue.usages.filter { it.opcode == Opcodes.ASTORE })
|
||||
toDelete.add(spilledValue.source)
|
||||
methodNode.instructions.asSequence().zip(frames.asSequence()).mapNotNullTo(toDelete) { (insn, frame) ->
|
||||
insn.takeIf { frame == null && insn !is LabelNode }
|
||||
}
|
||||
|
||||
for (pop in methodNode.instructions.asSequence().filter { it.opcode == Opcodes.POP }) {
|
||||
val value = (frames[methodNode.instructions.indexOf(pop)]?.top() as? PossibleSpilledValue) ?: continue
|
||||
if (value.usages.isEmpty() && value.source !in suspensionPoints) {
|
||||
toDelete.add(pop)
|
||||
toDelete.add(value.source)
|
||||
}
|
||||
}
|
||||
|
||||
// Remove unreachable instructions to simplify further analyses
|
||||
for (index in frames.indices) {
|
||||
if (frames[index] == null) {
|
||||
val insn = methodNode.instructions[index]
|
||||
if (insn !is LabelNode) {
|
||||
toDelete.add(insn)
|
||||
}
|
||||
// Mark all spillable "GETSTATIC kotlin/Unit.INSTANCE" instructions for deletion
|
||||
for ((unit, uses) in interpreter.unitUsageInformation) {
|
||||
if (unit !in interpreter.unspillableUnitValues && unit !in suspensionPoints) {
|
||||
toDelete += unit
|
||||
toDelete += uses
|
||||
}
|
||||
}
|
||||
|
||||
methodNode.instructions.removeAll(toDelete)
|
||||
}
|
||||
|
||||
private fun AbstractInsnNode.clone() = when (this) {
|
||||
is FieldInsnNode -> FieldInsnNode(opcode, owner, name, desc)
|
||||
is VarInsnNode -> VarInsnNode(opcode, `var`)
|
||||
is InsnNode -> InsnNode(opcode)
|
||||
is TypeInsnNode -> TypeInsnNode(opcode, desc)
|
||||
else -> error("clone of $this is not implemented yet")
|
||||
}
|
||||
}
|
||||
|
||||
// Handy debugging routing
|
||||
@Suppress("unused")
|
||||
fun MethodNode.nodeTextWithFrames(frames: Array<*>): String {
|
||||
var insns = nodeText.split("\n")
|
||||
val first = insns.indexOfLast { it.trim().startsWith("@") } + 1
|
||||
var last = insns.indexOfFirst { it.trim().startsWith("LOCALVARIABLE") }
|
||||
if (last < 0) last = insns.size
|
||||
val prefix = insns.subList(0, first).joinToString(separator = "\n")
|
||||
val postfix = insns.subList(last, insns.size).joinToString(separator = "\n")
|
||||
insns = insns.subList(first, last)
|
||||
if (insns.any { it.contains("TABLESWITCH") }) {
|
||||
var insideTableSwitch = false
|
||||
var buffer = ""
|
||||
val res = arrayListOf<String>()
|
||||
for (insn in insns) {
|
||||
if (insn.contains("TABLESWITCH")) {
|
||||
insideTableSwitch = true
|
||||
}
|
||||
if (insideTableSwitch) {
|
||||
buffer += insn
|
||||
if (insn.contains("default")) {
|
||||
insideTableSwitch = false
|
||||
res += buffer
|
||||
buffer = ""
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
res += insn
|
||||
// A version of SourceValue which inherits from BasicValue and is only used for Unit values.
|
||||
private class UnitValue(val insns: Set<AbstractInsnNode>) : BasicValue(AsmTypes.OBJECT_TYPE) {
|
||||
constructor(insn: AbstractInsnNode) : this(Collections.singleton(insn))
|
||||
|
||||
override fun equals(other: Any?): Boolean = other is UnitValue && insns == other.insns
|
||||
override fun hashCode() = Objects.hash(insns)
|
||||
override fun toString() = "U"
|
||||
}
|
||||
|
||||
// A specialized SourceInterpreter which only keeps track of the use sites for Unit values which are exclusively used as
|
||||
// arguments to POP and unused ASTORE instructions.
|
||||
private class UnitSourceInterpreter(private val localVariables: Set<Int>) : BasicInterpreter(Opcodes.API_VERSION) {
|
||||
// All unit values with visible use-sites.
|
||||
val unspillableUnitValues = mutableSetOf<AbstractInsnNode>()
|
||||
|
||||
// Map from unit values to ASTORE/POP use-sites.
|
||||
val unitUsageInformation = mutableMapOf<AbstractInsnNode, MutableSet<AbstractInsnNode>>()
|
||||
|
||||
private fun markUnspillable(value: BasicValue?) =
|
||||
value?.safeAs<UnitValue>()?.let { unspillableUnitValues += it.insns }
|
||||
|
||||
private fun collectUnitUsage(use: AbstractInsnNode, value: UnitValue) {
|
||||
for (def in value.insns) {
|
||||
if (def !in unspillableUnitValues) {
|
||||
unitUsageInformation.getOrPut(def) { mutableSetOf() } += use
|
||||
}
|
||||
}
|
||||
insns = res
|
||||
}
|
||||
return prefix + "\n" + insns.withIndex().joinToString(separator = "\n") { (index, insn) ->
|
||||
if (index >= frames.size) "N/A\t$insn" else "${frames[index]}\t$insn"
|
||||
} + "\n" + postfix
|
||||
|
||||
fun run(internalClassName: String, methodNode: MethodNode): Array<Frame<BasicValue>?> {
|
||||
val frames = MethodAnalyzer<BasicValue>(internalClassName, methodNode, this).analyze()
|
||||
// The ASM analyzer does not visit POP instructions, so we do so here.
|
||||
for ((insn, frame) in methodNode.instructions.asSequence().zip(frames.asSequence())) {
|
||||
if (frame != null && insn.opcode == Opcodes.POP) {
|
||||
val value = frame.top()
|
||||
value.safeAs<UnitValue>()?.let { collectUnitUsage(insn, it) }
|
||||
}
|
||||
}
|
||||
return frames
|
||||
}
|
||||
|
||||
override fun newOperation(insn: AbstractInsnNode?): BasicValue =
|
||||
if (insn?.isUnitInstance() == true) UnitValue(insn) else super.newOperation(insn)
|
||||
|
||||
override fun copyOperation(insn: AbstractInsnNode, value: BasicValue?): BasicValue? {
|
||||
if (value is UnitValue) {
|
||||
if (insn is VarInsnNode && insn.opcode == Opcodes.ASTORE && insn.`var` !in localVariables) {
|
||||
collectUnitUsage(insn, value)
|
||||
// We track the stored value in case it is subsequently read.
|
||||
return value
|
||||
}
|
||||
unspillableUnitValues += value.insns
|
||||
}
|
||||
return super.copyOperation(insn, value)
|
||||
}
|
||||
|
||||
override fun unaryOperation(insn: AbstractInsnNode, value: BasicValue?): BasicValue? {
|
||||
markUnspillable(value)
|
||||
return super.unaryOperation(insn, value)
|
||||
}
|
||||
|
||||
override fun binaryOperation(insn: AbstractInsnNode, value1: BasicValue?, value2: BasicValue?): BasicValue? {
|
||||
markUnspillable(value1)
|
||||
markUnspillable(value2)
|
||||
return super.binaryOperation(insn, value1, value2)
|
||||
}
|
||||
|
||||
override fun ternaryOperation(insn: AbstractInsnNode, value1: BasicValue?, value2: BasicValue?, value3: BasicValue?): BasicValue? {
|
||||
markUnspillable(value1)
|
||||
markUnspillable(value2)
|
||||
markUnspillable(value3)
|
||||
return super.ternaryOperation(insn, value1, value2, value3)
|
||||
}
|
||||
|
||||
override fun naryOperation(insn: AbstractInsnNode, values: List<BasicValue>?): BasicValue? {
|
||||
values?.forEach(this::markUnspillable)
|
||||
return super.naryOperation(insn, values)
|
||||
}
|
||||
|
||||
override fun merge(value1: BasicValue?, value2: BasicValue?): BasicValue? =
|
||||
if (value1 is UnitValue && value2 is UnitValue) {
|
||||
UnitValue(value1.insns.union(value2.insns))
|
||||
} else {
|
||||
// Mark unit values as unspillable if we merge them with non-unit values here.
|
||||
// This is conservative since the value could turn out to be unused.
|
||||
markUnspillable(value1)
|
||||
markUnspillable(value2)
|
||||
super.merge(value1, value2)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen.coroutines
|
||||
|
||||
import org.jetbrains.kotlin.codegen.StackValue
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.MethodAnalyzer
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.OptimizationBasicInterpreter
|
||||
import org.jetbrains.org.objectweb.asm.Label
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
|
||||
import org.jetbrains.org.objectweb.asm.tree.*
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.BasicValue
|
||||
import org.jetbrains.org.objectweb.asm.tree.analysis.Frame
|
||||
|
||||
// BasicValue interpreter from ASM does not distinct 'int' types from other int-like types like 'byte' or 'boolean',
|
||||
// neither do HotSpot and JVM spec.
|
||||
// But it seems like Dalvik does not follow it, and spilling boolean value into an 'int' field fails with VerifyError on Android 4,
|
||||
// so this function calculates refined frames' markup.
|
||||
// Note that type of some values is only possible to determine by their usages (e.g. ICONST_1, BALOAD both may push boolean or byte on stack)
|
||||
// In this case, coerce the type of the value.
|
||||
|
||||
internal class IloadedValue(val insns: Set<VarInsnNode>) : BasicValue(Type.INT_TYPE)
|
||||
|
||||
private class IntLikeCoerceInterpreter : OptimizationBasicInterpreter() {
|
||||
val needsToBeCoerced = mutableMapOf<VarInsnNode, Type>()
|
||||
|
||||
private fun coerce(value: IloadedValue, type: Type) {
|
||||
for (insn in value.insns) {
|
||||
needsToBeCoerced[insn] = type
|
||||
}
|
||||
}
|
||||
|
||||
override fun copyOperation(insn: AbstractInsnNode, value: BasicValue?): BasicValue? =
|
||||
when {
|
||||
insn.opcode == Opcodes.ILOAD -> IloadedValue(setOf(insn as VarInsnNode))
|
||||
value == null -> null
|
||||
else -> BasicValue(value.type)
|
||||
}
|
||||
|
||||
override fun binaryOperation(insn: AbstractInsnNode, v: BasicValue, w: BasicValue): BasicValue? {
|
||||
if (insn.opcode == Opcodes.PUTFIELD) {
|
||||
val expectedType = Type.getType((insn as FieldInsnNode).desc)
|
||||
if (w is IloadedValue && expectedType.isIntLike()) {
|
||||
coerce(w, expectedType)
|
||||
}
|
||||
}
|
||||
return super.binaryOperation(insn, v, w)
|
||||
}
|
||||
|
||||
override fun unaryOperation(insn: AbstractInsnNode, value: BasicValue?): BasicValue? {
|
||||
if (insn.opcode == Opcodes.PUTSTATIC) {
|
||||
val expectedType = Type.getType((insn as FieldInsnNode).desc)
|
||||
if (value is IloadedValue && expectedType.isIntLike()) {
|
||||
coerce(value, expectedType)
|
||||
}
|
||||
}
|
||||
return super.unaryOperation(insn, value)
|
||||
}
|
||||
|
||||
override fun naryOperation(insn: AbstractInsnNode, values: MutableList<out BasicValue?>): BasicValue? {
|
||||
fun checkTypes(argTypes: Array<Type>, withReceiver: Boolean) {
|
||||
val offset = if (withReceiver) 1 else 0
|
||||
for ((index, argType) in argTypes.withIndex()) {
|
||||
val value = values[index + offset] ?: continue
|
||||
if (argType.isIntLike() && value is IloadedValue) {
|
||||
coerce(value, argType)
|
||||
}
|
||||
}
|
||||
}
|
||||
when (insn.opcode) {
|
||||
Opcodes.INVOKEDYNAMIC -> {
|
||||
checkTypes(Type.getArgumentTypes((insn as InvokeDynamicInsnNode).desc), false)
|
||||
}
|
||||
Opcodes.INVOKESTATIC -> {
|
||||
checkTypes(Type.getArgumentTypes((insn as MethodInsnNode).desc), false)
|
||||
}
|
||||
Opcodes.INVOKEVIRTUAL, Opcodes.INVOKEINTERFACE, Opcodes.INVOKESPECIAL -> {
|
||||
checkTypes(Type.getArgumentTypes((insn as MethodInsnNode).desc), true)
|
||||
}
|
||||
}
|
||||
return super.naryOperation(insn, values)
|
||||
}
|
||||
|
||||
override fun ternaryOperation(insn: AbstractInsnNode, arrayref: BasicValue?, index: BasicValue?, value: BasicValue?): BasicValue? {
|
||||
when (insn.opcode) {
|
||||
Opcodes.BASTORE -> {
|
||||
if (value is IloadedValue) {
|
||||
val type = if (arrayref?.type?.descriptor == "[Z") Type.BOOLEAN_TYPE else Type.BYTE_TYPE
|
||||
coerce(value, type)
|
||||
}
|
||||
}
|
||||
Opcodes.CASTORE -> {
|
||||
if (value is IloadedValue) {
|
||||
coerce(value, Type.CHAR_TYPE)
|
||||
}
|
||||
}
|
||||
Opcodes.SASTORE -> {
|
||||
if (value is IloadedValue) {
|
||||
coerce(value, Type.SHORT_TYPE)
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.ternaryOperation(insn, arrayref, index, value)
|
||||
}
|
||||
|
||||
override fun merge(v: BasicValue, w: BasicValue): BasicValue =
|
||||
when {
|
||||
v is IloadedValue && w is IloadedValue && v.type == w.type -> {
|
||||
val insns = v.insns + w.insns
|
||||
insns.find { it in needsToBeCoerced }?.let {
|
||||
val type = needsToBeCoerced[it]!!
|
||||
coerce(v, type)
|
||||
coerce(w, type)
|
||||
}
|
||||
IloadedValue(insns)
|
||||
}
|
||||
v.type == w.type -> {
|
||||
if (w is IloadedValue) w else v
|
||||
}
|
||||
else -> super.merge(v, w)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun performSpilledVariableFieldTypesAnalysis(
|
||||
methodNode: MethodNode,
|
||||
thisName: String
|
||||
): Array<out Frame<BasicValue>?> {
|
||||
val interpreter = IntLikeCoerceInterpreter()
|
||||
MethodAnalyzer(thisName, methodNode, interpreter).analyze()
|
||||
for ((insn, type) in interpreter.needsToBeCoerced) {
|
||||
methodNode.instructions.insert(insn, withInstructionAdapter { coerceInt(type, this) })
|
||||
}
|
||||
return MethodAnalyzer(thisName, methodNode, OptimizationBasicInterpreter()).analyze()
|
||||
}
|
||||
|
||||
private fun coerceInt(to: Type, v: InstructionAdapter) {
|
||||
if (to == Type.BOOLEAN_TYPE) {
|
||||
with(v) {
|
||||
val zeroLabel = Label()
|
||||
val resLabel = Label()
|
||||
ifeq(zeroLabel)
|
||||
iconst(1)
|
||||
goTo(resLabel)
|
||||
mark(zeroLabel)
|
||||
iconst(0)
|
||||
mark(resLabel)
|
||||
}
|
||||
} else {
|
||||
StackValue.coerce(Type.INT_TYPE, to, v)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Type.isIntLike(): Boolean = when (sort) {
|
||||
Type.BOOLEAN, Type.BYTE, Type.CHAR, Type.SHORT -> true
|
||||
else -> false
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.codegen.inline.addFakeContinuationConstructorCallMar
|
||||
import org.jetbrains.kotlin.codegen.inline.coroutines.FOR_INLINE_SUFFIX
|
||||
import org.jetbrains.kotlin.codegen.inline.preprocessSuspendMarkers
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||
import org.jetbrains.kotlin.config.JVMConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.JVMConstructorCallNormalizationMode
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.config.languageVersionSettings
|
||||
@@ -95,7 +96,8 @@ class SuspendFunctionGenerationStrategy(
|
||||
languageVersionSettings = languageVersionSettings,
|
||||
disableTailCallOptimizationForFunctionReturningUnit = originalSuspendDescriptor.returnType?.isUnit() == true &&
|
||||
originalSuspendDescriptor.overriddenDescriptors.isNotEmpty() &&
|
||||
!originalSuspendDescriptor.allOverriddenFunctionsReturnUnit()
|
||||
!originalSuspendDescriptor.allOverriddenFunctionsReturnUnit(),
|
||||
useOldSpilledVarTypeAnalysis = state.configuration.getBoolean(JVMConfigurationKeys.USE_OLD_SPILLED_VAR_TYPE_ANALYSIS)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ fun createFreeFakeLocalPropertyDescriptor(descriptor: LocalVariableDescriptor, t
|
||||
val property = PropertyDescriptorImpl.create(
|
||||
descriptor.containingDeclaration, descriptor.annotations, Modality.FINAL, descriptor.visibility, descriptor.isVar,
|
||||
descriptor.name, CallableMemberDescriptor.Kind.DECLARATION, descriptor.source, false, descriptor.isConst,
|
||||
false, false, false, @Suppress("DEPRECATION") descriptor.isDelegated
|
||||
false, false, false, descriptor.isDelegated
|
||||
)
|
||||
property.setType(
|
||||
descriptor.type, descriptor.typeParameters,
|
||||
|
||||
@@ -15,7 +15,10 @@ import org.jetbrains.kotlin.codegen.inline.coroutines.FOR_INLINE_SUFFIX
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicArrayConstructors
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.incremental.components.Position
|
||||
import org.jetbrains.kotlin.incremental.components.ScopeKind
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||
@@ -87,12 +90,9 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
isSameModule = sourceCompiler.isCallInsideSameModuleAsDeclared(functionDescriptor)
|
||||
|
||||
if (functionDescriptor !is FictitiousArrayConstructor) {
|
||||
val functionOrAccessorName = jvmSignature.asmMethod.name
|
||||
//track changes for property accessor and @JvmName inline functions/property accessors
|
||||
if (functionOrAccessorName != functionDescriptor.name.asString()) {
|
||||
val scope = getMemberScope(functionDescriptor)
|
||||
//Fake lookup to track track changes for property accessors and @JvmName functions/property accessors
|
||||
scope?.getContributedFunctions(Name.identifier(functionOrAccessorName), sourceCompiler.lookupLocation)
|
||||
if (jvmSignature.asmMethod.name != functionDescriptor.name.asString()) {
|
||||
trackLookup(functionDescriptor)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -500,19 +500,24 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
return true
|
||||
}
|
||||
|
||||
private fun trackLookup(functionOrAccessor: FunctionDescriptor) {
|
||||
val functionOrAccessorName = jvmSignature.asmMethod.name
|
||||
val lookupTracker = state.configuration.get(CommonConfigurationKeys.LOOKUP_TRACKER) ?: return
|
||||
val location = sourceCompiler.lookupLocation.location ?: return
|
||||
val position = if (lookupTracker.requiresPosition) location.position else Position.NO_POSITION
|
||||
val classOrPackageFragment = functionOrAccessor.containingDeclaration
|
||||
lookupTracker.record(
|
||||
location.filePath,
|
||||
position,
|
||||
DescriptorUtils.getFqName(classOrPackageFragment).asString(),
|
||||
ScopeKind.CLASSIFIER,
|
||||
functionOrAccessorName
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
companion object {
|
||||
|
||||
private fun getMemberScope(functionOrAccessor: FunctionDescriptor): MemberScope? {
|
||||
val callableMemberDescriptor = JvmCodegenUtil.getDirectMember(functionOrAccessor)
|
||||
val classOrPackageFragment = callableMemberDescriptor.containingDeclaration
|
||||
return when (classOrPackageFragment) {
|
||||
is ClassDescriptor -> classOrPackageFragment.unsubstitutedMemberScope
|
||||
is PackageFragmentDescriptor -> classOrPackageFragment.getMemberScope()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
internal fun createInlineMethodNode(
|
||||
functionDescriptor: FunctionDescriptor,
|
||||
methodOwner: Type,
|
||||
|
||||
@@ -100,6 +100,11 @@ class PsiDefaultLambda(
|
||||
override fun mapAsmSignature(sourceCompiler: SourceCompilerForInline): Method {
|
||||
return sourceCompiler.state.typeMapper.mapSignatureSkipGeneric(invokeMethodDescriptor).asmMethod
|
||||
}
|
||||
|
||||
override fun findInvokeMethodDescriptor(): FunctionDescriptor =
|
||||
parameterDescriptor.type.memberScope
|
||||
.getContributedFunctions(OperatorNameConventions.INVOKE, NoLookupLocation.FROM_BACKEND)
|
||||
.single()
|
||||
}
|
||||
|
||||
abstract class DefaultLambda(
|
||||
@@ -150,14 +155,10 @@ abstract class DefaultLambda(
|
||||
}
|
||||
}, ClassReader.SKIP_CODE or ClassReader.SKIP_FRAMES or ClassReader.SKIP_DEBUG)
|
||||
|
||||
invokeMethodDescriptor =
|
||||
parameterDescriptor.type.memberScope
|
||||
.getContributedFunctions(OperatorNameConventions.INVOKE, NoLookupLocation.FROM_BACKEND)
|
||||
.single()
|
||||
.let {
|
||||
//property reference generates erased 'get' method
|
||||
if (isPropertyReference) it.original else it
|
||||
}
|
||||
invokeMethodDescriptor = findInvokeMethodDescriptor().let {
|
||||
//property reference generates erased 'get' method
|
||||
if (isPropertyReference) it.original else it
|
||||
}
|
||||
|
||||
val descriptor = Type.getMethodDescriptor(Type.VOID_TYPE, *capturedArgs)
|
||||
val constructor = getMethodNode(
|
||||
@@ -206,6 +207,8 @@ abstract class DefaultLambda(
|
||||
|
||||
protected abstract fun mapAsmSignature(sourceCompiler: SourceCompilerForInline): Method
|
||||
|
||||
protected abstract fun findInvokeMethodDescriptor(): FunctionDescriptor
|
||||
|
||||
private companion object {
|
||||
val PROPERTY_REFERENCE_SUPER_CLASSES =
|
||||
listOf(
|
||||
|
||||
@@ -12,6 +12,7 @@ import org.jetbrains.kotlin.codegen.coroutines.*
|
||||
import org.jetbrains.kotlin.codegen.inline.*
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.asSequence
|
||||
import org.jetbrains.kotlin.codegen.optimization.transformer.MethodTransformer
|
||||
import org.jetbrains.kotlin.config.JVMConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.isReleaseCoroutines
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
@@ -95,7 +96,8 @@ class CoroutineTransformer(
|
||||
shouldPreserveClassInitialization = state.constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
||||
containingClassInternalName = classBuilder.thisName,
|
||||
isForNamedFunction = false,
|
||||
disableTailCallOptimizationForFunctionReturningUnit = false
|
||||
disableTailCallOptimizationForFunctionReturningUnit = false,
|
||||
useOldSpilledVarTypeAnalysis = state.configuration.getBoolean(JVMConfigurationKeys.USE_OLD_SPILLED_VAR_TYPE_ANALYSIS)
|
||||
)
|
||||
|
||||
if (generateForInline)
|
||||
@@ -131,7 +133,8 @@ class CoroutineTransformer(
|
||||
needDispatchReceiver = true,
|
||||
internalNameForDispatchReceiver = classBuilder.thisName,
|
||||
disableTailCallOptimizationForFunctionReturningUnit = disableTailCallOptimization,
|
||||
putContinuationParameterToLvt = !state.isIrBackend
|
||||
putContinuationParameterToLvt = !state.isIrBackend,
|
||||
useOldSpilledVarTypeAnalysis = state.configuration.getBoolean(JVMConfigurationKeys.USE_OLD_SPILLED_VAR_TYPE_ANALYSIS)
|
||||
)
|
||||
|
||||
if (generateForInline)
|
||||
|
||||
@@ -242,6 +242,17 @@ class CapturedVarsOptimizationMethodTransformer : MethodTransformer() {
|
||||
methodNode.removeUnusedLocalVariables()
|
||||
}
|
||||
|
||||
// Be careful to not remove instructions that are the only instruction for a line number. That will
|
||||
// break debugging. If the previous instruction is a line number and the following instruction is
|
||||
// a label followed by a line number, insert a nop instead of deleting the instruction.
|
||||
private fun InsnList.removeOrReplaceByNop(insn: AbstractInsnNode) {
|
||||
if (insn.previous is LineNumberNode && insn.next is LabelNode && insn.next.next is LineNumberNode) {
|
||||
set(insn, InsnNode(Opcodes.NOP))
|
||||
} else {
|
||||
remove(insn)
|
||||
}
|
||||
}
|
||||
|
||||
private fun rewriteRefValue(capturedVar: CapturedVarDescriptor) {
|
||||
methodNode.instructions.run {
|
||||
val localVar = capturedVar.localVar!!
|
||||
@@ -259,9 +270,10 @@ class CapturedVarsOptimizationMethodTransformer : MethodTransformer() {
|
||||
|
||||
remove(capturedVar.newInsn)
|
||||
remove(capturedVar.initCallInsn!!)
|
||||
capturedVar.stackInsns.forEach { remove(it) }
|
||||
capturedVar.aloadInsns.forEach { remove(it) }
|
||||
capturedVar.astoreInsns.forEach { remove(it) }
|
||||
|
||||
capturedVar.stackInsns.forEach { removeOrReplaceByNop(it) }
|
||||
capturedVar.aloadInsns.forEach { removeOrReplaceByNop(it) }
|
||||
capturedVar.astoreInsns.forEach { removeOrReplaceByNop(it) }
|
||||
capturedVar.getFieldInsns.forEach { set(it, VarInsnNode(loadOpcode, capturedVar.localVarIndex)) }
|
||||
capturedVar.putFieldInsns.forEach { set(it, VarInsnNode(storeOpcode, capturedVar.localVarIndex)) }
|
||||
|
||||
@@ -273,6 +285,7 @@ class CapturedVarsOptimizationMethodTransformer : MethodTransformer() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ fun ExpressionCodegen.createRangeValueForExpression(rangeExpression: KtExpressio
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
fun isLocalVarReference(rangeExpression: KtExpression, bindingContext: BindingContext): Boolean {
|
||||
if (rangeExpression !is KtSimpleNameExpression) return false
|
||||
val resultingDescriptor = rangeExpression.getResolvedCall(bindingContext)?.resultingDescriptor ?: return false
|
||||
|
||||
@@ -94,7 +94,13 @@ class JvmSerializerExtension @JvmOverloads constructor(
|
||||
writeVersionRequirementForJvmDefaultIfNeeded(descriptor, proto, versionRequirementTable)
|
||||
|
||||
if (jvmDefaultMode.forAllMethodsWithBody && isInterface(descriptor)) {
|
||||
proto.setExtension(JvmProtoBuf.jvmClassFlags, JvmFlags.getClassFlags(true))
|
||||
proto.setExtension(
|
||||
JvmProtoBuf.jvmClassFlags,
|
||||
JvmFlags.getClassFlags(
|
||||
jvmDefaultMode.forAllMethodsWithBody,
|
||||
JvmDefaultMode.ALL_COMPATIBILITY == jvmDefaultMode
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -295,7 +301,7 @@ class JvmSerializerExtension @JvmOverloads constructor(
|
||||
super.serializeErrorType(type, builder)
|
||||
}
|
||||
|
||||
private fun <K, V> getBinding(slice: SerializationMappingSlice<K, V>, key: K): V? =
|
||||
private fun <K : Any, V> getBinding(slice: SerializationMappingSlice<K, V>, key: K): V? =
|
||||
bindings.get(slice, key) ?: globalBindings.get(slice, key)
|
||||
|
||||
private inner class SignatureSerializer {
|
||||
|
||||
@@ -23,7 +23,9 @@ import org.jetbrains.kotlin.codegen.signature.BothSignatureWriter
|
||||
import org.jetbrains.kotlin.codegen.signature.JvmSignatureWriter
|
||||
import org.jetbrains.kotlin.config.*
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.impl.*
|
||||
import org.jetbrains.kotlin.descriptors.impl.LocalVariableAccessorDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.impl.LocalVariableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.impl.TypeAliasConstructorDescriptor
|
||||
import org.jetbrains.kotlin.fileClasses.JvmFileClassUtil
|
||||
import org.jetbrains.kotlin.load.java.BuiltinMethodsWithSpecialGenericSignature
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
@@ -1208,7 +1210,7 @@ class KotlinTypeMapper @JvmOverloads constructor(
|
||||
return StackValue.sharedTypeForType(mapType(receiverParameter.type))
|
||||
}
|
||||
|
||||
if (descriptor is LocalVariableDescriptor && @Suppress("DEPRECATION") descriptor.isDelegated) {
|
||||
if (descriptor is LocalVariableDescriptor && descriptor.isDelegated) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ class BuiltInsSerializer(dependOnOldBuiltIns: Boolean) : MetadataSerializer(Buil
|
||||
put(CommonConfigurationKeys.MODULE_NAME, "module for built-ins serialization")
|
||||
}
|
||||
|
||||
val environment = KotlinCoreEnvironment.createForTests(rootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
val environment = KotlinCoreEnvironment.createForProduction(rootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
|
||||
serialize(environment)
|
||||
|
||||
|
||||
@@ -340,6 +340,12 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
)
|
||||
var explicitApi: String by FreezableVar(ExplicitApiMode.DISABLED.state)
|
||||
|
||||
@Argument(
|
||||
value = "-Xdeserialize-fake-overrides",
|
||||
description = "Fallback to deserializing fake overrides"
|
||||
)
|
||||
var deserializeFakeOverrides: Boolean by FreezableVar(false)
|
||||
|
||||
open fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
||||
return HashMap<AnalysisFlag<*>, Any>().apply {
|
||||
put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck)
|
||||
@@ -382,6 +388,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
put(LanguageFeature.NewInference, LanguageFeature.State.ENABLED)
|
||||
put(LanguageFeature.SamConversionPerArgument, LanguageFeature.State.ENABLED)
|
||||
put(LanguageFeature.FunctionReferenceWithDefaultValueAsOtherType, LanguageFeature.State.ENABLED)
|
||||
put(LanguageFeature.DisableCompatibilityModeForNewInference, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
if (inlineClasses) {
|
||||
@@ -461,6 +468,8 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
|
||||
if (!functionReferenceWithDefaultValueFeaturePassedExplicitly)
|
||||
put(LanguageFeature.FunctionReferenceWithDefaultValueAsOtherType, LanguageFeature.State.ENABLED)
|
||||
|
||||
put(LanguageFeature.DisableCompatibilityModeForNewInference, LanguageFeature.State.ENABLED)
|
||||
}
|
||||
|
||||
if (featuresThatForcePreReleaseBinaries.isNotEmpty()) {
|
||||
|
||||
@@ -135,6 +135,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var irModuleName: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(value = "-Xir-per-module", description = "Splits generated .js per-module")
|
||||
var irPerModule: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xinclude",
|
||||
valueDescription = "<path>",
|
||||
@@ -169,6 +172,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
|
||||
@Argument(value = "-Xenable-js-scripting", description = "Enable experimental support of .kts files using K/JS (with -Xir only)")
|
||||
var enableJsScripting: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(value = "-Xdisable-fake-override-validator", description = "Disable IR fake override validator")
|
||||
var disableFakeOverrideValidator: Boolean by FreezableVar(false)
|
||||
|
||||
override fun checkIrSupport(languageVersionSettings: LanguageVersionSettings, collector: MessageCollector) {
|
||||
if (!isIrBackendEnabled()) return
|
||||
|
||||
|
||||
@@ -369,6 +369,12 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
)
|
||||
var repeatCompileModules: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
value = "-Xuse-old-spilled-var-type-analysis",
|
||||
description = "Use old, SourceInterpreter-based analysis for fields, used for spilled variables in coroutines"
|
||||
)
|
||||
var useOldSpilledVarTypeAnalysis: Boolean by FreezableVar(false)
|
||||
|
||||
override fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
||||
val result = super.configureAnalysisFlags(collector)
|
||||
result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics
|
||||
|
||||
@@ -229,14 +229,19 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
mainArguments = mainCallArguments,
|
||||
generateFullJs = !arguments.irDce,
|
||||
generateDceJs = arguments.irDce,
|
||||
dceDriven = arguments.irDceDriven
|
||||
dceDriven = arguments.irDceDriven,
|
||||
multiModule = arguments.irPerModule,
|
||||
relativeRequirePath = true
|
||||
)
|
||||
} catch (e: JsIrCompilationError) {
|
||||
return COMPILATION_ERROR
|
||||
}
|
||||
|
||||
val jsCode = if (arguments.irDce && !arguments.irDceDriven) compiledModule.dceJsCode!! else compiledModule.jsCode!!
|
||||
outputFile.writeText(jsCode)
|
||||
outputFile.writeText(jsCode.mainModule)
|
||||
jsCode.dependencies.forEach { (name, content) ->
|
||||
outputFile.resolveSibling("$name.js").writeText(content)
|
||||
}
|
||||
if (arguments.generateDts) {
|
||||
val dtsFile = outputFile.withReplacedExtensionOrNull(outputFile.extension, "d.ts")!!
|
||||
dtsFile.writeText(compiledModule.tsDefinitions ?: error("No ts definitions"))
|
||||
@@ -322,6 +327,7 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
|
||||
}
|
||||
|
||||
configuration.put(JSConfigurationKeys.PRINT_REACHABILITY_INFO, arguments.irDcePrintReachabilityInfo)
|
||||
configuration.put(JSConfigurationKeys.DISABLE_FAKE_OVERRIDE_VALIDATOR, arguments.disableFakeOverrideValidator)
|
||||
}
|
||||
|
||||
override fun executableScriptFileName(): String {
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract class CLICompiler<A : CommonCompilerArguments> : CLITool<A>() {
|
||||
|
||||
protected abstract val performanceManager: CommonCompilerPerformanceManager
|
||||
|
||||
protected open fun createPerformanceManager(arguments: A): CommonCompilerPerformanceManager = performanceManager
|
||||
protected open fun createPerformanceManager(arguments: A, services: Services): CommonCompilerPerformanceManager = performanceManager
|
||||
|
||||
// Used in CompilerRunnerUtil#invokeExecMethod, in Eclipse plugin (KotlinCLICompiler) and in kotlin-gradle-plugin (GradleCompilerRunner)
|
||||
fun execAndOutputXml(errStream: PrintStream, services: Services, vararg args: String): ExitCode {
|
||||
@@ -58,7 +58,7 @@ abstract class CLICompiler<A : CommonCompilerArguments> : CLITool<A>() {
|
||||
}
|
||||
|
||||
public override fun execImpl(messageCollector: MessageCollector, services: Services, arguments: A): ExitCode {
|
||||
val performanceManager = createPerformanceManager(arguments)
|
||||
val performanceManager = createPerformanceManager(arguments, services)
|
||||
if (arguments.reportPerf || arguments.dumpPerf != null) {
|
||||
performanceManager.enableCollectingPerformanceStatistics()
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ package org.jetbrains.kotlin.cli.common
|
||||
|
||||
import org.jetbrains.kotlin.util.PerformanceCounter
|
||||
import java.io.File
|
||||
import java.lang.management.GarbageCollectorMXBean
|
||||
import java.lang.management.ManagementFactory
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
@@ -18,13 +19,21 @@ abstract class CommonCompilerPerformanceManager(private val presentableName: Str
|
||||
private var analysisStart: Long = 0
|
||||
private var generationStart: Long = 0
|
||||
|
||||
private var startGCData = mutableMapOf<String, GCData>()
|
||||
|
||||
private var irTranslationStart: Long = 0
|
||||
private var irGenerationStart: Long = 0
|
||||
|
||||
fun getMeasurementResults(): List<PerformanceMeasurement> = measurements
|
||||
|
||||
fun enableCollectingPerformanceStatistics() {
|
||||
isEnabled = true
|
||||
PerformanceCounter.setTimeCounterEnabled(true)
|
||||
ManagementFactory.getGarbageCollectorMXBeans().associateTo(startGCData) { it.name to GCData(it) }
|
||||
}
|
||||
|
||||
private fun deltaTime(start: Long): Long = PerformanceCounter.currentTime() - start
|
||||
|
||||
open fun notifyCompilerInitialized() {
|
||||
if (!isEnabled) return
|
||||
recordInitializationTime()
|
||||
@@ -50,9 +59,39 @@ abstract class CommonCompilerPerformanceManager(private val presentableName: Str
|
||||
generationStart = PerformanceCounter.currentTime()
|
||||
}
|
||||
|
||||
open fun notifyGenerationFinished(lines: Int, files: Int, additionalDescription: String) {
|
||||
open fun notifyGenerationFinished(files: Int, lines: Int, additionalDescription: String) {
|
||||
val time = PerformanceCounter.currentTime() - generationStart
|
||||
measurements += CodeGenerationMeasurement(lines, files, TimeUnit.NANOSECONDS.toMillis(time), additionalDescription)
|
||||
measurements += CodeGenerationMeasurement(files, lines, TimeUnit.NANOSECONDS.toMillis(time), additionalDescription)
|
||||
}
|
||||
|
||||
open fun notifyIRTranslationStarted() {
|
||||
irTranslationStart = PerformanceCounter.currentTime()
|
||||
}
|
||||
|
||||
open fun notifyIRTranslationFinished(files: Int, lines: Int, additionalDescription: String?) {
|
||||
val time = deltaTime(irTranslationStart)
|
||||
measurements += IRMeasurement(
|
||||
files,
|
||||
lines,
|
||||
TimeUnit.NANOSECONDS.toMillis(time),
|
||||
additionalDescription,
|
||||
IRMeasurement.Kind.Translation
|
||||
)
|
||||
}
|
||||
|
||||
open fun notifyIRGenerationStarted() {
|
||||
irGenerationStart = PerformanceCounter.currentTime()
|
||||
}
|
||||
|
||||
open fun notifyIRGenerationFinished(files: Int, lines: Int, additionalDescription: String) {
|
||||
val time = deltaTime(irGenerationStart)
|
||||
measurements += IRMeasurement(
|
||||
files,
|
||||
lines,
|
||||
TimeUnit.NANOSECONDS.toMillis(time),
|
||||
additionalDescription,
|
||||
IRMeasurement.Kind.Generation
|
||||
)
|
||||
}
|
||||
|
||||
fun dumpPerformanceReport(destination: File) {
|
||||
@@ -63,7 +102,14 @@ abstract class CommonCompilerPerformanceManager(private val presentableName: Str
|
||||
if (!isEnabled) return
|
||||
|
||||
ManagementFactory.getGarbageCollectorMXBeans().forEach {
|
||||
measurements += GarbageCollectionMeasurement(it.name, it.collectionTime)
|
||||
val startCounts = startGCData[it.name]
|
||||
val startCollectionTime = startCounts?.collectionTime ?: 0
|
||||
val startCollectionCount = startCounts?.collectionCount ?: 0
|
||||
measurements += GarbageCollectionMeasurement(
|
||||
it.name,
|
||||
it.collectionTime - startCollectionTime,
|
||||
it.collectionCount - startCollectionCount
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,4 +135,8 @@ abstract class CommonCompilerPerformanceManager(private val presentableName: Str
|
||||
}.toByteArray()
|
||||
|
||||
open fun notifyRepeat(total: Int, number: Int) {}
|
||||
|
||||
private data class GCData(val name: String, val collectionTime: Long, val collectionCount: Long) {
|
||||
constructor(bean: GarbageCollectorMXBean) : this(bean.name, bean.collectionTime, bean.collectionCount)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ fun <A : CommonCompilerArguments> CompilerConfiguration.setupCommonArguments(
|
||||
put(CommonConfigurationKeys.EXPECT_ACTUAL_LINKER, arguments.expectActualLinker)
|
||||
putIfNotNull(CLIConfigurationKeys.INTELLIJ_PLUGIN_ROOT, arguments.intellijPluginRoot)
|
||||
put(CommonConfigurationKeys.REPORT_OUTPUT_FILES, arguments.reportOutputFiles)
|
||||
put(CommonConfigurationKeys.DESERIALIZE_FAKE_OVERRIDES, arguments.deserializeFakeOverrides)
|
||||
|
||||
val metadataVersionString = arguments.metadataVersion
|
||||
if (metadataVersionString != null) {
|
||||
|
||||
@@ -20,13 +20,13 @@ class CompilerInitializationMeasurement(private val milliseconds: Long) : Perfor
|
||||
}
|
||||
|
||||
|
||||
class CodeAnalysisMeasurement(private val files: Int, val lines: Int, private val milliseconds: Long, private val description: String?) :
|
||||
class CodeAnalysisMeasurement(val files: Int, val lines: Int, val milliseconds: Long, private val description: String?) :
|
||||
PerformanceMeasurement {
|
||||
|
||||
private val speed: Double = lines.toDouble() * 1000 / milliseconds
|
||||
val lps: Double = lines.toDouble() * 1000 / milliseconds
|
||||
|
||||
override fun render(): String =
|
||||
"ANALYZE: $files files ($lines lines) ${description ?: ""}in $milliseconds ms - ${"%.3f".format(speed)} loc/s"
|
||||
"ANALYZE: $files files ($lines lines) ${description ?: ""}in $milliseconds ms - ${"%.3f".format(lps)} loc/s"
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,23 @@ class CodeGenerationMeasurement(private val files: Int, val lines: Int, private
|
||||
}
|
||||
|
||||
|
||||
class GarbageCollectionMeasurement(private val garbageCollectionKind: String, private val milliseconds: Long) : PerformanceMeasurement {
|
||||
override fun render(): String = "GC time for $garbageCollectionKind is $milliseconds ms"
|
||||
class GarbageCollectionMeasurement(val garbageCollectionKind: String, val milliseconds: Long, val count: Long) : PerformanceMeasurement {
|
||||
override fun render(): String = "GC time for $garbageCollectionKind is $milliseconds ms, $count collections"
|
||||
}
|
||||
|
||||
|
||||
class PerformanceCounterMeasurement(private val counterReport: String) : PerformanceMeasurement {
|
||||
override fun render(): String = counterReport
|
||||
}
|
||||
|
||||
class IRMeasurement(val files: Int, val lines: Int, val milliseconds: Long, private val description: String?, val kind: Kind) :
|
||||
PerformanceMeasurement {
|
||||
|
||||
val lps: Double = lines.toDouble() * 1000 / milliseconds
|
||||
override fun render(): String =
|
||||
"IR: $kind $files files ($lines lines) ${description ?: ""}in $milliseconds ms - ${"%.3f".format(lps)} loc/s"
|
||||
|
||||
enum class Kind {
|
||||
Generation, Translation
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,7 +267,9 @@ class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
override val performanceManager: CommonCompilerPerformanceManager
|
||||
get() = error("Unsupported")
|
||||
|
||||
override fun createPerformanceManager(arguments: K2JVMCompilerArguments): CommonCompilerPerformanceManager {
|
||||
override fun createPerformanceManager(arguments: K2JVMCompilerArguments, services: Services): CommonCompilerPerformanceManager {
|
||||
val externalManager = services[CommonCompilerPerformanceManager::class.java]
|
||||
if (externalManager != null) return externalManager
|
||||
val argument = arguments.profileCompilerCommand ?: return K2JVMCompilerPerformanceManager()
|
||||
return ProfilingCompilerPerformanceManager.create(argument)
|
||||
}
|
||||
|
||||
@@ -4,147 +4,52 @@
|
||||
*/
|
||||
package org.jetbrains.kotlin.cli.jvm.compiler;
|
||||
|
||||
import com.intellij.DynamicBundle;
|
||||
import com.intellij.codeInsight.ContainerProvider;
|
||||
import com.intellij.codeInsight.JavaContainerProvider;
|
||||
import com.intellij.codeInsight.folding.JavaCodeFoldingSettings;
|
||||
import com.intellij.codeInsight.folding.impl.JavaCodeFoldingSettingsBase;
|
||||
import com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase;
|
||||
import com.intellij.codeInsight.runner.JavaMainMethodProvider;
|
||||
import com.intellij.core.CoreApplicationEnvironment;
|
||||
import com.intellij.core.CoreJavaDirectoryService;
|
||||
import com.intellij.core.CorePsiPackageImplementationHelper;
|
||||
import com.intellij.ide.highlighter.ArchiveFileType;
|
||||
import com.intellij.ide.highlighter.JavaClassFileType;
|
||||
import com.intellij.ide.highlighter.JavaFileType;
|
||||
import com.intellij.lang.LanguageASTFactory;
|
||||
import com.intellij.core.JavaCoreApplicationEnvironment;
|
||||
import com.intellij.lang.MetaLanguage;
|
||||
import com.intellij.lang.folding.LanguageFolding;
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
import com.intellij.lang.java.JavaParserDefinition;
|
||||
import com.intellij.navigation.ItemPresentationProviders;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.extensions.ExtensionsArea;
|
||||
import com.intellij.openapi.fileTypes.FileTypeExtensionPoint;
|
||||
import com.intellij.openapi.fileTypes.PlainTextFileType;
|
||||
import com.intellij.openapi.fileTypes.PlainTextLanguage;
|
||||
import com.intellij.openapi.fileTypes.PlainTextParserDefinition;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.openapi.vfs.VirtualFileSystem;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.FileContextProvider;
|
||||
import com.intellij.psi.augment.PsiAugmentProvider;
|
||||
import com.intellij.psi.augment.TypeAnnotationModifier;
|
||||
import com.intellij.psi.compiled.ClassFileDecompilers;
|
||||
import com.intellij.psi.impl.LanguageConstantExpressionEvaluator;
|
||||
import com.intellij.psi.impl.PsiExpressionEvaluator;
|
||||
import com.intellij.psi.impl.PsiSubstitutorFactoryImpl;
|
||||
import com.intellij.psi.impl.compiled.ClassFileStubBuilder;
|
||||
import com.intellij.psi.impl.file.PsiPackageImplementationHelper;
|
||||
import com.intellij.psi.impl.search.MethodSuperSearcher;
|
||||
import com.intellij.psi.impl.source.tree.JavaASTFactory;
|
||||
import com.intellij.psi.impl.source.tree.PlainTextASTFactory;
|
||||
import com.intellij.psi.meta.MetaDataContributor;
|
||||
import com.intellij.psi.presentation.java.*;
|
||||
import com.intellij.psi.search.searches.SuperMethodsSearch;
|
||||
import com.intellij.psi.stubs.BinaryFileStubBuilders;
|
||||
import com.intellij.util.QueryExecutor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.cli.jvm.modules.CoreJrtFileSystem;
|
||||
|
||||
/**
|
||||
* adapted from com.intellij.core.JavaCoreApplicationEnvironment
|
||||
* TODO: initiate removal original from com.intellij.core since it seems that there are no usages left
|
||||
*/
|
||||
public class KotlinCoreApplicationEnvironment extends CoreApplicationEnvironment {
|
||||
public class KotlinCoreApplicationEnvironment extends JavaCoreApplicationEnvironment {
|
||||
public static KotlinCoreApplicationEnvironment create(@NotNull Disposable parentDisposable, boolean unitTestMode) {
|
||||
KotlinCoreApplicationEnvironment environment = new KotlinCoreApplicationEnvironment(parentDisposable, unitTestMode);
|
||||
registerExtensionPoints();
|
||||
return environment;
|
||||
}
|
||||
|
||||
public static KotlinCoreApplicationEnvironment create(@NotNull Disposable parentDisposable, boolean unitTestMode) {
|
||||
return new KotlinCoreApplicationEnvironment(parentDisposable, unitTestMode);
|
||||
}
|
||||
private KotlinCoreApplicationEnvironment(@NotNull Disposable parentDisposable, boolean unitTestMode) {
|
||||
super(parentDisposable, unitTestMode);
|
||||
}
|
||||
|
||||
private KotlinCoreApplicationEnvironment(@NotNull Disposable parentDisposable, boolean unitTestMode) {
|
||||
super(parentDisposable, unitTestMode);
|
||||
private static void registerExtensionPoints() {
|
||||
registerApplicationExtensionPoint(DynamicBundle.LanguageBundleEP.EP_NAME, DynamicBundle.LanguageBundleEP.class);
|
||||
registerApplicationExtensionPoint(FileContextProvider.EP_NAME, FileContextProvider.class);
|
||||
|
||||
registerExtensionPoints();
|
||||
registerApplicationExtensionPoint(MetaDataContributor.EP_NAME, MetaDataContributor.class);
|
||||
registerApplicationExtensionPoint(PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
|
||||
registerApplicationExtensionPoint(JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
|
||||
|
||||
registerExtensions();
|
||||
}
|
||||
registerApplicationExtensionPoint(ContainerProvider.EP_NAME, ContainerProvider.class);
|
||||
registerApplicationExtensionPoint(ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
|
||||
|
||||
private void registerExtensionPoints() {
|
||||
ExtensionsArea area = Extensions.getRootArea();
|
||||
registerApplicationExtensionPoint(MetaLanguage.EP_NAME, MetaLanguage.class);
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, BinaryFileStubBuilders.EP_NAME, FileTypeExtensionPoint.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, FileContextProvider.EP_NAME, FileContextProvider.class);
|
||||
IdeaExtensionPoints.INSTANCE.registerVersionSpecificAppExtensionPoints(Extensions.getRootArea());
|
||||
}
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, MetaDataContributor.EP_NAME, MetaDataContributor.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, ContainerProvider.EP_NAME, ContainerProvider.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, TypeAnnotationModifier.EP_NAME, TypeAnnotationModifier.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, MetaLanguage.EP_NAME, MetaLanguage.class);
|
||||
|
||||
IdeaExtensionPoints.INSTANCE.registerVersionSpecificAppExtensionPoints(area);
|
||||
}
|
||||
|
||||
private void registerExtensions() {
|
||||
registerFileType(JavaClassFileType.INSTANCE, "class");
|
||||
registerFileType(JavaFileType.INSTANCE, "java");
|
||||
registerFileType(ArchiveFileType.INSTANCE, "jar;zip");
|
||||
registerFileType(PlainTextFileType.INSTANCE, "txt;sh;bat;cmd;policy;log;cgi;MF;jad;jam;htaccess");
|
||||
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, PlainTextLanguage.INSTANCE, new PlainTextASTFactory());
|
||||
registerParserDefinition(new PlainTextParserDefinition());
|
||||
|
||||
addExplicitExtension(FileTypeFileViewProviders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileViewProviderFactory());
|
||||
addExplicitExtension(BinaryFileStubBuilders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileStubBuilder());
|
||||
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, JavaLanguage.INSTANCE, new JavaASTFactory());
|
||||
registerParserDefinition(new JavaParserDefinition());
|
||||
addExplicitExtension(LanguageConstantExpressionEvaluator.INSTANCE, JavaLanguage.INSTANCE, new PsiExpressionEvaluator());
|
||||
|
||||
addExtension(ContainerProvider.EP_NAME, new JavaContainerProvider());
|
||||
|
||||
myApplication.registerService(PsiPackageImplementationHelper.class, new CorePsiPackageImplementationHelper());
|
||||
myApplication.registerService(PsiSubstitutorFactory.class, new PsiSubstitutorFactoryImpl());
|
||||
|
||||
myApplication.registerService(JavaDirectoryService.class, createJavaDirectoryService());
|
||||
myApplication.registerService(JavaVersionService.class, new JavaVersionService());
|
||||
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiPackage.class, new PackagePresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiClass.class, new ClassPresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiMethod.class, new MethodPresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiField.class, new FieldPresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiLocalVariable.class, new VariablePresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiParameter.class, new VariablePresentationProvider());
|
||||
|
||||
registerApplicationService(JavaCodeFoldingSettings.class, new JavaCodeFoldingSettingsBase());
|
||||
addExplicitExtension(LanguageFolding.INSTANCE, JavaLanguage.INSTANCE, new JavaFoldingBuilderBase() {
|
||||
@Override
|
||||
protected boolean shouldShowExplicitLambdaType(@NotNull PsiAnonymousClass anonymousClass, @NotNull PsiNewExpression expression) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isBelowRightMargin(@NotNull PsiFile file, int lineLength) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
registerApplicationExtensionPoint(SuperMethodsSearch.EP_NAME, QueryExecutor.class);
|
||||
addExtension(SuperMethodsSearch.EP_NAME, new MethodSuperSearcher());
|
||||
}
|
||||
|
||||
// overridden in upsource
|
||||
protected CoreJavaDirectoryService createJavaDirectoryService() {
|
||||
return new CoreJavaDirectoryService();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected VirtualFileSystem createJrtFileSystem() {
|
||||
return new CoreJrtFileSystem();
|
||||
}
|
||||
@Nullable
|
||||
@Override
|
||||
protected VirtualFileSystem createJrtFileSystem() {
|
||||
return new CoreJrtFileSystem();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
package org.jetbrains.kotlin.cli.jvm.compiler;
|
||||
|
||||
import com.intellij.codeInsight.ContainerProvider;
|
||||
import com.intellij.codeInsight.JavaContainerProvider;
|
||||
import com.intellij.codeInsight.folding.JavaCodeFoldingSettings;
|
||||
import com.intellij.codeInsight.folding.impl.JavaCodeFoldingSettingsBase;
|
||||
import com.intellij.codeInsight.folding.impl.JavaFoldingBuilderBase;
|
||||
import com.intellij.codeInsight.runner.JavaMainMethodProvider;
|
||||
import com.intellij.core.CoreApplicationEnvironment;
|
||||
import com.intellij.core.CoreJavaDirectoryService;
|
||||
import com.intellij.core.CorePsiPackageImplementationHelper;
|
||||
import com.intellij.ide.highlighter.ArchiveFileType;
|
||||
import com.intellij.ide.highlighter.JavaClassFileType;
|
||||
import com.intellij.ide.highlighter.JavaFileType;
|
||||
import com.intellij.lang.LanguageASTFactory;
|
||||
import com.intellij.lang.MetaLanguage;
|
||||
import com.intellij.lang.folding.LanguageFolding;
|
||||
import com.intellij.lang.java.JavaLanguage;
|
||||
import com.intellij.lang.java.JavaParserDefinition;
|
||||
import com.intellij.navigation.ItemPresentationProviders;
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.extensions.ExtensionsArea;
|
||||
import com.intellij.openapi.fileTypes.FileTypeExtensionPoint;
|
||||
import com.intellij.openapi.fileTypes.PlainTextFileType;
|
||||
import com.intellij.openapi.fileTypes.PlainTextLanguage;
|
||||
import com.intellij.openapi.fileTypes.PlainTextParserDefinition;
|
||||
import com.intellij.openapi.projectRoots.JavaVersionService;
|
||||
import com.intellij.openapi.vfs.VirtualFileSystem;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.augment.PsiAugmentProvider;
|
||||
import com.intellij.psi.augment.TypeAnnotationModifier;
|
||||
import com.intellij.psi.compiled.ClassFileDecompilers;
|
||||
import com.intellij.psi.impl.LanguageConstantExpressionEvaluator;
|
||||
import com.intellij.psi.impl.PsiExpressionEvaluator;
|
||||
import com.intellij.psi.impl.PsiSubstitutorFactoryImpl;
|
||||
import com.intellij.psi.impl.compiled.ClassFileStubBuilder;
|
||||
import com.intellij.psi.impl.file.PsiPackageImplementationHelper;
|
||||
import com.intellij.psi.impl.search.MethodSuperSearcher;
|
||||
import com.intellij.psi.impl.source.tree.JavaASTFactory;
|
||||
import com.intellij.psi.impl.source.tree.PlainTextASTFactory;
|
||||
import com.intellij.psi.meta.MetaDataContributor;
|
||||
import com.intellij.psi.presentation.java.*;
|
||||
import com.intellij.psi.search.searches.SuperMethodsSearch;
|
||||
import com.intellij.psi.stubs.BinaryFileStubBuilders;
|
||||
import com.intellij.util.QueryExecutor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.cli.jvm.modules.CoreJrtFileSystem;
|
||||
|
||||
/**
|
||||
* adapted from com.intellij.core.JavaCoreApplicationEnvironment
|
||||
* TODO: initiate removal original from com.intellij.core since it seems that there are no usages left
|
||||
*/
|
||||
public class KotlinCoreApplicationEnvironment extends CoreApplicationEnvironment {
|
||||
|
||||
public static KotlinCoreApplicationEnvironment create(@NotNull Disposable parentDisposable, boolean unitTestMode) {
|
||||
return new KotlinCoreApplicationEnvironment(parentDisposable, unitTestMode);
|
||||
}
|
||||
|
||||
private KotlinCoreApplicationEnvironment(@NotNull Disposable parentDisposable, boolean unitTestMode) {
|
||||
super(parentDisposable, unitTestMode);
|
||||
|
||||
registerExtensionPoints();
|
||||
|
||||
registerExtensions();
|
||||
}
|
||||
|
||||
private void registerExtensionPoints() {
|
||||
ExtensionsArea area = Extensions.getRootArea();
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, BinaryFileStubBuilders.EP_NAME, FileTypeExtensionPoint.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, FileContextProvider.EP_NAME, FileContextProvider.class);
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, MetaDataContributor.EP_NAME, MetaDataContributor.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, ContainerProvider.EP_NAME, ContainerProvider.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
|
||||
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, TypeAnnotationModifier.EP_NAME, TypeAnnotationModifier.class);
|
||||
CoreApplicationEnvironment.registerExtensionPoint(area, MetaLanguage.EP_NAME, MetaLanguage.class);
|
||||
|
||||
IdeaExtensionPoints.INSTANCE.registerVersionSpecificAppExtensionPoints(area);
|
||||
}
|
||||
|
||||
private void registerExtensions() {
|
||||
registerFileType(JavaClassFileType.INSTANCE, "class");
|
||||
registerFileType(JavaFileType.INSTANCE, "java");
|
||||
registerFileType(ArchiveFileType.INSTANCE, "jar;zip");
|
||||
registerFileType(PlainTextFileType.INSTANCE, "txt;sh;bat;cmd;policy;log;cgi;MF;jad;jam;htaccess");
|
||||
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, PlainTextLanguage.INSTANCE, new PlainTextASTFactory());
|
||||
registerParserDefinition(new PlainTextParserDefinition());
|
||||
|
||||
addExplicitExtension(FileTypeFileViewProviders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileViewProviderFactory());
|
||||
addExplicitExtension(BinaryFileStubBuilders.INSTANCE, JavaClassFileType.INSTANCE, new ClassFileStubBuilder());
|
||||
|
||||
addExplicitExtension(LanguageASTFactory.INSTANCE, JavaLanguage.INSTANCE, new JavaASTFactory());
|
||||
registerParserDefinition(new JavaParserDefinition());
|
||||
addExplicitExtension(LanguageConstantExpressionEvaluator.INSTANCE, JavaLanguage.INSTANCE, new PsiExpressionEvaluator());
|
||||
|
||||
addExtension(ContainerProvider.EP_NAME, new JavaContainerProvider());
|
||||
|
||||
myApplication.registerService(PsiPackageImplementationHelper.class, new CorePsiPackageImplementationHelper());
|
||||
myApplication.registerService(PsiSubstitutorFactory.class, new PsiSubstitutorFactoryImpl());
|
||||
|
||||
myApplication.registerService(JavaDirectoryService.class, createJavaDirectoryService());
|
||||
myApplication.registerService(JavaVersionService.class, new JavaVersionService());
|
||||
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiPackage.class, new PackagePresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiClass.class, new ClassPresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiMethod.class, new MethodPresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiField.class, new FieldPresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiLocalVariable.class, new VariablePresentationProvider());
|
||||
addExplicitExtension(ItemPresentationProviders.INSTANCE, PsiParameter.class, new VariablePresentationProvider());
|
||||
|
||||
registerApplicationService(JavaCodeFoldingSettings.class, new JavaCodeFoldingSettingsBase());
|
||||
addExplicitExtension(LanguageFolding.INSTANCE, JavaLanguage.INSTANCE, new JavaFoldingBuilderBase() {
|
||||
@Override
|
||||
protected boolean shouldShowExplicitLambdaType(@NotNull PsiAnonymousClass anonymousClass, @NotNull PsiNewExpression expression) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isBelowRightMargin(@NotNull PsiFile file, int lineLength) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
registerApplicationExtensionPoint(SuperMethodsSearch.EP_NAME, QueryExecutor.class);
|
||||
addExtension(SuperMethodsSearch.EP_NAME, new MethodSuperSearcher());
|
||||
}
|
||||
|
||||
// overridden in upsource
|
||||
protected CoreJavaDirectoryService createJavaDirectoryService() {
|
||||
return new CoreJavaDirectoryService();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected VirtualFileSystem createJrtFileSystem() {
|
||||
return new CoreJrtFileSystem();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
package org.jetbrains.kotlin.cli.jvm.compiler;
|
||||
@@ -40,7 +40,7 @@ public class KotlinCoreApplicationEnvironment extends JavaCoreApplicationEnviron
|
||||
registerApplicationExtensionPoint(JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
|
||||
|
||||
registerApplicationExtensionPoint(ContainerProvider.EP_NAME, ContainerProvider.class);
|
||||
registerApplicationExtensionPoint(ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
|
||||
registerApplicationExtensionPoint(ClassFileDecompilers.getInstance().EP_NAME, ClassFileDecompilers.Decompiler.class);
|
||||
|
||||
registerApplicationExtensionPoint(MetaLanguage.EP_NAME, MetaLanguage.class);
|
||||
|
||||
@@ -374,6 +374,7 @@ object KotlinToJVMBytecodeCompiler {
|
||||
performanceManager?.notifyGenerationStarted()
|
||||
val signaturer = IdSignatureDescriptor(JvmManglerDesc())
|
||||
|
||||
performanceManager?.notifyIRTranslationStarted()
|
||||
val (moduleFragment, symbolTable, sourceManager, components) =
|
||||
Fir2IrConverter.createModuleFragment(
|
||||
session, resolveTransformer.scopeSession, firFiles,
|
||||
@@ -381,6 +382,9 @@ object KotlinToJVMBytecodeCompiler {
|
||||
generatorExtensions = JvmGeneratorExtensions(),
|
||||
mangler = FirJvmKotlinMangler(session)
|
||||
)
|
||||
|
||||
performanceManager?.notifyIRTranslationFinished(ktFiles.size, codeLines, debugTargetDescription)
|
||||
|
||||
val dummyBindingContext = NoScopeRecordCliBindingTrace().bindingContext
|
||||
|
||||
val codegenFactory = JvmIrCodegenFactory(moduleConfiguration.get(CLIConfigurationKeys.PHASE_CONFIG) ?: PhaseConfig(jvmPhases))
|
||||
@@ -402,7 +406,7 @@ object KotlinToJVMBytecodeCompiler {
|
||||
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||
|
||||
|
||||
performanceManager?.notifyIRGenerationStarted()
|
||||
generationState.beforeCompile()
|
||||
codegenFactory.generateModuleInFrontendIRMode(
|
||||
generationState, moduleFragment, symbolTable, sourceManager
|
||||
@@ -431,6 +435,7 @@ object KotlinToJVMBytecodeCompiler {
|
||||
generationState.extraJvmDiagnosticsTrace.bindingContext, environment.messageCollector
|
||||
)
|
||||
|
||||
performanceManager?.notifyIRGenerationFinished(ktFiles.size, codeLines, additionalDescription = debugTargetDescription)
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||
outputs[module] = generationState
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.psi.*
|
||||
|
||||
class MockExternalAnnotationsManager : ExternalAnnotationsManager() {
|
||||
override fun chooseAnnotationsPlace(element: PsiElement): AnnotationPlace = AnnotationPlace.NOWHERE
|
||||
override fun chooseAnnotationsPlaceNoUi(element: PsiElement): AnnotationPlace = AnnotationPlace.NOWHERE
|
||||
|
||||
override fun isExternalAnnotationWritable(listOwner: PsiModifierListOwner, annotationFQN: String): Boolean = false
|
||||
override fun isExternalAnnotation(annotation: PsiAnnotation): Boolean = false
|
||||
|
||||
@@ -22,7 +22,6 @@ import com.intellij.psi.*
|
||||
|
||||
class MockExternalAnnotationsManager : ExternalAnnotationsManager() {
|
||||
override fun chooseAnnotationsPlace(element: PsiElement): AnnotationPlace = AnnotationPlace.NOWHERE
|
||||
override fun chooseAnnotationsPlaceNoUi(element: PsiElement): AnnotationPlace = AnnotationPlace.NOWHERE
|
||||
|
||||
override fun isExternalAnnotationWritable(listOwner: PsiModifierListOwner, annotationFQN: String): Boolean = false
|
||||
override fun isExternalAnnotation(annotation: PsiAnnotation): Boolean = false
|
||||
@@ -6,4 +6,10 @@
|
||||
package org.jetbrains.kotlin.cli.jvm.compiler
|
||||
|
||||
fun setupIdeaStandaloneExecution() {
|
||||
System.getProperties().setProperty("idea.plugins.compatible.build", "201.6668.13")
|
||||
System.getProperties().setProperty("project.structure.add.tools.jar.to.new.jdk", "false")
|
||||
System.getProperties().setProperty("psi.track.invalidation", "true")
|
||||
System.getProperties().setProperty("psi.incremental.reparse.depth.limit", "1000")
|
||||
System.getProperties().setProperty("ide.hide.excluded.files", "false")
|
||||
System.getProperties().setProperty("ast.loading.filter", "false")
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm.compiler
|
||||
|
||||
fun setupIdeaStandaloneExecution() {
|
||||
}
|
||||
@@ -12,4 +12,6 @@ fun setupIdeaStandaloneExecution() {
|
||||
System.getProperties().setProperty("psi.incremental.reparse.depth.limit", "1000")
|
||||
System.getProperties().setProperty("ide.hide.excluded.files", "false")
|
||||
System.getProperties().setProperty("ast.loading.filter", "false")
|
||||
System.getProperties().setProperty("idea.ignore.disabled.plugins", "true")
|
||||
System.getProperties().setProperty("idea.home.path", System.getProperty("java.io.tmpdir"))
|
||||
}
|
||||
@@ -8,9 +8,11 @@ package org.jetbrains.kotlin.cli.jvm.compiler
|
||||
import com.intellij.core.CoreApplicationEnvironment
|
||||
import com.intellij.openapi.extensions.ExtensionsArea
|
||||
import java.io.File
|
||||
import java.nio.file.FileSystems
|
||||
|
||||
// FIX ME WHEN BUNCH 193 REMOVED
|
||||
fun registerExtensionPointAndExtensionsEx(pluginFile: File, fileName: String, area: ExtensionsArea) {
|
||||
val pluginRoot = FileSystems.getDefault().getPath(pluginFile.path)
|
||||
@Suppress("MissingRecentApi")
|
||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginFile, fileName, area)
|
||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, fileName, area)
|
||||
}
|
||||
@@ -8,11 +8,9 @@ package org.jetbrains.kotlin.cli.jvm.compiler
|
||||
import com.intellij.core.CoreApplicationEnvironment
|
||||
import com.intellij.openapi.extensions.ExtensionsArea
|
||||
import java.io.File
|
||||
import java.nio.file.FileSystems
|
||||
|
||||
// FIX ME WHEN BUNCH 193 REMOVED
|
||||
fun registerExtensionPointAndExtensionsEx(pluginFile: File, fileName: String, area: ExtensionsArea) {
|
||||
val pluginRoot = FileSystems.getDefault().getPath(pluginFile.path)
|
||||
@Suppress("MissingRecentApi")
|
||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginRoot, fileName, area)
|
||||
CoreApplicationEnvironment.registerExtensionPointAndExtensions(pluginFile, fileName, area)
|
||||
}
|
||||
@@ -38,6 +38,17 @@ fun CompilerConfiguration.setupJvmSpecificArguments(arguments: K2JVMCompilerArgu
|
||||
}
|
||||
}
|
||||
|
||||
val jvmTarget = get(JVMConfigurationKeys.JVM_TARGET) ?: JvmTarget.DEFAULT
|
||||
if (jvmTarget.bytecodeVersion < JvmTarget.JVM_1_8.bytecodeVersion) {
|
||||
val jvmDefaultMode = languageVersionSettings.getFlag(JvmAnalysisFlags.jvmDefaultMode)
|
||||
if (jvmDefaultMode.forAllMethodsWithBody) {
|
||||
messageCollector.report(
|
||||
ERROR,
|
||||
"'-Xjvm-default=${jvmDefaultMode.description}' is only supported since JVM target 1.8. Recompile with '-jvm-target 1.8'"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
addAll(JVMConfigurationKeys.ADDITIONAL_JAVA_MODULES, arguments.additionalJavaModules?.asList())
|
||||
}
|
||||
|
||||
@@ -198,6 +209,7 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
|
||||
|
||||
put(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE, arguments.allowKotlinPackage)
|
||||
put(JVMConfigurationKeys.USE_SINGLE_MODULE, arguments.singleModule)
|
||||
put(JVMConfigurationKeys.USE_OLD_SPILLED_VAR_TYPE_ANALYSIS, arguments.useOldSpilledVarTypeAnalysis)
|
||||
|
||||
arguments.declarationsOutputPath?.let { put(JVMConfigurationKeys.DECLARATIONS_JSON_PATH, it) }
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class KotlinCompilerVersion {
|
||||
// Binaries produced by this compiler with that language version (or any future language version) are going to be marked
|
||||
// as "pre-release" and will not be loaded by release versions of the compiler.
|
||||
// Change this value before and after every major release
|
||||
private static final boolean IS_PRE_RELEASE = true;
|
||||
private static final boolean IS_PRE_RELEASE = false;
|
||||
|
||||
public static final String TEST_IS_PRE_RELEASE_SYSTEM_PROPERTY = "kotlin.test.is.pre.release";
|
||||
|
||||
|
||||
@@ -122,4 +122,7 @@ public class JVMConfigurationKeys {
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> NO_KOTLIN_NOTHING_VALUE_EXCEPTION =
|
||||
CompilerConfigurationKey.create("Do not use KotlinNothingValueException available since 1.4");
|
||||
|
||||
public static final CompilerConfigurationKey<Boolean> USE_OLD_SPILLED_VAR_TYPE_ANALYSIS =
|
||||
CompilerConfigurationKey.create("Use old, SourceInterpreter-based analysis for fields, used for spilled variables in coroutines");
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ object CommonConfigurationKeys {
|
||||
|
||||
@JvmField
|
||||
val EXPECT_ACTUAL_LINKER = CompilerConfigurationKey.create<Boolean>("Experimental expext/actual linker")
|
||||
|
||||
@JvmField
|
||||
val DESERIALIZE_FAKE_OVERRIDES = CompilerConfigurationKey.create<Boolean>("Deserialize fake overrides")
|
||||
}
|
||||
|
||||
var CompilerConfiguration.languageVersionSettings: LanguageVersionSettings
|
||||
|
||||
@@ -4,8 +4,6 @@ plugins {
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
jvmTarget = "1.6"
|
||||
|
||||
val ktorExcludesForDaemon: List<Pair<String, String>> by rootProject.extra
|
||||
|
||||
dependencies {
|
||||
|
||||
@@ -36,6 +36,7 @@ sourceSets {
|
||||
}
|
||||
|
||||
projectTest(parallel = true) {
|
||||
dependsOn(":dist")
|
||||
workingDir = rootDir
|
||||
jvmArgs!!.removeIf { it.contains("-Xmx") }
|
||||
maxHeapSize = "3g"
|
||||
|
||||
@@ -208,10 +208,10 @@ public final class Byte : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Byte>|, R
|
||||
public final const val MIN_VALUE: R|kotlin/Byte| = Byte(-128)
|
||||
public get(): R|kotlin/Byte|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(8)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(8)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(1)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(1)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Byte.Companion|
|
||||
@@ -279,7 +279,7 @@ public final class Char : R|kotlin/Comparable<kotlin/Char>|, R|java/io/Serializa
|
||||
public final const val MAX_SURROGATE: R|kotlin/Char| = Char(57343)
|
||||
public get(): R|kotlin/Char|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val MAX_VALUE: R|kotlin/Char| = Char(65535)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val MAX_VALUE: R|kotlin/Char| = Char(65535)
|
||||
public get(): R|kotlin/Char|
|
||||
|
||||
public final const val MIN_HIGH_SURROGATE: R|kotlin/Char| = Char(55296)
|
||||
@@ -291,13 +291,13 @@ public final class Char : R|kotlin/Comparable<kotlin/Char>|, R|java/io/Serializa
|
||||
public final const val MIN_SURROGATE: R|kotlin/Char| = Char(55296)
|
||||
public get(): R|kotlin/Char|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val MIN_VALUE: R|kotlin/Char| = Char(0)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val MIN_VALUE: R|kotlin/Char| = Char(0)
|
||||
public get(): R|kotlin/Char|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(16)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(16)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(2)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(2)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Char.Companion|
|
||||
@@ -358,6 +358,20 @@ public abstract interface Comparable<in T> : R|kotlin/Any| {
|
||||
|
||||
}
|
||||
|
||||
@R|kotlin/annotation/Target|() @R|kotlin/annotation/MustBeDocumented|() @R|kotlin/SinceKotlin|(version = String(1.4)) public final annotation class DeprecatedSinceKotlin : R|kotlin/Annotation| {
|
||||
public final val errorSince: R|kotlin/String|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final val hiddenSince: R|kotlin/String|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public final val warningSince: R|kotlin/String|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public constructor(warningSince: R|kotlin/String| = STUB, errorSince: R|kotlin/String| = STUB, hiddenSince: R|kotlin/String| = STUB): R|kotlin/DeprecatedSinceKotlin|
|
||||
|
||||
}
|
||||
|
||||
public final enum class DeprecationLevel : R|kotlin/Enum<kotlin/DeprecationLevel>| {
|
||||
private constructor(): R|kotlin/DeprecationLevel|
|
||||
|
||||
@@ -485,10 +499,10 @@ public final class Double : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Double>
|
||||
public final const val POSITIVE_INFINITY: R|kotlin/Double| = Double(Infinity)
|
||||
public get(): R|kotlin/Double|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BITS: R|kotlin/Int| = Int(64)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BITS: R|kotlin/Int| = Int(64)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(8)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(8)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Double.Companion|
|
||||
@@ -664,10 +678,10 @@ public final class Float : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Float>|,
|
||||
public final const val POSITIVE_INFINITY: R|kotlin/Float| = Float(Infinity)
|
||||
public get(): R|kotlin/Float|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BITS: R|kotlin/Int| = Int(32)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BITS: R|kotlin/Int| = Int(32)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(4)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.4)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(4)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Float.Companion|
|
||||
@@ -823,10 +837,10 @@ public final class Int : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Int>|, R|j
|
||||
public final const val MIN_VALUE: R|kotlin/Int| = Int(-2147483648)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(32)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(32)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(4)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(4)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Int.Companion|
|
||||
@@ -979,10 +993,10 @@ public final class Long : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Long>|, R
|
||||
public final const val MIN_VALUE: R|kotlin/Long| = Long(-9223372036854775808)
|
||||
public get(): R|kotlin/Long|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(64)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(64)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(8)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(8)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Long.Companion|
|
||||
@@ -1169,10 +1183,10 @@ public final class Short : R|kotlin/Number|, R|kotlin/Comparable<kotlin/Short>|,
|
||||
public final const val MIN_VALUE: R|kotlin/Short| = Short(-32768)
|
||||
public get(): R|kotlin/Short|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(16)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BITS: R|kotlin/Int| = Int(16)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
@R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(2)
|
||||
@PROPERTY:R|kotlin/SinceKotlin|(version = String(1.3)) public final const val SIZE_BYTES: R|kotlin/Int| = Int(2)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|kotlin/Short.Companion|
|
||||
|
||||
@@ -11,8 +11,7 @@ public/*package*/ open class A : R|kotlin/Any| {
|
||||
|
||||
}
|
||||
public final enum class Mixed : R|kotlin/Enum<ft<Mixed, Mixed?>!>| {
|
||||
public final static field NOT_ENTRY_EITHER: R|Mixed|
|
||||
|
||||
public final static enum entry NOT_ENTRY_EITHER: R|Mixed|
|
||||
public final static fun values(): R|kotlin/Array<Mixed>| {
|
||||
}
|
||||
|
||||
@@ -21,10 +20,8 @@ public final enum class Mixed : R|kotlin/Enum<ft<Mixed, Mixed?>!>| {
|
||||
|
||||
}
|
||||
public final enum class Signs : R|kotlin/Enum<ft<Signs, Signs?>!>| {
|
||||
public final static field HELLO: R|Signs|
|
||||
|
||||
public final static field WORLD: R|Signs|
|
||||
|
||||
public final static enum entry HELLO: R|Signs|
|
||||
public final static enum entry WORLD: R|Signs|
|
||||
public final static field X: R|ft<Signs, Signs?>!|
|
||||
|
||||
public final static fun values(): R|kotlin/Array<Signs>| {
|
||||
|
||||
76
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantExplicitTypeChecker.kt
vendored
Normal file
76
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantExplicitTypeChecker.kt
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@Target(AnnotationTarget.TYPE)
|
||||
annotation class A
|
||||
|
||||
fun annotated() {
|
||||
val x: @A Int /* NOT redundant */ = 1
|
||||
}
|
||||
|
||||
object SomeObj
|
||||
fun fer() {
|
||||
val x: Any /* NOT redundant */ = SomeObj
|
||||
}
|
||||
|
||||
fun f2(y: String?): String {
|
||||
val f: KClass<*> = (y ?: return "")::class
|
||||
return ""
|
||||
}
|
||||
|
||||
object Obj {}
|
||||
|
||||
interface IA
|
||||
interface IB : IA
|
||||
|
||||
fun IA.extFun(x: IB) {}
|
||||
|
||||
fun testWithExpectedType() {
|
||||
val extFun_AB_A: IA.(IB) -> Unit = IA::extFun
|
||||
}
|
||||
|
||||
interface Point {
|
||||
val x: Int
|
||||
val y: Int
|
||||
}
|
||||
|
||||
class PointImpl(override val x: Int, override val y: Int) : Point
|
||||
|
||||
fun foo() {
|
||||
val s: <!REDUNDANT_EXPLICIT_TYPE!>String<!> = "Hello ${10+1}"
|
||||
val str: String? = ""
|
||||
|
||||
val o: <!REDUNDANT_EXPLICIT_TYPE!>Obj<!> = Obj
|
||||
|
||||
val p: Point = PointImpl(1, 2)
|
||||
val a: <!REDUNDANT_EXPLICIT_TYPE!>Boolean<!> = true
|
||||
val i: Int = 2 * 2
|
||||
val l: <!REDUNDANT_EXPLICIT_TYPE!>Long<!> = 1234567890123L
|
||||
val s: String? = null
|
||||
val sh: Short = 42
|
||||
|
||||
val integer: <!REDUNDANT_EXPLICIT_TYPE!>Int<!> = 42
|
||||
val piFloat: <!REDUNDANT_EXPLICIT_TYPE!>Float<!> = 3.14f
|
||||
val piDouble: <!REDUNDANT_EXPLICIT_TYPE!>Double<!> = 3.14
|
||||
val charZ: <!REDUNDANT_EXPLICIT_TYPE!>Char<!> = 'z'
|
||||
var alpha: <!REDUNDANT_EXPLICIT_TYPE!>Int<!> = 0
|
||||
}
|
||||
|
||||
fun test(boolean: Boolean) {
|
||||
val expectedLong: Long = if (boolean) {
|
||||
42
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
class My {
|
||||
val x: Int = 1
|
||||
}
|
||||
|
||||
val ZERO: Int = 0
|
||||
|
||||
fun main() {
|
||||
val id: Id = 11
|
||||
}
|
||||
|
||||
typealias Id = Int
|
||||
100
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantExplicitTypeChecker.txt
vendored
Normal file
100
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantExplicitTypeChecker.txt
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
FILE: RedundantExplicitTypeChecker.kt
|
||||
@R|kotlin/annotation/Target|(vararg(Q|kotlin/annotation/AnnotationTarget|.R|kotlin/annotation/AnnotationTarget.TYPE|)) public final annotation class A : R|kotlin/Annotation| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final fun annotated(): R|kotlin/Unit| {
|
||||
lval x: @R|A|() R|kotlin/Int| = Int(1)
|
||||
}
|
||||
public final object SomeObj : R|kotlin/Any| {
|
||||
private constructor(): R|SomeObj| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final fun fer(): R|kotlin/Unit| {
|
||||
lval x: R|kotlin/Any| = Q|SomeObj|
|
||||
}
|
||||
public final fun f2(y: R|kotlin/String?|): R|kotlin/String| {
|
||||
lval f: R|kotlin/reflect/KClass<*>| = <getClass>(R|<local>/y| ?: ^f2 String())
|
||||
^f2 String()
|
||||
}
|
||||
public final object Obj : R|kotlin/Any| {
|
||||
private constructor(): R|Obj| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface IA : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface IB : R|IA| {
|
||||
}
|
||||
public final fun R|IA|.extFun(x: R|IB|): R|kotlin/Unit| {
|
||||
}
|
||||
public final fun testWithExpectedType(): R|kotlin/Unit| {
|
||||
lval extFun_AB_A: R|IA.(IB) -> kotlin/Unit| = Q|IA|::R|/extFun|
|
||||
}
|
||||
public abstract interface Point : R|kotlin/Any| {
|
||||
public abstract val x: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public abstract val y: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final class PointImpl : R|Point| {
|
||||
public constructor(x: R|kotlin/Int|, y: R|kotlin/Int|): R|PointImpl| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final override val x: R|kotlin/Int| = R|<local>/x|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public final override val y: R|kotlin/Int| = R|<local>/y|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval s: R|kotlin/String| = <strcat>(String(Hello ), Int(10).R|kotlin/Int.plus|(Int(1)).R|kotlin/Any.toString|())
|
||||
lval str: R|kotlin/String?| = String()
|
||||
lval o: R|Obj| = Q|Obj|
|
||||
lval p: R|Point| = R|/PointImpl.PointImpl|(Int(1), Int(2))
|
||||
lval a: R|kotlin/Boolean| = Boolean(true)
|
||||
lval i: R|kotlin/Int| = Int(2).R|kotlin/Int.times|(Int(2))
|
||||
lval l: R|kotlin/Long| = Long(1234567890123)
|
||||
lval s: R|kotlin/String?| = Null(null)
|
||||
lval sh: R|kotlin/Short| = Short(42)
|
||||
lval integer: R|kotlin/Int| = Int(42)
|
||||
lval piFloat: R|kotlin/Float| = Float(3.14)
|
||||
lval piDouble: R|kotlin/Double| = Double(3.14)
|
||||
lval charZ: R|kotlin/Char| = Char(z)
|
||||
lvar alpha: R|kotlin/Int| = Int(0)
|
||||
}
|
||||
public final fun test(boolean: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
lval expectedLong: R|kotlin/Long| = when () {
|
||||
R|<local>/boolean| -> {
|
||||
Int(42)
|
||||
}
|
||||
else -> {
|
||||
^test Unit
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public final class My : R|kotlin/Any| {
|
||||
public constructor(): R|My| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val x: R|kotlin/Int| = Int(1)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final val ZERO: R|kotlin/Int| = Int(0)
|
||||
public get(): R|kotlin/Int|
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
lval id: R|Id| = Int(11)
|
||||
}
|
||||
public final typealias Id = R|kotlin/Int|
|
||||
84
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantModalityModifierChecker.kt
vendored
Normal file
84
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantModalityModifierChecker.kt
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
object O {
|
||||
fun foo() {}
|
||||
}
|
||||
|
||||
// Interface
|
||||
interface Interface {
|
||||
// Questionable cuz compiler reports warning here in FE 1.0
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>open<!> val gav: Int
|
||||
get() = 42
|
||||
// Redundant
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> fun foo()
|
||||
// error
|
||||
private final fun bar() {}
|
||||
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>open<!> fun goo() {}
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> fun tar()
|
||||
|
||||
// error
|
||||
abstract fun too() {}
|
||||
}
|
||||
interface B {
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> var bar: Unit
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> fun foo()
|
||||
}
|
||||
|
||||
expect abstract class AbstractClass : Foo {
|
||||
abstract override fun foo()
|
||||
|
||||
abstract fun bar()
|
||||
|
||||
abstract val baz: Int
|
||||
}
|
||||
|
||||
|
||||
// Abstract
|
||||
abstract class Base {
|
||||
// Redundant final
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>final<!> fun foo() {}
|
||||
// Abstract
|
||||
abstract fun bar()
|
||||
// Open
|
||||
open val gav = 42
|
||||
}
|
||||
|
||||
class FinalDerived : Base() {
|
||||
// Redundant final
|
||||
override <!REDUNDANT_MODALITY_MODIFIER!>final<!> fun bar() {}
|
||||
// Non-final member in final class
|
||||
override open val gav = 13
|
||||
}
|
||||
// Open
|
||||
open class OpenDerived : Base() {
|
||||
// Final
|
||||
override final fun bar() {}
|
||||
// Redundant open
|
||||
override <!REDUNDANT_MODALITY_MODIFIER!>open<!> val gav = 13
|
||||
}
|
||||
// Redundant final
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>final<!> class Final
|
||||
// Derived interface
|
||||
interface Derived : Interface {
|
||||
// Redundant
|
||||
override <!REDUNDANT_MODALITY_MODIFIER!>open<!> fun foo() {}
|
||||
// error
|
||||
final class Nested
|
||||
}
|
||||
// Derived abstract class
|
||||
abstract class AbstractDerived1(override final val gav: Int) : Interface {
|
||||
// Redundant
|
||||
override <!REDUNDANT_MODALITY_MODIFIER!>open<!> fun foo() {}
|
||||
}
|
||||
// Derived abstract class
|
||||
abstract class AbstractDerived2 : Interface {
|
||||
// Final
|
||||
override final fun foo() {}
|
||||
// Redundant
|
||||
override <!REDUNDANT_MODALITY_MODIFIER!>open<!> val gav = 13
|
||||
}
|
||||
// Redundant abstract interface
|
||||
abstract interface AbstractInterface
|
||||
// Redundant final object
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>final<!> object FinalObject
|
||||
// Open interface
|
||||
open interface OpenInterface
|
||||
141
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantModalityModifierChecker.txt
vendored
Normal file
141
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantModalityModifierChecker.txt
vendored
Normal file
@@ -0,0 +1,141 @@
|
||||
FILE: RedundantModalityModifierChecker.kt
|
||||
public final object O : R|kotlin/Any| {
|
||||
private constructor(): R|O| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface Interface : R|kotlin/Any| {
|
||||
public open val gav: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(42)
|
||||
}
|
||||
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
private final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public open fun goo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public abstract fun tar(): R|kotlin/Unit|
|
||||
|
||||
public abstract fun too(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface B : R|kotlin/Any| {
|
||||
public abstract var bar: R|kotlin/Unit|
|
||||
public get(): R|kotlin/Unit|
|
||||
public set(value: R|kotlin/Unit|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract expect class AbstractClass : R|ERROR CLASS: Symbol not found, for `Foo`| {
|
||||
public expect constructor(): R|AbstractClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public abstract expect override fun foo(): R|kotlin/Unit|
|
||||
|
||||
public abstract expect fun bar(): R|kotlin/Unit|
|
||||
|
||||
public abstract expect val baz: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public abstract class Base : R|kotlin/Any| {
|
||||
public constructor(): R|Base| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public abstract fun bar(): R|kotlin/Unit|
|
||||
|
||||
public open val gav: R|kotlin/Int| = Int(42)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final class FinalDerived : R|Base| {
|
||||
public constructor(): R|FinalDerived| {
|
||||
super<R|Base|>()
|
||||
}
|
||||
|
||||
public final override fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public open override val gav: R|kotlin/Int| = Int(13)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public open class OpenDerived : R|Base| {
|
||||
public constructor(): R|OpenDerived| {
|
||||
super<R|Base|>()
|
||||
}
|
||||
|
||||
public final override fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public open override val gav: R|kotlin/Int| = Int(13)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public final class Final : R|kotlin/Any| {
|
||||
public constructor(): R|Final| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface Derived : R|Interface| {
|
||||
public open override fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final class Nested : R|kotlin/Any| {
|
||||
public constructor(): R|Derived.Nested| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public abstract class AbstractDerived1 : R|Interface| {
|
||||
public constructor(gav: R|kotlin/Int|): R|AbstractDerived1| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final override val gav: R|kotlin/Int| = R|<local>/gav|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public open override fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public abstract class AbstractDerived2 : R|Interface| {
|
||||
public constructor(): R|AbstractDerived2| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final override fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public open override val gav: R|kotlin/Int| = Int(13)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public abstract interface AbstractInterface : R|kotlin/Any| {
|
||||
}
|
||||
public final object FinalObject : R|kotlin/Any| {
|
||||
private constructor(): R|FinalObject| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public open interface OpenInterface : R|kotlin/Any| {
|
||||
}
|
||||
46
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantReturnUnitTypeChecker.kt
vendored
Normal file
46
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantReturnUnitTypeChecker.kt
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
class A {
|
||||
fun foo(): <!REDUNDANT_RETURN_UNIT_TYPE!>Unit<!>
|
||||
{
|
||||
}
|
||||
|
||||
fun bar(): <!REDUNDANT_RETURN_UNIT_TYPE!>Unit<!>
|
||||
{
|
||||
return Unit
|
||||
}
|
||||
|
||||
fun baz(): Unit = bar()
|
||||
|
||||
fun f1(): Int = 1
|
||||
|
||||
fun f2(): <!REDUNDANT_RETURN_UNIT_TYPE!>Unit<!>
|
||||
{
|
||||
throw UnsupportedOperationException("")
|
||||
}
|
||||
|
||||
fun f3(): Unit = throw UnsupportedOperationException("")
|
||||
}
|
||||
|
||||
class B {
|
||||
fun <T> run(f: () -> T) = f()
|
||||
|
||||
fun foo(): Unit = run {
|
||||
bar()
|
||||
}
|
||||
|
||||
fun bar() = 1
|
||||
|
||||
fun call(f: () -> Unit) = f()
|
||||
|
||||
fun boo(): Unit = call {
|
||||
baz()
|
||||
}
|
||||
|
||||
fun baz() {}
|
||||
|
||||
fun <T, R> T.let(f: (T) -> R) = f(this)
|
||||
|
||||
fun goo(): Unit = 1.let {
|
||||
bar()
|
||||
}
|
||||
}
|
||||
|
||||
76
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantReturnUnitTypeChecker.txt
vendored
Normal file
76
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantReturnUnitTypeChecker.txt
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
FILE: RedundantReturnUnitTypeChecker.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public constructor(): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
^bar Q|kotlin/Unit|
|
||||
}
|
||||
|
||||
public final fun baz(): R|kotlin/Unit| {
|
||||
^baz this@R|/A|.R|/A.bar|()
|
||||
}
|
||||
|
||||
public final fun f1(): R|kotlin/Int| {
|
||||
^f1 Int(1)
|
||||
}
|
||||
|
||||
public final fun f2(): R|kotlin/Unit| {
|
||||
throw R|java/lang/UnsupportedOperationException.UnsupportedOperationException|(String())
|
||||
}
|
||||
|
||||
public final fun f3(): R|kotlin/Unit| {
|
||||
^f3 throw R|java/lang/UnsupportedOperationException.UnsupportedOperationException|(String())
|
||||
}
|
||||
|
||||
}
|
||||
public final class B : R|kotlin/Any| {
|
||||
public constructor(): R|B| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun <T> run(f: R|() -> T|): R|T| {
|
||||
^run R|<local>/f|.R|FakeOverride<kotlin/Function0.invoke: R|T|>|()
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
^foo this@R|/B|.R|/B.run|<R|kotlin/Int|>(<L> = run@fun <anonymous>(): R|kotlin/Int| {
|
||||
^ this@R|/B|.R|/B.bar|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public final fun bar(): R|kotlin/Int| {
|
||||
^bar Int(1)
|
||||
}
|
||||
|
||||
public final fun call(f: R|() -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
^call R|<local>/f|.R|FakeOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
|
||||
}
|
||||
|
||||
public final fun boo(): R|kotlin/Unit| {
|
||||
^boo this@R|/B|.R|/B.call|(<L> = call@fun <anonymous>(): R|kotlin/Unit| {
|
||||
this@R|/B|.R|/B.baz|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
public final fun baz(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final fun <T, R> R|T|.let(f: R|(T) -> R|): R|R| {
|
||||
^let R|<local>/f|.R|FakeOverride<kotlin/Function1.invoke: R|R|>|(this@R|/B.let|)
|
||||
}
|
||||
|
||||
public final fun goo(): R|kotlin/Unit| {
|
||||
^goo (this@R|/B|, Int(1)).R|/B.let|<R|kotlin/Int|, R|kotlin/Int|>(<L> = let@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Int| {
|
||||
^ this@R|/B|.R|/B.bar|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
87
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantVisibilityModifierChecker.kt
vendored
Normal file
87
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantVisibilityModifierChecker.kt
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
fun f() {
|
||||
|
||||
class LocalClass {
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>internal<!> var foo = 0
|
||||
}
|
||||
LocalClass().foo = 1
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> var baz = 0
|
||||
}
|
||||
|
||||
internal inline fun internal() {
|
||||
f()
|
||||
}
|
||||
|
||||
class C {
|
||||
internal val z = object {
|
||||
fun foo() = 13
|
||||
}
|
||||
}
|
||||
|
||||
class Foo2<
|
||||
T1,
|
||||
T2: T1,
|
||||
> {
|
||||
fun <T1,
|
||||
T2, > foo2() {}
|
||||
|
||||
internal inner class B<T,T2,>
|
||||
}
|
||||
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> class C {
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> val foo: Int = 0
|
||||
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> fun bar() {}
|
||||
|
||||
}
|
||||
|
||||
open class D {
|
||||
protected open fun willRemainProtected() {
|
||||
}
|
||||
|
||||
protected open fun willBecomePublic() {
|
||||
}
|
||||
}
|
||||
|
||||
class E : D() {
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>protected<!> override fun willRemainProtected() {
|
||||
}
|
||||
|
||||
public override fun willBecomePublic() {
|
||||
}
|
||||
}
|
||||
|
||||
enum class F <!REDUNDANT_VISIBILITY_MODIFIER!>private<!> constructor(val x: Int) {
|
||||
FIRST(42)
|
||||
}
|
||||
|
||||
sealed class G constructor(val y: Int) {
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>private<!> constructor(): this(42)
|
||||
|
||||
object H : G()
|
||||
}
|
||||
|
||||
interface I {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> var baz = 0
|
||||
|
||||
open class J {
|
||||
protected val baz = 0
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>protected<!> get() = field * 2
|
||||
var baf = 0
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> get() = 1
|
||||
<!REDUNDANT_VISIBILITY_MODIFIER!>public<!> set(value) {
|
||||
field = value
|
||||
}
|
||||
|
||||
var buf = 0
|
||||
private get() = 42
|
||||
protected set(value) {
|
||||
field = value
|
||||
}
|
||||
|
||||
var bar = 0
|
||||
get() = 3.1415926535
|
||||
set(value) {}
|
||||
}
|
||||
173
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantVisibilityModifierChecker.txt
vendored
Normal file
173
compiler/fir/analysis-tests/testData/extendedCheckers/RedundantVisibilityModifierChecker.txt
vendored
Normal file
@@ -0,0 +1,173 @@
|
||||
FILE: RedundantVisibilityModifierChecker.kt
|
||||
public final fun f(): R|kotlin/Unit| {
|
||||
local final class LocalClass : R|kotlin/Any| {
|
||||
public[local] constructor(): R|LocalClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
internal[local] final var foo: R|kotlin/Int| = Int(0)
|
||||
internal get(): R|kotlin/Int|
|
||||
internal set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
R|/LocalClass.LocalClass|().R|/LocalClass.foo| = Int(1)
|
||||
lvar baz: R|kotlin/Int| = Int(0)
|
||||
}
|
||||
internal final inline fun internal(): R|kotlin/Unit| {
|
||||
R|/f|()
|
||||
}
|
||||
public final class C : R|kotlin/Any| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
internal final val z: R|<anonymous>| = object : R|kotlin/Any| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public[local] final fun foo(): R|kotlin/Int| {
|
||||
^foo Int(13)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal get(): R|<anonymous>|
|
||||
|
||||
}
|
||||
public final class Foo2<T1, T2 : R|T1|> : R|kotlin/Any| {
|
||||
public constructor<T1, T2 : R|T1|>(): R|Foo2<T1, T2>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun <T1, T2> foo2(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
internal final inner class B<T, T2, T1, T2 : R|T1|> : R|kotlin/Any| {
|
||||
public[internal] constructor<T, T2>(): R|Foo2.B<T, T2, T1, T2>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final class C : R|kotlin/Any| {
|
||||
public constructor(): R|C| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val foo: R|kotlin/Int| = Int(0)
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public open class D : R|kotlin/Any| {
|
||||
public constructor(): R|D| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
protected open fun willRemainProtected(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
protected open fun willBecomePublic(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final class E : R|D| {
|
||||
public constructor(): R|E| {
|
||||
super<R|D|>()
|
||||
}
|
||||
|
||||
protected final override fun willRemainProtected(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final override fun willBecomePublic(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public final enum class F : R|kotlin/Enum<F>| {
|
||||
private constructor(x: R|kotlin/Int|): R|F| {
|
||||
super<R|kotlin/Enum<F>|>()
|
||||
}
|
||||
|
||||
public final val x: R|kotlin/Int| = R|<local>/x|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public final static enum entry FIRST: R|F| = object : R|F| {
|
||||
private[local] constructor(): R|<anonymous>| {
|
||||
super<R|F|>(Int(42))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static fun values(): R|kotlin/Array<F>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|F| {
|
||||
}
|
||||
|
||||
}
|
||||
public sealed class G : R|kotlin/Any| {
|
||||
private constructor(y: R|kotlin/Int|): R|G| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val y: R|kotlin/Int| = R|<local>/y|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|G| {
|
||||
this<R|G|>(Int(42))
|
||||
}
|
||||
|
||||
public final object H : R|G| {
|
||||
private constructor(): R|G.H| {
|
||||
super<R|G|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface I : R|kotlin/Any| {
|
||||
public abstract fun bar(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final var baz: R|kotlin/Int| = Int(0)
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
public open class J : R|kotlin/Any| {
|
||||
public constructor(): R|J| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
protected final val baz: R|kotlin/Int| = Int(0)
|
||||
protected get(): R|kotlin/Int| {
|
||||
^ this@R|/J|.F|/J.baz|.R|kotlin/Int.times|(Int(2))
|
||||
}
|
||||
|
||||
public final var baf: R|kotlin/Int| = Int(0)
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(1)
|
||||
}
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
this@R|/J|.F|/J.baf| = R|<local>/value|
|
||||
}
|
||||
|
||||
public final var buf: R|kotlin/Int| = Int(0)
|
||||
private get(): R|kotlin/Int| {
|
||||
^ Int(42)
|
||||
}
|
||||
protected set(value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
this@R|/J|.F|/J.buf| = R|<local>/value|
|
||||
}
|
||||
|
||||
public final var bar: R|kotlin/Int| = Int(0)
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Double(3.1415926535)
|
||||
}
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,7 +7,7 @@ public final class Class : R|kotlin/Any| {
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
public final var property: R|kotlin/Int|
|
||||
@FIELD:R|test/Anno|() public final var property: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final val x: R|kotlin/Int|
|
||||
@PROPERTY:R|test/Anno|() public final val x: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
@@ -9,7 +9,7 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
public final class Class : R|kotlin/Any| {
|
||||
@R|test/Anno|(t = R|java/lang/annotation/ElementType.METHOD|()) public final fun foo(): R|kotlin/Unit|
|
||||
|
||||
public final var bar: R|kotlin/Int|
|
||||
@FIELD:R|test/Anno|(t = R|java/lang/annotation/ElementType.FIELD|()) public final var bar: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ public sealed class Sealed : R|kotlin/Any| {
|
||||
public final val z: R|test/Z|
|
||||
public get(): R|test/Z|
|
||||
|
||||
@R|test/Ann|() private constructor(z: R|test/Z|): R|test/Sealed|
|
||||
@R|test/Ann|() private constructor(@R|test/Ann|() z: R|test/Z|): R|test/Sealed|
|
||||
|
||||
public final class Derived : R|test/Sealed| {
|
||||
public constructor(z: R|test/Z|): R|test/Sealed.Derived|
|
||||
@R|test/Ann|() public constructor(z: R|test/Z|): R|test/Sealed.Derived|
|
||||
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ public final class Test : R|kotlin/Any| {
|
||||
public final val z: R|test/Z|
|
||||
public get(): R|test/Z|
|
||||
|
||||
@R|test/Ann|() public constructor(z: R|test/Z|, a: R|kotlin/Int|): R|test/Test|
|
||||
@R|test/Ann|() public constructor(z: R|test/Z|, @R|test/Ann|() a: R|kotlin/Int|): R|test/Test|
|
||||
|
||||
@R|test/Ann|() private constructor(z: R|test/Z|, s: R|kotlin/String|): R|test/Test|
|
||||
@R|test/Ann|() private constructor(z: R|test/Z|, @R|test/Ann|() s: R|kotlin/String|): R|test/Test|
|
||||
|
||||
@R|test/Ann|() public constructor(z: R|test/Z|): R|test/Test|
|
||||
@R|test/Ann|() public constructor(@R|test/Ann|() z: R|test/Z|): R|test/Test|
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final var property: R|kotlin/Int|
|
||||
@FIELD:R|test/Anno|() public final var property: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ public final class Class : R|kotlin/Any| {
|
||||
public final val x: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public constructor(x: R|kotlin/Int|, y: R|kotlin/String|): R|test/Class|
|
||||
public constructor(@R|test/A|() x: R|kotlin/Int|, @R|test/B|() y: R|kotlin/String|): R|test/Class|
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public final enum class E : R|kotlin/Enum<test/E>| {
|
||||
public final val y: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(x: R|kotlin/String|, y: R|kotlin/Int|): R|test/E|
|
||||
private constructor(@R|test/A|() x: R|kotlin/String|, @R|test/B|() y: R|kotlin/Int|): R|test/E|
|
||||
|
||||
public final static fun values(): R|kotlin/Array<test/E>| {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final fun R|kotlin/Int|.foo(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
public final fun R|kotlin/Int|.foo(@R|test/A|() x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
public constructor(): R|test/A|
|
||||
|
||||
@@ -4,7 +4,7 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final fun R|kotlin/String|.foo(x: R|kotlin/Int|): R|kotlin/Int|
|
||||
public final fun R|kotlin/String|.foo(@R|test/Anno|() x: R|kotlin/Int|): R|kotlin/Int|
|
||||
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ public final annotation class A : R|kotlin/Annotation| {
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final var R|kotlin/Int|.foo: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
public set(@R|test/A|() value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final fun foo(x: R|kotlin/String|): R|kotlin/Unit|
|
||||
public final fun foo(@R|test/Anno|() x: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public abstract interface Trait : R|kotlin/Any| {
|
||||
public open fun foo(x: R|kotlin/String|): R|kotlin/Int|
|
||||
public open fun foo(@R|test/Anno|() x: R|kotlin/String|): R|kotlin/Int|
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public final class Outer : R|kotlin/Any| {
|
||||
public final val y: R|kotlin/String|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public constructor(y: R|kotlin/String|): R|test/Outer.Inner|
|
||||
public constructor(@R|test/A|(s = String(inner)) y: R|kotlin/String|): R|test/Outer.Inner|
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public final class Outer : R|kotlin/Any| {
|
||||
public final val x: R|kotlin/String|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
public constructor(x: R|kotlin/String|): R|test/Outer.Nested|
|
||||
public constructor(@R|test/A|(s = String(nested)) x: R|kotlin/String|): R|test/Outer.Nested|
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
public final fun bar(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
public final fun bar(@R|test/A|() @R|test/B|() @R|test/C|() @R|test/D|() x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public final fun foo(x: R|kotlin/Int|, y: R|kotlin/Double|, z: R|kotlin/String|): R|kotlin/Unit|
|
||||
public final fun foo(@R|test/A|() @R|test/B|() x: R|kotlin/Int|, @R|test/A|() @R|test/C|() y: R|kotlin/Double|, @R|test/B|() @R|test/C|() @R|test/D|() z: R|kotlin/String|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class A : R|kotlin/Annotation| {
|
||||
public constructor(): R|test/A|
|
||||
|
||||
@@ -6,7 +6,7 @@ public final annotation class A : R|kotlin/Annotation| {
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final var foo: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
public set(@R|test/A|() value: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
public final fun foo(x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
public final fun foo(@R|test/Anno|() x: R|kotlin/Int|): R|kotlin/Unit|
|
||||
|
||||
public final annotation class Anno : R|kotlin/Annotation| {
|
||||
public constructor(): R|test/Anno|
|
||||
|
||||
@@ -4,7 +4,7 @@ public final annotation class Anno : R|kotlin/Annotation| {
|
||||
}
|
||||
|
||||
public final class Class : R|kotlin/Any| {
|
||||
public final val property: R|kotlin/Int|
|
||||
@PROPERTY:R|test/Anno|() public final val property: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
@@ -7,7 +7,7 @@ public final class Class : R|kotlin/Any| {
|
||||
public constructor(): R|test/Class|
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
public final val property: R|kotlin/Int|
|
||||
@PROPERTY:R|test/Anno|() public final val property: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
private constructor(): R|test/Class.Companion|
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user