Mikhail Glukhikh
e53c548ead
Consider property external if all accessors are external #KT-13997 Fixed
2017-05-04 14:17:40 +03:00
Mikhail Glukhikh
b8af0f5922
J2K: move isEffectivelyExternal to kt-file, parameter -> receiver
2017-05-04 14:17:38 +03:00
Dmitry Petrov
d5feb2d6f4
Deep copy fixes + sanitize file names for module dumps
2017-05-04 13:51:17 +03:00
Dmitry Petrov
506941e7e0
Optimize range operations for 'until' extension from stdlib (KT-9900)
...
NB: for-in-until loop is generated as precondition loop, because the
corresponding range is right-exclusive (and thus we have no problems
with integer overflows).
2017-05-04 10:09:42 +03:00
Dmitry Petrov
b83620fdb9
Minor: DeepCopyIrTree: make some utility methods 'protected'
2017-05-04 09:33:03 +03:00
Dmitry Petrov
e600a1af30
Minor: IrDeclarationOrigin.NEW_INSTANCE_RECEIVER -> INSTANCE_RECEIVER
2017-05-04 09:33:03 +03:00
Dmitry Petrov
1eb693b8ee
Transform variable-as-function calls for extension functions
...
In the following code example
fun test(f: Any.() -> Unit) = 42.f()
front-end resolves variable-as-function call for 'f' as 'invoke'
with signature 'Function1<Any, Unit>#Any.() -> Unit'.
However, Function1<Any, Unit> has a single 'invoke' method
with signature 'Function1<Any, Unit>#(Any) -> Unit'.
This didn't cause any problems with loosely typed JVM and JS back-ends.
However, in IR with symbols this means a reference to non-existing
declaration.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
7bd75df1f1
Minor: small refactorings in IrElementTransformerVoid
2017-05-04 09:33:03 +03:00
Dmitry Petrov
0203ba4dff
Use stable order when generating stubs for scope members
2017-05-04 09:33:03 +03:00
Dmitry Petrov
40939da9fb
Minor: DeclarationGeneratorExtension already extends Generator
2017-05-04 09:33:03 +03:00
Dmitry Petrov
17706d0fb6
Generate parameter declarations for synthetic members of enum classes
2017-05-04 09:33:03 +03:00
Dmitry Petrov
c4346f95ff
Minor: fix testData format local delegated properties with 'suspend'
2017-05-04 09:33:03 +03:00
Dmitry Petrov
8b32d54a62
Minor: fix testData format for IR source range tests
2017-05-04 09:33:03 +03:00
Dmitry Petrov
78a601af87
Generate parameter declarations for fake overrides
2017-05-04 09:33:03 +03:00
Dmitry Petrov
fa4dc26814
Put 'thisReceiver' declaration in class
...
Interfaces also have 'thisReceiver'
2017-05-04 09:33:03 +03:00
Dmitry Petrov
90ec53b3b0
Generate catch-block body within proper scope
2017-05-04 09:33:03 +03:00
Dmitry Petrov
acefd0d891
Minor refactor and fix in Scope constructors
2017-05-04 09:33:03 +03:00
Dmitry Petrov
54294eaaa7
Minor fix and deprecation in DeepCopyIrTree
2017-05-04 09:33:03 +03:00
Dmitry Petrov
4dd199fedf
OldDeepCopyIrTree --> DeepCopyIrTree (for migration)
2017-05-04 09:33:03 +03:00
Dmitry Petrov
d5fb0f3f32
Minor: simplify code in generateEnumConstructorCallOrSuperCall
2017-05-04 09:33:03 +03:00
Dmitry Petrov
aa515a9e5a
Add test for outer class instance reference from inner class
2017-05-04 09:33:03 +03:00
Dmitry Petrov
5ec9cb3171
OldDeepCopyIrTree: old DeepCopyIrTree working with new IrElement hierarchy
2017-05-04 09:33:03 +03:00
Dmitry Petrov
b53807ab83
Drop IrBuiltinsOperatorsBuilder
2017-05-04 09:33:03 +03:00
Dmitry Petrov
de7b7ce6d5
Generate anonymous initializer body in separate scope
2017-05-04 09:33:03 +03:00
Dmitry Petrov
9c3387e174
Deprecate IrMemberFunctionBuilder
2017-05-04 09:33:03 +03:00
Dmitry Petrov
6f2c8140cf
IrDelegatingConstructorCall should have substituted descriptor
2017-05-04 09:33:03 +03:00
Dmitry Petrov
6e79709ef1
Simplify helper methods in SymbolTable auxiliary classes
2017-05-04 09:33:03 +03:00
Dmitry Petrov
a511540aad
Render receivers as 'this@owner: type'
...
Add test for generic inner class with generic outer class.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
1bf6f8fc57
Do not generate separate type parameter declarations for constructors
2017-05-04 09:33:03 +03:00
Dmitry Petrov
57b2a4461c
Call IrSymbol.bind in declaration constructors
2017-05-04 09:33:03 +03:00
Dmitry Petrov
7995684d07
Bind declaration symbols in DeepCopyIrTree.
...
Check that symbols are properly bound.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
208bf5c667
Bind declaration symbols in DeepCopyIrTree.
...
Check that symbols are bound.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
a840cf7643
Fix source range tests: support "undefined" offsets
2017-05-04 09:33:03 +03:00
Dmitry Petrov
40e09a39c1
Fix prototype JVM BE tests
2017-05-04 09:33:03 +03:00
Dmitry Petrov
2b0d3440ad
Descriptors in calls are substituted,
...
and symbols refer to the original descriptors.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
d7a362b4f6
Binding: all current tests are green.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
00e4accb7b
Add 'isBound' property to IrSymbol
2017-05-04 09:33:03 +03:00
Dmitry Petrov
2b48908586
Local delegated properties implementation + some more fixes
2017-05-04 09:33:03 +03:00
Dmitry Petrov
c9777fd79f
Add symbols to references
...
TODO: fix some more tests
2017-05-04 09:33:03 +03:00
Dmitry Petrov
0595e93952
Use SymbolTable to create symbols for declarations
...
Introduce hierarchical sub-tables (for variables, type parameters, and value parameters).
First version passing all tests.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
209864e6a3
Minor: fix IrFunctionImpl#accept
2017-05-04 09:33:03 +03:00
Dmitry Petrov
7289903fa5
Introduce SymbolTable as a symbol factory and unbound symbols tracker
2017-05-04 09:33:03 +03:00
Dmitry Petrov
f96a21e899
Redo IrSymbol as a light-weight declaration reference
...
Strip it of any "useful" information but a reference to the corresponding
symbol owner (file or a declaration).
TODO: add that useful information to declarations.
NB not all IrDeclarations have IrSymbols (IrProperty doesn't - at least now).
2017-05-04 09:33:03 +03:00
Dmitry Petrov
b817638851
Add IrSimpleFunction : IrFunction
...
NB can't make 'override val descriptor: SimpleFunctionDescriptor' there,
because there are quite some FunctionDescriptors that are not
SimpleFunctionDescriptor, but actually belong to this category.
2017-05-04 09:33:03 +03:00
Dmitry Petrov
a416cddcb2
Generate declarations for FAKE_OVERRIDE members
2017-05-04 09:33:03 +03:00
Dmitry Petrov
4ee1fb9309
Minor refactoring
...
- Get rid of IrClassImpl usages where IrClass is enough
- Use startOffsetOrUndefined / endOffsetOrUndefined
2017-05-04 09:33:03 +03:00
Dmitry Petrov
8cea27b5bb
Generate IrTypeParameter and IrValueParameter declarations
2017-05-04 09:33:03 +03:00
Dmitry Petrov
03b664febd
Insert implicit casts for default parameter values in IrValueParameter
2017-05-04 09:33:03 +03:00
Dmitry Petrov
77614a749b
Minor: unnecessary overrides in IrBlockImpl
2017-05-04 09:33:03 +03:00
Dmitry Petrov
abb687aa7f
Introduce IrTypeParameter and IrValueParameter declarations
2017-05-04 09:33:03 +03:00