From 008e5f0b130383794674dc4521ec7972a43101bc Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 1 Nov 2013 17:12:33 +0400 Subject: [PATCH] Don't serialize default primary constructors Drop "Callable primary_constructor" field, because it requires serializer to serialize the fact that a class has a primary constructor. Default primary constructors for objects etc. may not be serialized, because they can be re-created trivially when they're loaded. There are three options: a class doesn't have a primary constructor, a class has a default primary constructor, a class has a custom primary constructor. This explains the change in descriptors.proto --- .../frontend/builtins/jet/Any.kotlin_class | 3 +- .../frontend/builtins/jet/Array.kotlin_class | Bin 219 -> 221 bytes .../builtins/jet/Boolean.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/BooleanArray.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/BooleanIterator.kotlin_class | 7 +- .../frontend/builtins/jet/Byte.kotlin_class | Bin 1383 -> 1385 bytes .../builtins/jet/ByteArray.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/ByteIterator.kotlin_class | 7 +- .../builtins/jet/ByteProgression.kotlin_class | Bin 118 -> 120 bytes .../builtins/jet/ByteRange.kotlin_class | Bin 146 -> 148 bytes .../jet/ByteRange.object.kotlin_class | Bin 37 -> 26 bytes .../frontend/builtins/jet/Char.kotlin_class | Bin 1143 -> 1145 bytes .../builtins/jet/CharArray.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/CharIterator.kotlin_class | 7 +- .../builtins/jet/CharProgression.kotlin_class | Bin 118 -> 120 bytes .../builtins/jet/CharRange.kotlin_class | Bin 146 -> 148 bytes .../jet/CharRange.object.kotlin_class | Bin 37 -> 26 bytes .../frontend/builtins/jet/Double.kotlin_class | Bin 1359 -> 1361 bytes .../builtins/jet/DoubleArray.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/DoubleIterator.kotlin_class | 7 +- .../jet/DoubleProgression.kotlin_class | Bin 118 -> 120 bytes .../builtins/jet/DoubleRange.kotlin_class | Bin 146 -> 148 bytes .../jet/DoubleRange.object.kotlin_class | Bin 37 -> 26 bytes .../frontend/builtins/jet/Enum.kotlin_class | Bin 125 -> 127 bytes .../frontend/builtins/jet/Float.kotlin_class | Bin 1383 -> 1385 bytes .../builtins/jet/FloatArray.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/FloatIterator.kotlin_class | 7 +- .../jet/FloatProgression.kotlin_class | Bin 118 -> 120 bytes .../builtins/jet/FloatRange.kotlin_class | Bin 146 -> 148 bytes .../jet/FloatRange.object.kotlin_class | Bin 37 -> 26 bytes .../builtins/jet/InlineStrategy.kotlin_class | 5 +- ...neStrategy.object.AS_FUNCTION.kotlin_class | Bin 24 -> 13 bytes ...nlineStrategy.object.IN_PLACE.kotlin_class | Bin 24 -> 13 bytes .../jet/InlineStrategy.object.kotlin_class | Bin 100 -> 89 bytes .../frontend/builtins/jet/Int.kotlin_class | Bin 1546 -> 1548 bytes .../builtins/jet/IntArray.kotlin_class | Bin 133 -> 135 bytes .../builtins/jet/IntIterator.kotlin_class | 7 +- .../builtins/jet/IntProgression.kotlin_class | Bin 118 -> 120 bytes .../builtins/jet/IntRange.kotlin_class | Bin 146 -> 148 bytes .../builtins/jet/IntRange.object.kotlin_class | Bin 37 -> 26 bytes .../frontend/builtins/jet/Long.kotlin_class | Bin 1546 -> 1548 bytes .../builtins/jet/LongArray.kotlin_class | Bin 136 -> 138 bytes .../builtins/jet/LongIterator.kotlin_class | 7 +- .../builtins/jet/LongProgression.kotlin_class | Bin 121 -> 123 bytes .../builtins/jet/LongRange.kotlin_class | Bin 147 -> 149 bytes .../jet/LongRange.object.kotlin_class | Bin 39 -> 27 bytes .../builtins/jet/Nothing.kotlin_class | 3 +- .../frontend/builtins/jet/Number.kotlin_class | 7 +- .../jet/PropertyMetadataImpl.kotlin_class | Bin 51 -> 53 bytes .../frontend/builtins/jet/Short.kotlin_class | Bin 1383 -> 1385 bytes .../builtins/jet/ShortArray.kotlin_class | Bin 136 -> 138 bytes .../builtins/jet/ShortIterator.kotlin_class | 7 +- .../jet/ShortProgression.kotlin_class | Bin 121 -> 123 bytes .../builtins/jet/ShortRange.kotlin_class | Bin 147 -> 149 bytes .../jet/ShortRange.object.kotlin_class | Bin 39 -> 27 bytes .../frontend/builtins/jet/String.kotlin_class | Bin 163 -> 165 bytes .../builtins/jet/Throwable.kotlin_class | 11 +- .../frontend/builtins/jet/Unit.kotlin_class | 3 +- .../builtins/jet/Unit.object.kotlin_class | Bin 40 -> 28 bytes .../frontend/builtins/jet/atomic.kotlin_class | 3 +- .../frontend/builtins/jet/data.kotlin_class | 3 +- .../builtins/jet/deprecated.kotlin_class | Bin 38 -> 40 bytes .../frontend/builtins/jet/inline.kotlin_class | 7 +- .../builtins/jet/noinline.kotlin_class | 3 +- .../builtins/jet/suppress.kotlin_class | Bin 53 -> 55 bytes .../builtins/jet/volatile.kotlin_class | 3 +- .../serialization/src/descriptors.proto | 13 +- .../serialization/DescriptorSerializer.java | 11 +- .../descriptors/serialization/ProtoBuf.java | 809 ++++++++++++++---- .../DeserializedClassDescriptor.java | 10 +- .../jet/lang/resolve/DescriptorFactory.java | 19 +- 71 files changed, 724 insertions(+), 245 deletions(-) diff --git a/compiler/frontend/builtins/jet/Any.kotlin_class b/compiler/frontend/builtins/jet/Any.kotlin_class index ef6c918b55f..5318f352bd5 100644 --- a/compiler/frontend/builtins/jet/Any.kotlin_class +++ b/compiler/frontend/builtins/jet/Any.kotlin_class @@ -1,2 +1,3 @@ -R Æ0B +j + Æ0B  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/Array.kotlin_class b/compiler/frontend/builtins/jet/Array.kotlin_class index 67f0538a5c72e1ec9689d56454e4fcbfba0946bb..dd17bd8d5e23caf4d1912db49d3dc983e405b00c 100644 GIT binary patch delta 16 Xcmcc3c$aa4)Wqxp=Bz-jiP8Z8HADrK delta 14 Vcmcc1c$;y86l2iD-hhcx1pp}y1wjA+ diff --git a/compiler/frontend/builtins/jet/Boolean.kotlin_class b/compiler/frontend/builtins/jet/Boolean.kotlin_class index 48876f24ce9187aa66d800779c6b84330bfb25b9..058a85afa03ade3234a67725a648a84a49892596 100644 GIT binary patch delta 34 ncmZo=Y-i-+V3Xi9V&P&EV45hN$DhT^#m#Yu(SX?rB*X~-Soj3C delta 31 kcmZo?Y-JSZV3Xi9V&P&EU<%^qIK*hc>;&R)PUOl107WYVcmMzZ diff --git a/compiler/frontend/builtins/jet/BooleanArray.kotlin_class b/compiler/frontend/builtins/jet/BooleanArray.kotlin_class index 59a95a485a35dbec2ce7115cde26dcb0cff03bec..c63f56907d30c38845130ce6cb04acfa2fb0e9f4 100644 GIT binary patch delta 46 wcmZo=Y-i-+V3Xi7V&P&EV4A3$B%LM6CC+h-(SX^Ci-SRcO$sEz;sheO0GW{mfB*mh delta 22 dcmZo?Y-Qx;V3Xi7V&P&EU<#U;FENoT2>>V(1O)&9 diff --git a/compiler/frontend/builtins/jet/BooleanIterator.kotlin_class b/compiler/frontend/builtins/jet/BooleanIterator.kotlin_class index cd5af886994..e431fb41a6e 100644 --- a/compiler/frontend/builtins/jet/BooleanIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/BooleanIterator.kotlin_class @@ -1,8 +1,9 @@ & 2  - R Æ0B - Z + Z 0B  Z &0B - \ No newline at end of file + j + Æ0B + \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/Byte.kotlin_class b/compiler/frontend/builtins/jet/Byte.kotlin_class index 96e16f171d7c3f0ceebf463b879185c53e1ece2c..939a717dd97a7bb2258602fefff331af4fbf3eef 100644 GIT binary patch delta 26 hcmaFP^^$9X#70#oR{ktrE^dxPj0Vh3EL=SpkzC2V?*M diff --git a/compiler/frontend/builtins/jet/ByteArray.kotlin_class b/compiler/frontend/builtins/jet/ByteArray.kotlin_class index a649c48a69ac2c9dedd23bc6a07e08b21b831535..168414bf61f61308f355a13c188741e7a409346d 100644 GIT binary patch delta 46 wcmZo=Y-i-+V3UwCV&P&EV4A3$B%LM6CC+h-(SX^Ci-SRcO$sEz;she40Gt5@pa1{> delta 22 dcmZo?Y-Qx;V3UwCV&P&EU<#U;FENoT2>>Ya1Qh@P diff --git a/compiler/frontend/builtins/jet/ByteIterator.kotlin_class b/compiler/frontend/builtins/jet/ByteIterator.kotlin_class index cddee191648..0c5f9e97d81 100644 --- a/compiler/frontend/builtins/jet/ByteIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/ByteIterator.kotlin_class @@ -1,8 +1,9 @@ &2  - R Æ0B -Z + Z 0B  Z &0?B - \ No newline at end of file + j + Æ0B + \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/ByteProgression.kotlin_class b/compiler/frontend/builtins/jet/ByteProgression.kotlin_class index 7c90b10e6675050c81136b8ad4e5401f68614243..3d29b0e00c716a7a6bceaaf3c73933456f265bee 100644 GIT binary patch delta 31 lcmXS`5aM8ykTK%nViJ%QViRHk(mWHLjhV9yxh4u5002X#1d{*& delta 28 icmb;@6Xsx(kTK%nViJ%QViRHk(mX*EJq#ua83O<~6a+#5 diff --git a/compiler/frontend/builtins/jet/ByteRange.kotlin_class b/compiler/frontend/builtins/jet/ByteRange.kotlin_class index 77d9ab60673379350cdd17b012e20adcf40e93e0..0102268d2c4cc1c0359408c8e6398887a3e2e5f0 100644 GIT binary patch delta 16 XcmbQlIE8V7(nNP}<}6jNiOMPfDXIi= delta 14 VcmbQjIEitB5@XQB0+oqM-T)w$1W^D0 diff --git a/compiler/frontend/builtins/jet/ByteRange.object.kotlin_class b/compiler/frontend/builtins/jet/ByteRange.object.kotlin_class index 234b12335aab4075ca49841f7d2f118736b53ca5..8a94951587fbcddf156a8598a6aaef11eebdf60f 100644 GIT binary patch literal 26 fcmd;RW0sINV&P&EV2a}AIHq9W=>+14WHA5$GPwiE literal 37 mcmd;RW0sINV&P&EU<%^qIK*hc>;&S-M{#o;Q!wxZb3_1Q5d}K{ diff --git a/compiler/frontend/builtins/jet/Char.kotlin_class b/compiler/frontend/builtins/jet/Char.kotlin_class index a3ff15dabad539eb995599650f10e48c6e4a7fd7..ab6607d04d3c2face19445fde51de523cbe824e2 100644 GIT binary patch delta 26 hcmey)@sneM#75O17XB<=E^dxPj0Vh3EL=XPw delta 34 qcmey#@ttFWgm4fy$00@oW+xUdCIS8^F%C8Z#mNg8MK>Covj6~?2nW9a diff --git a/compiler/frontend/builtins/jet/CharArray.kotlin_class b/compiler/frontend/builtins/jet/CharArray.kotlin_class index 5697327d4b311806a79682f1ad963e3b926fe2b2..2ca8847f22020ebc27bb70ed0c5e0846198b3293 100644 GIT binary patch delta 46 wcmZo=Y-i-+V3SZVV&P&EV4A3$B%LM6CC+h-(SX^Ci-SRcO$sEz;shcU0G#UutN;K2 delta 22 dcmZo?Y-Qx;V3SZVV&P&EU<#U;FENoT2>>ZZ1RDSV diff --git a/compiler/frontend/builtins/jet/CharIterator.kotlin_class b/compiler/frontend/builtins/jet/CharIterator.kotlin_class index 3ef3ea40e68..1d27898c159 100644 --- a/compiler/frontend/builtins/jet/CharIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/CharIterator.kotlin_class @@ -1,8 +1,9 @@ &!2  -R Æ0B -!Z +Z 0B Z &0LB - \ No newline at end of file +j + Æ0B +! \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/CharProgression.kotlin_class b/compiler/frontend/builtins/jet/CharProgression.kotlin_class index f46036e3c86c8e07804845201185a662214fc66e..3f8e60afbb6316a44857a8c81a902b7b6c4a2347 100644 GIT binary patch delta 31 lcmXS`5aM8yP%`4-ViJ%QViRHk()<&hjhV9yxh4u5002Z?1e^c> delta 28 icmb;@6Xsx(P%`4-ViJ%QViRHk()>XaJq#ua83O<~umnp0 diff --git a/compiler/frontend/builtins/jet/CharRange.kotlin_class b/compiler/frontend/builtins/jet/CharRange.kotlin_class index cf73b03419f2068a7a2cd9e5e013424a8fb2aec6..2a9c5b567f6d98ada8cf58393df168cfc2846c9f 100644 GIT binary patch delta 16 XcmbQlIE8V7(nNP}<}6jNiOMPfDXIi= delta 14 VcmbQjIEitB5@XQB0+oqM-T)w$1W^D0 diff --git a/compiler/frontend/builtins/jet/CharRange.object.kotlin_class b/compiler/frontend/builtins/jet/CharRange.object.kotlin_class index 412b9e2cb4c8d9a83f45eed45ed0e26b286c9652..926b720449deba714aca6ea8d26a9a55b0b899d5 100644 GIT binary patch literal 26 fcmd;RW0p`hV&P&EV2a}AIHq9W=>+14W-$N&GZX{P literal 37 mcmd;RW0p`hV&P&EU<%^qIK*hc>;&Q{M{#o;Q!wxZb3_4R&ILpO diff --git a/compiler/frontend/builtins/jet/Double.kotlin_class b/compiler/frontend/builtins/jet/Double.kotlin_class index a8e5be969860229885e2b7656f7f3ad1a7199719..eae62d739183953186299aa1f666184ad1833772 100644 GIT binary patch delta 26 hcmX@lb&+d=#70#uR{ktrE^dxPj0Vh3EL=>a?1S9|e diff --git a/compiler/frontend/builtins/jet/DoubleIterator.kotlin_class b/compiler/frontend/builtins/jet/DoubleIterator.kotlin_class index 4241312b851..5846b220330 100644 --- a/compiler/frontend/builtins/jet/DoubleIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/DoubleIterator.kotlin_class @@ -1,8 +1,9 @@ &*2  -R Æ0B -*Z +Z 0B Z &0]B - \ No newline at end of file +j + Æ0B +* \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/DoubleProgression.kotlin_class b/compiler/frontend/builtins/jet/DoubleProgression.kotlin_class index 1652bce93c9c21a4f3f40f3d6a64475742c48cbe..947ec762ca41fd448cfaac7516147372e9971490 100644 GIT binary patch delta 31 lcmXS`5aM8y&^F@XViJ%QViRHk(gG8mjhV9yxh4u5002cv1f~E0 delta 28 icmb;@6Xsx(&^F@XViJ%QViRHk(gHyfJq#ua83O=0egstj diff --git a/compiler/frontend/builtins/jet/DoubleRange.kotlin_class b/compiler/frontend/builtins/jet/DoubleRange.kotlin_class index e48ab9c02304ee55b3e7f1d90e0474b353868344..492a35a0f037c56348b173ecb7095e0a7931399e 100644 GIT binary patch delta 16 XcmbQlIE8V7(nNP}<}6jNiOMPfDXIi= delta 14 VcmbQjIEitB5@XQB0+oqM-T)w$1W^D0 diff --git a/compiler/frontend/builtins/jet/DoubleRange.object.kotlin_class b/compiler/frontend/builtins/jet/DoubleRange.object.kotlin_class index 44f79c3165aa5608fa5ca0ca6019bccf3da8d9ed..96abdce5a93d9f97305603ccbfc9205e43932b46 100644 GIT binary patch literal 26 fcmd;RW0ue{V&P&EV2a}AIHq9W=>+14WibE%Gu;E& literal 37 mcmd;RW0ue{V&P&EU<%^qIK*hc>;&TIL~(N*Q!wxZbHo5-b_G`e diff --git a/compiler/frontend/builtins/jet/Enum.kotlin_class b/compiler/frontend/builtins/jet/Enum.kotlin_class index 199d47fb0a5fcc075993f11e9388d103711be265..bbc9231d9e560aeda1cc46257cb689c7d84aa810 100644 GIT binary patch delta 35 jcmb=epP(Qe#l^v9km$t1#U!8#W+#E!ELpBx6BS(meFX+< delta 12 Tcmb=gouI%NG|}2+qJjhf91R26 diff --git a/compiler/frontend/builtins/jet/Float.kotlin_class b/compiler/frontend/builtins/jet/Float.kotlin_class index 98d14ff176f8a1bb4199f7fdd254dfc03d9dd557..2e34a417402682d0b00d56e4235413827683ef75 100644 GIT binary patch delta 26 hcmaFP^^$9X#70#oR{ktrE^dxPj0Vh3EL=>fh1V8`) diff --git a/compiler/frontend/builtins/jet/FloatIterator.kotlin_class b/compiler/frontend/builtins/jet/FloatIterator.kotlin_class index 6b97e4ef406..6e99cfb6f1c 100644 --- a/compiler/frontend/builtins/jet/FloatIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/FloatIterator.kotlin_class @@ -1,7 +1,8 @@ &F2  -R Æ0B -FZ +Z 0B Z &0ªB - \ No newline at end of file +j + Æ0B +F \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/FloatProgression.kotlin_class b/compiler/frontend/builtins/jet/FloatProgression.kotlin_class index 905c0f91faf0db10c531d47a5a226720e82d308b..6028a1cfe588647583a7d8c3531a6fd6e67fb051 100644 GIT binary patch delta 31 lcmXS`5aM8ya5v)NViJ%QViRHk(t;D6jhV9yxh4u5002l31j7IT delta 28 icmb;@6Xsx(a5v)NViJ%QViRHk(t<$~Jq#ua83O=2?gVlG diff --git a/compiler/frontend/builtins/jet/FloatRange.kotlin_class b/compiler/frontend/builtins/jet/FloatRange.kotlin_class index 35c06e5e1728013537a8bbf728920834e8b8b6aa..cf697889c3e2dcb609d893f3508bfdba1c5f915f 100644 GIT binary patch delta 16 XcmbQlIE8V7(nNP}<}6jNiOMPfDXIi= delta 14 VcmbQjIEitB5@XQB0+oqM-T)w$1W^D0 diff --git a/compiler/frontend/builtins/jet/FloatRange.object.kotlin_class b/compiler/frontend/builtins/jet/FloatRange.object.kotlin_class index f3db15ae1a1c566070e29e2fba5ecefe42328e32..8e33bc923741c1c7b18a2a493c7beafa057c19a3 100644 GIT binary patch literal 26 fcmd;RW0vqRV&P&EV2a}AIHq9W=>+14XE6W(Hb?{Y literal 37 mcmd;RW0vqRV&P&EU<%^qIK*hc>;&R?L~(N*Q!wxZbHo8@n+1>n diff --git a/compiler/frontend/builtins/jet/InlineStrategy.kotlin_class b/compiler/frontend/builtins/jet/InlineStrategy.kotlin_class index b1299bc58f5..6db15d8e2f5 100644 --- a/compiler/frontend/builtins/jet/InlineStrategy.kotlin_class +++ b/compiler/frontend/builtins/jet/InlineStrategy.kotlin_class @@ -1,4 +1,5 @@ †_2 - -_HR Â0B -_`Ä`Å \ No newline at end of file +_H`Ä`Åj + Â0B +_ \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/InlineStrategy.object.AS_FUNCTION.kotlin_class b/compiler/frontend/builtins/jet/InlineStrategy.object.AS_FUNCTION.kotlin_class index 5756388c7d49f6228a44af50355ac3020e26b13f..1707fc330b12d1c4b990ffc4dbe9bfc6d73f15a6 100644 GIT binary patch literal 13 Ucmd-$#3+$y#KOfS5TC^W01^}eU;qFB literal 24 dcmd-$#3+$y#KOfS5FfF@!mPl|o!su|6F^HSv5TgOJ6AKrUK*B_B9{_V?2JZj> diff --git a/compiler/frontend/builtins/jet/Int.kotlin_class b/compiler/frontend/builtins/jet/Int.kotlin_class index c725c793e47b850a99ca9b7115791ba19c06ccac..e4a48bc1e51ab317bad515888b51793e3370bc8e 100644 GIT binary patch delta 26 hcmeC;>EW3mu~GFYD}NR*7dOWtMgwLi7A__M764&31(pB+ delta 41 xcmeC->Ef9nAsocbafs1?*@=aVNq{9vjDyWUWb#I4@ri4BCdV-IZ1mm03IMwT3B~{b diff --git a/compiler/frontend/builtins/jet/IntArray.kotlin_class b/compiler/frontend/builtins/jet/IntArray.kotlin_class index 4eb53a39a00acc0c1dff3670764072e588200680..7979962addf4644ddbfe9672c3efd2206ed97f02 100644 GIT binary patch delta 46 wcmZo=Y-i-+V3SBTV&P&EV4A3$B%LM6CC+h-(SX^Ci-SRcO$sEz;shd-0jD4aG5`Po delta 22 dcmZo?Y-Qx;V3SBTV&P&EU<#U;FENoT2>>kc1YQ6D diff --git a/compiler/frontend/builtins/jet/IntIterator.kotlin_class b/compiler/frontend/builtins/jet/IntIterator.kotlin_class index f1769a66882..ddef68df2d4 100644 --- a/compiler/frontend/builtins/jet/IntIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/IntIterator.kotlin_class @@ -1,7 +1,8 @@ &d2  -R Æ0B -dZ +Z 0B Z &0ÐB - \ No newline at end of file +j + Æ0B +d \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/IntProgression.kotlin_class b/compiler/frontend/builtins/jet/IntProgression.kotlin_class index 04a7c9ee2b147180da2591716ed10b65edeb0ecf..9658c696bccd5be6ac31b5364194a26001db9c2f 100644 GIT binary patch delta 31 lcmXS`5aM8yNHyZ&ViJ%QViRHk(kv65jhV9yxh4u5002sF1k?Zk delta 28 icmb;@6Xsx(NHyZ&ViJ%QViRHk(kwv}Jq#ua83O=58U%v? diff --git a/compiler/frontend/builtins/jet/IntRange.kotlin_class b/compiler/frontend/builtins/jet/IntRange.kotlin_class index 32e63720ff737f81474ba6ff2e52738307e81876..e4664f6d2c7c6c2b46b34ad6fbbd537ba28c25e6 100644 GIT binary patch delta 16 XcmbQlIE8V7(nNP}<}6jNiOMPfDXIi= delta 14 VcmbQjIEitB5@XQB0+oqM-T)w$1W^D0 diff --git a/compiler/frontend/builtins/jet/IntRange.object.kotlin_class b/compiler/frontend/builtins/jet/IntRange.object.kotlin_class index 4f8b2126aff508361da7b50cbb92436171251770..0e7066b9cd71a52bd6f8967d1cdc6cdc9a7ce746 100644 GIT binary patch literal 26 fcmd;RW0puWV&P&EV2a}AIHq9W=>+1iWibE%IH?2z literal 37 mcmd;RW0puWV&P&EU<%^qIK*hc>;&SZMR9W+Q!wxZbJzfH3EW3mu~GFYD}NR*7dOWtMgwLi7A__MApl`S1*8A~ delta 19 acmeC->Ef9n!4bsGafs1?*=eKjD^>t9UIi}z diff --git a/compiler/frontend/builtins/jet/LongArray.kotlin_class b/compiler/frontend/builtins/jet/LongArray.kotlin_class index d320d3a885b3547675950322bf678eaf25857bcc..77d3d8a0fa4cda01b2e7615b2017819cf55914a0 100644 GIT binary patch delta 26 hcmeBR>|*5RV3SzKXvD(BB)~LLHJLd}ifbZ|Bmh4*1gQW3 delta 23 ecmeBT>|o^KV3SzKXvD(BB)}9ju~2d%cQODot^~FK diff --git a/compiler/frontend/builtins/jet/LongIterator.kotlin_class b/compiler/frontend/builtins/jet/LongIterator.kotlin_class index 3cca28e0802..6661b7970fe 100644 --- a/compiler/frontend/builtins/jet/LongIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/LongIterator.kotlin_class @@ -1,7 +1,8 @@ &¯2  -R Æ0B -¯Z +Z 0B Z &0§B - \ No newline at end of file +j + Æ0B +¯ \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/LongProgression.kotlin_class b/compiler/frontend/builtins/jet/LongProgression.kotlin_class index 38482d2e6edc3307f20f25768ba09811acf3fb7b..49ab66d78d20f4cb701a037a36f61a683e5d88d2 100644 GIT binary patch delta 32 mcmb=d7Up1+*uZGS!^I>ZE5s(m0;Gi|x|%R&8F5V%F$4frNd-Fq delta 29 jcmb=f6yac#*uZGS!^I>ZE5s(m0;Gk4CVCl86gB|>N5KT? diff --git a/compiler/frontend/builtins/jet/LongRange.kotlin_class b/compiler/frontend/builtins/jet/LongRange.kotlin_class index cd4540dccc602a358fa46ab0ae1ed8991881586b..d9b5489efd25261dd488ad803fed9d9c3ae9c018 100644 GIT binary patch delta 16 XcmbQtIF)gN(nNP3<}6jNiOMPfDbNIU delta 14 VcmbQrIGJ&R5@XQBLY0Y1J^&!L1XTb4 diff --git a/compiler/frontend/builtins/jet/LongRange.object.kotlin_class b/compiler/frontend/builtins/jet/LongRange.object.kotlin_class index 63b62c3374fa4b218f041ff86ae3b066171ccab8..b7e8f8ade6a1fb457cb61c58107f7eeca9023afa 100644 GIT binary patch literal 27 gcmd;RW0u&+XvD(BB)}BK&2db@z|#rDk;q~I06@Y7U;qFB literal 39 scmd;RW0u&+XvD(BB)}BJ!*PhwfZ2(ai&XF$DupCyjySpkyQ2U`FD diff --git a/compiler/frontend/builtins/jet/ShortArray.kotlin_class b/compiler/frontend/builtins/jet/ShortArray.kotlin_class index 95c4b941226f3014a2e521ff7458f42659703261..c4b137477faab3b5c83326b401f53483ae4335db 100644 GIT binary patch delta 26 hcmeBR>|*5RV3Rn&XvD(BB)~LLHJLd}ifbZ|Bmh8r1iJtL delta 23 ecmeBT>|o^KV3Rn&XvD(BB)}9ju~2d%cQODpyadPq diff --git a/compiler/frontend/builtins/jet/ShortIterator.kotlin_class b/compiler/frontend/builtins/jet/ShortIterator.kotlin_class index d270f942ae5..69bd992b2b2 100644 --- a/compiler/frontend/builtins/jet/ShortIterator.kotlin_class +++ b/compiler/frontend/builtins/jet/ShortIterator.kotlin_class @@ -1,7 +1,8 @@ &Á2  -R Æ0B -ÁZ +Z 0B Z &0ÐB - \ No newline at end of file +j + Æ0B +Á \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/ShortProgression.kotlin_class b/compiler/frontend/builtins/jet/ShortProgression.kotlin_class index 101422b04b610ff9f251a042a766f0387db6a987..7edc1ec7c8a1378e01fc945f2bc21b475dc0ad89 100644 GIT binary patch delta 32 mcmb=d7Up1+IK*hg!^I>ZE5s(m0;Gi}x|%R&8F5V%F$4ftCZE5s(m0;Gk5CVCl86gB|>NoNH7 diff --git a/compiler/frontend/builtins/jet/ShortRange.kotlin_class b/compiler/frontend/builtins/jet/ShortRange.kotlin_class index 0541bbd6a9ec621a17d5889c1ba9eaca7410ccc3..0666bd591ab8734cf9ac0e0c81af8b19f580ee83 100644 GIT binary patch delta 16 XcmbQtIF)gN(nNP3<}6jNiOMPfDbNIU delta 14 VcmbQrIGJ&R5@XQBLY0Y1J^&!L1XTb4 diff --git a/compiler/frontend/builtins/jet/ShortRange.object.kotlin_class b/compiler/frontend/builtins/jet/ShortRange.object.kotlin_class index 9d5d44b99ce2da922e3e934e3bc723fd5bdaa881..5bdd1fb8165f13e8667d33d7aa8436cfebe1f1a3 100644 GIT binary patch literal 27 gcmd;RW0p9~XvD(BB)}BK&2db@z|#rDk<4NM077E~a{vGU literal 39 scmd;RW0p9~XvD(BB)}BJ!*PhwfZ2(ai&@|>V-z>XF$DupCy delta 23 ecmZ3=xR`N*1aA;G$1z3&W+xUdCIQun5_JGVHU$j; diff --git a/compiler/frontend/builtins/jet/Throwable.kotlin_class b/compiler/frontend/builtins/jet/Throwable.kotlin_class index b725f9d327e..2714bdeec05 100644 --- a/compiler/frontend/builtins/jet/Throwable.kotlin_class +++ b/compiler/frontend/builtins/jet/Throwable.kotlin_class @@ -1,8 +1,9 @@ Ä2 -R+Æ0: Õ -%:Ö -ÄB -ÄZ0×B +Z0×B ÄZ 0ØB %Z 0ÙB - \ No newline at end of file +j- ++Æ0: Õ +%:Ö +ÄB +Ä \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/Unit.kotlin_class b/compiler/frontend/builtins/jet/Unit.kotlin_class index 235cc87b0b2..a3086e7bf97 100644 --- a/compiler/frontend/builtins/jet/Unit.kotlin_class +++ b/compiler/frontend/builtins/jet/Unit.kotlin_class @@ -1,3 +1,4 @@ 2 -HR Â0B +Hj + Â0B  \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/Unit.object.kotlin_class b/compiler/frontend/builtins/jet/Unit.object.kotlin_class index 860dfa407795f2c4fec99d67a5df2664b8b91f32..fe633c1791ecaaff9fb9aae43b3bb509220cb46b 100644 GIT binary patch literal 28 hcmd;RW0p9|XvD(BB)}BK!*NW(;5L&Jh{ut|002wF1o;2} literal 40 tcmd;RW0p9|XvD(BB)}BJ!*PhwfZ2(ai&@|(V-yd^F$II$Oimy<4gis22NeJS diff --git a/compiler/frontend/builtins/jet/atomic.kotlin_class b/compiler/frontend/builtins/jet/atomic.kotlin_class index e28959d941a..65f909d7c2f 100644 --- a/compiler/frontend/builtins/jet/atomic.kotlin_class +++ b/compiler/frontend/builtins/jet/atomic.kotlin_class @@ -1,3 +1,4 @@ †Æ2 -R Æ0B +j + Æ0B Æ \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/data.kotlin_class b/compiler/frontend/builtins/jet/data.kotlin_class index ba436607de6..95c5e2f4fd2 100644 --- a/compiler/frontend/builtins/jet/data.kotlin_class +++ b/compiler/frontend/builtins/jet/data.kotlin_class @@ -1,3 +1,4 @@ †Ç2 -R Æ0B +j + Æ0B Ç \ No newline at end of file diff --git a/compiler/frontend/builtins/jet/deprecated.kotlin_class b/compiler/frontend/builtins/jet/deprecated.kotlin_class index 57b0a40526aa957e452ecda87d8b13223ee3df7d..1fe9082bd8e230230d71cc15f69eae7562b2e9ee 100644 GIT binary patch delta 21 ccmY$>;OA&#k~qO=#KOfSz?db)HIY{m044YXX8-^I delta 19 acmdN;hE&k~qz1#KOfSz!)@optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-     * todo: other constructors?
-     * 
- */ - boolean hasPrimaryConstructor(); - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-     * todo: other constructors?
-     * 
- */ - org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getPrimaryConstructor(); - // repeated .org.jetbrains.jet.descriptors.serialization.Callable member = 11; /** * repeated .org.jetbrains.jet.descriptors.serialization.Callable member = 11; @@ -4483,6 +4465,24 @@ public final class ProtoBuf { * repeated int32 enum_entry = 12; */ int getEnumEntry(int index); + + // optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+     * This field is present if and only if the class has a primary constructor
+     * 
+ */ + boolean hasPrimaryConstructor(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+     * This field is present if and only if the class has a primary constructor
+     * 
+ */ + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor getPrimaryConstructor(); } /** * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class} @@ -4605,31 +4605,18 @@ public final class ProtoBuf { classObjectPresent_ = input.readBool(); break; } - case 82: { - org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = primaryConstructor_.toBuilder(); - } - primaryConstructor_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(primaryConstructor_); - primaryConstructor_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } case 90: { - if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { member_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000200; + mutable_bitField0_ |= 0x00000100; } member_.add(input.readMessage(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.PARSER, extensionRegistry)); break; } case 96: { - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) { enumEntry_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; + mutable_bitField0_ |= 0x00000200; } enumEntry_.add(input.readInt32()); break; @@ -4637,9 +4624,9 @@ public final class ProtoBuf { case 98: { int length = input.readRawVarint32(); int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00000400) == 0x00000400) && input.getBytesUntilLimit() > 0) { + if (!((mutable_bitField0_ & 0x00000200) == 0x00000200) && input.getBytesUntilLimit() > 0) { enumEntry_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000400; + mutable_bitField0_ |= 0x00000200; } while (input.getBytesUntilLimit() > 0) { enumEntry_.add(input.readInt32()); @@ -4647,6 +4634,19 @@ public final class ProtoBuf { input.popLimit(limit); break; } + case 106: { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = primaryConstructor_.toBuilder(); + } + primaryConstructor_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(primaryConstructor_); + primaryConstructor_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -4667,10 +4667,10 @@ public final class ProtoBuf { if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { nestedObjectName_ = java.util.Collections.unmodifiableList(nestedObjectName_); } - if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) { + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { member_ = java.util.Collections.unmodifiableList(member_); } - if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) { + if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) { enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); } makeExtensionsImmutable(); @@ -4800,6 +4800,437 @@ public final class ProtoBuf { // @@protoc_insertion_point(enum_scope:org.jetbrains.jet.descriptors.serialization.Class.Kind) } + public interface PrimaryConstructorOrBuilder + extends com.google.protobuf.MessageLiteOrBuilder { + + // optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+       * If this field is present, it contains serialized data for the primary constructor.
+       * Otherwise it's default and can be created manually upon deserialization
+       * 
+ */ + boolean hasData(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+       * If this field is present, it contains serialized data for the primary constructor.
+       * Otherwise it's default and can be created manually upon deserialization
+       * 
+ */ + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getData(); + } + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor} + */ + public static final class PrimaryConstructor extends + com.google.protobuf.GeneratedMessageLite + implements PrimaryConstructorOrBuilder { + // Use PrimaryConstructor.newBuilder() to construct. + private PrimaryConstructor(com.google.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + + } + private PrimaryConstructor(boolean noInit) {} + + private static final PrimaryConstructor defaultInstance; + public static PrimaryConstructor getDefaultInstance() { + return defaultInstance; + } + + public PrimaryConstructor getDefaultInstanceForType() { + return defaultInstance; + } + + private PrimaryConstructor( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + public PrimaryConstructor parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PrimaryConstructor(input, extensionRegistry); + } + }; + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + // optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + public static final int DATA_FIELD_NUMBER = 1; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable data_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+       * If this field is present, it contains serialized data for the primary constructor.
+       * Otherwise it's default and can be created manually upon deserialization
+       * 
+ */ + public boolean hasData() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+       * If this field is present, it contains serialized data for the primary constructor.
+       * Otherwise it's default and can be created manually upon deserialization
+       * 
+ */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getData() { + return data_; + } + + private void initFields() { + data_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized != -1) return isInitialized == 1; + + if (hasData()) { + if (!getData().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(1, data_); + } + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, data_); + } + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor, Builder> + implements org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructorOrBuilder { + // Construct using org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + data_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor getDefaultInstanceForType() { + return org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance(); + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor build() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor buildPartial() { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor result = new org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.data_ = data_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor other) { + if (other == org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance()) return this; + if (other.hasData()) { + mergeData(other.getData()); + } + return this; + } + + public final boolean isInitialized() { + if (hasData()) { + if (!getData().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + // optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable data_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+         * If this field is present, it contains serialized data for the primary constructor.
+         * Otherwise it's default and can be created manually upon deserialization
+         * 
+ */ + public boolean hasData() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+         * If this field is present, it contains serialized data for the primary constructor.
+         * Otherwise it's default and can be created manually upon deserialization
+         * 
+ */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getData() { + return data_; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+         * If this field is present, it contains serialized data for the primary constructor.
+         * Otherwise it's default and can be created manually upon deserialization
+         * 
+ */ + public Builder setData(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable value) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+         * If this field is present, it contains serialized data for the primary constructor.
+         * Otherwise it's default and can be created manually upon deserialization
+         * 
+ */ + public Builder setData( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.Builder builderForValue) { + data_ = builderForValue.build(); + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+         * If this field is present, it contains serialized data for the primary constructor.
+         * Otherwise it's default and can be created manually upon deserialization
+         * 
+ */ + public Builder mergeData(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable value) { + if (((bitField0_ & 0x00000001) == 0x00000001) && + data_ != org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance()) { + data_ = + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.newBuilder(data_).mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + + bitField0_ |= 0x00000001; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Callable data = 1; + * + *
+         * If this field is present, it contains serialized data for the primary constructor.
+         * Otherwise it's default and can be created manually upon deserialization
+         * 
+ */ + public Builder clearData() { + data_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor) + } + + static { + defaultInstance = new PrimaryConstructor(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor) + } + private int bitField0_; // optional int32 flags = 1 [default = 0]; public static final int FLAGS_FIELD_NUMBER = 1; @@ -5055,30 +5486,6 @@ public final class ProtoBuf { return classObjectPresent_; } - // optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - public static final int PRIMARY_CONSTRUCTOR_FIELD_NUMBER = 10; - private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable primaryConstructor_; - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-     * todo: other constructors?
-     * 
- */ - public boolean hasPrimaryConstructor() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-     * todo: other constructors?
-     * 
- */ - public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getPrimaryConstructor() { - return primaryConstructor_; - } - // repeated .org.jetbrains.jet.descriptors.serialization.Callable member = 11; public static final int MEMBER_FIELD_NUMBER = 11; private java.util.List member_; @@ -5138,6 +5545,30 @@ public final class ProtoBuf { return enumEntry_.get(index); } + // optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + public static final int PRIMARY_CONSTRUCTOR_FIELD_NUMBER = 13; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor primaryConstructor_; + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+     * This field is present if and only if the class has a primary constructor
+     * 
+ */ + public boolean hasPrimaryConstructor() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+     * This field is present if and only if the class has a primary constructor
+     * 
+ */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor getPrimaryConstructor() { + return primaryConstructor_; + } + private void initFields() { flags_ = 0; extraVisibility_ = ""; @@ -5147,9 +5578,9 @@ public final class ProtoBuf { nestedClassName_ = java.util.Collections.emptyList(); nestedObjectName_ = java.util.Collections.emptyList(); classObjectPresent_ = false; - primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); member_ = java.util.Collections.emptyList(); enumEntry_ = java.util.Collections.emptyList(); + primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance(); } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { @@ -5172,14 +5603,14 @@ public final class ProtoBuf { return false; } } - if (hasPrimaryConstructor()) { - if (!getPrimaryConstructor().isInitialized()) { + for (int i = 0; i < getMemberCount(); i++) { + if (!getMember(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } - for (int i = 0; i < getMemberCount(); i++) { - if (!getMember(i).isInitialized()) { + if (hasPrimaryConstructor()) { + if (!getPrimaryConstructor().isInitialized()) { memoizedIsInitialized = 0; return false; } @@ -5215,15 +5646,15 @@ public final class ProtoBuf { if (((bitField0_ & 0x00000008) == 0x00000008)) { output.writeBool(9, classObjectPresent_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(10, primaryConstructor_); - } for (int i = 0; i < member_.size(); i++) { output.writeMessage(11, member_.get(i)); } for (int i = 0; i < enumEntry_.size(); i++) { output.writeInt32(12, enumEntry_.get(i)); } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(13, primaryConstructor_); + } } private int memoizedSerializedSize = -1; @@ -5274,10 +5705,6 @@ public final class ProtoBuf { size += com.google.protobuf.CodedOutputStream .computeBoolSize(9, classObjectPresent_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += com.google.protobuf.CodedOutputStream - .computeMessageSize(10, primaryConstructor_); - } for (int i = 0; i < member_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(11, member_.get(i)); @@ -5291,6 +5718,10 @@ public final class ProtoBuf { size += dataSize; size += 1 * getEnumEntryList().size(); } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(13, primaryConstructor_); + } memoizedSerializedSize = size; return size; } @@ -5398,11 +5829,11 @@ public final class ProtoBuf { bitField0_ = (bitField0_ & ~0x00000040); classObjectPresent_ = false; bitField0_ = (bitField0_ & ~0x00000080); - primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000100); member_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000100); enumEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance(); bitField0_ = (bitField0_ & ~0x00000400); return this; } @@ -5463,20 +5894,20 @@ public final class ProtoBuf { to_bitField0_ |= 0x00000008; } result.classObjectPresent_ = classObjectPresent_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000100) == 0x00000100)) { + member_ = java.util.Collections.unmodifiableList(member_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.member_ = member_; + if (((bitField0_ & 0x00000200) == 0x00000200)) { + enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.enumEntry_ = enumEntry_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { to_bitField0_ |= 0x00000010; } result.primaryConstructor_ = primaryConstructor_; - if (((bitField0_ & 0x00000200) == 0x00000200)) { - member_ = java.util.Collections.unmodifiableList(member_); - bitField0_ = (bitField0_ & ~0x00000200); - } - result.member_ = member_; - if (((bitField0_ & 0x00000400) == 0x00000400)) { - enumEntry_ = java.util.Collections.unmodifiableList(enumEntry_); - bitField0_ = (bitField0_ & ~0x00000400); - } - result.enumEntry_ = enumEntry_; result.bitField0_ = to_bitField0_; return result; } @@ -5537,13 +5968,10 @@ public final class ProtoBuf { if (other.hasClassObjectPresent()) { setClassObjectPresent(other.getClassObjectPresent()); } - if (other.hasPrimaryConstructor()) { - mergePrimaryConstructor(other.getPrimaryConstructor()); - } if (!other.member_.isEmpty()) { if (member_.isEmpty()) { member_ = other.member_; - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000100); } else { ensureMemberIsMutable(); member_.addAll(other.member_); @@ -5553,13 +5981,16 @@ public final class ProtoBuf { if (!other.enumEntry_.isEmpty()) { if (enumEntry_.isEmpty()) { enumEntry_ = other.enumEntry_; - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000200); } else { ensureEnumEntryIsMutable(); enumEntry_.addAll(other.enumEntry_); } } + if (other.hasPrimaryConstructor()) { + mergePrimaryConstructor(other.getPrimaryConstructor()); + } return this; } @@ -5580,14 +6011,14 @@ public final class ProtoBuf { return false; } } - if (hasPrimaryConstructor()) { - if (!getPrimaryConstructor().isInitialized()) { + for (int i = 0; i < getMemberCount(); i++) { + if (!getMember(i).isInitialized()) { return false; } } - for (int i = 0; i < getMemberCount(); i++) { - if (!getMember(i).isInitialized()) { + if (hasPrimaryConstructor()) { + if (!getPrimaryConstructor().isInitialized()) { return false; } @@ -6264,98 +6695,13 @@ public final class ProtoBuf { return this; } - // optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-       * todo: other constructors?
-       * 
- */ - public boolean hasPrimaryConstructor() { - return ((bitField0_ & 0x00000100) == 0x00000100); - } - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-       * todo: other constructors?
-       * 
- */ - public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable getPrimaryConstructor() { - return primaryConstructor_; - } - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-       * todo: other constructors?
-       * 
- */ - public Builder setPrimaryConstructor(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable value) { - if (value == null) { - throw new NullPointerException(); - } - primaryConstructor_ = value; - - bitField0_ |= 0x00000100; - return this; - } - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-       * todo: other constructors?
-       * 
- */ - public Builder setPrimaryConstructor( - org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.Builder builderForValue) { - primaryConstructor_ = builderForValue.build(); - - bitField0_ |= 0x00000100; - return this; - } - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-       * todo: other constructors?
-       * 
- */ - public Builder mergePrimaryConstructor(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable value) { - if (((bitField0_ & 0x00000100) == 0x00000100) && - primaryConstructor_ != org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance()) { - primaryConstructor_ = - org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.newBuilder(primaryConstructor_).mergeFrom(value).buildPartial(); - } else { - primaryConstructor_ = value; - } - - bitField0_ |= 0x00000100; - return this; - } - /** - * optional .org.jetbrains.jet.descriptors.serialization.Callable primary_constructor = 10; - * - *
-       * todo: other constructors?
-       * 
- */ - public Builder clearPrimaryConstructor() { - primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Callable.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000100); - return this; - } - // repeated .org.jetbrains.jet.descriptors.serialization.Callable member = 11; private java.util.List member_ = java.util.Collections.emptyList(); private void ensureMemberIsMutable() { - if (!((bitField0_ & 0x00000200) == 0x00000200)) { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { member_ = new java.util.ArrayList(member_); - bitField0_ |= 0x00000200; + bitField0_ |= 0x00000100; } } @@ -6460,7 +6806,7 @@ public final class ProtoBuf { */ public Builder clearMember() { member_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000200); + bitField0_ = (bitField0_ & ~0x00000100); return this; } @@ -6477,9 +6823,9 @@ public final class ProtoBuf { // repeated int32 enum_entry = 12; private java.util.List enumEntry_ = java.util.Collections.emptyList(); private void ensureEnumEntryIsMutable() { - if (!((bitField0_ & 0x00000400) == 0x00000400)) { + if (!((bitField0_ & 0x00000200) == 0x00000200)) { enumEntry_ = new java.util.ArrayList(enumEntry_); - bitField0_ |= 0x00000400; + bitField0_ |= 0x00000200; } } /** @@ -6535,11 +6881,96 @@ public final class ProtoBuf { */ public Builder clearEnumEntry() { enumEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000400); + bitField0_ = (bitField0_ & ~0x00000200); return this; } + // optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + private org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance(); + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+       * This field is present if and only if the class has a primary constructor
+       * 
+ */ + public boolean hasPrimaryConstructor() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+       * This field is present if and only if the class has a primary constructor
+       * 
+ */ + public org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor getPrimaryConstructor() { + return primaryConstructor_; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+       * This field is present if and only if the class has a primary constructor
+       * 
+ */ + public Builder setPrimaryConstructor(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor value) { + if (value == null) { + throw new NullPointerException(); + } + primaryConstructor_ = value; + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+       * This field is present if and only if the class has a primary constructor
+       * 
+ */ + public Builder setPrimaryConstructor( + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.Builder builderForValue) { + primaryConstructor_ = builderForValue.build(); + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+       * This field is present if and only if the class has a primary constructor
+       * 
+ */ + public Builder mergePrimaryConstructor(org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor value) { + if (((bitField0_ & 0x00000400) == 0x00000400) && + primaryConstructor_ != org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance()) { + primaryConstructor_ = + org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.newBuilder(primaryConstructor_).mergeFrom(value).buildPartial(); + } else { + primaryConstructor_ = value; + } + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.jet.descriptors.serialization.Class.PrimaryConstructor primary_constructor = 13; + * + *
+       * This field is present if and only if the class has a primary constructor
+       * 
+ */ + public Builder clearPrimaryConstructor() { + primaryConstructor_ = org.jetbrains.jet.descriptors.serialization.ProtoBuf.Class.PrimaryConstructor.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + // @@protoc_insertion_point(builder_scope:org.jetbrains.jet.descriptors.serialization.Class) } diff --git a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.java b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.java index 115e39330d8..01b7fdf4aa9 100644 --- a/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.java +++ b/compiler/frontend/serialization/src/org/jetbrains/jet/descriptors/serialization/descriptors/DeserializedClassDescriptor.java @@ -209,8 +209,14 @@ public class DeserializedClassDescriptor extends AbstractClassDescriptor impleme private ConstructorDescriptor computePrimaryConstructor() { if (!classProto.hasPrimaryConstructor()) return null; - ProtoBuf.Callable constructorProto = classProto.getPrimaryConstructor(); - return (ConstructorDescriptor) deserializer.loadCallable(constructorProto); + ProtoBuf.Class.PrimaryConstructor constructorProto = classProto.getPrimaryConstructor(); + if (!constructorProto.hasData()) { + ConstructorDescriptorImpl descriptor = DescriptorFactory.createPrimaryConstructorForObject(this); + descriptor.setReturnType(getDefaultType()); + return descriptor; + } + + return (ConstructorDescriptor) deserializer.loadCallable(constructorProto.getData()); } @Nullable diff --git a/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorFactory.java b/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorFactory.java index 0a2bcea0dbe..edc3b943276 100644 --- a/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorFactory.java +++ b/core/descriptors/src/org/jetbrains/jet/lang/resolve/DescriptorFactory.java @@ -35,6 +35,14 @@ public class DescriptorFactory { public static final Name VALUE_OF_METHOD_NAME = Name.identifier("valueOf"); public static final Name VALUES_METHOD_NAME = Name.identifier("values"); + private static class DefaultConstructorDescriptor extends ConstructorDescriptorImpl { + public DefaultConstructorDescriptor(@NotNull ClassDescriptor containingClass) { + super(containingClass, Collections.emptyList(), true); + initialize(Collections.emptyList(), Collections.emptyList(), + getDefaultConstructorVisibility(containingClass)); + } + } + private DescriptorFactory() { } @@ -68,12 +76,11 @@ public class DescriptorFactory { @NotNull public static ConstructorDescriptorImpl createPrimaryConstructorForObject(@NotNull ClassDescriptor containingClass) { - ConstructorDescriptorImpl constructorDescriptor = - new ConstructorDescriptorImpl(containingClass, Collections.emptyList(), true); - constructorDescriptor.initialize(Collections.emptyList(), - Collections.emptyList(), - getDefaultConstructorVisibility(containingClass)); - return constructorDescriptor; + return new DefaultConstructorDescriptor(containingClass); + } + + public static boolean isDefaultPrimaryConstructor(@NotNull ConstructorDescriptor constructor) { + return constructor instanceof DefaultConstructorDescriptor; } @NotNull