Commit Graph

2518 Commits

Author SHA1 Message Date
Alexander Udalov 4e8d6d4882 Report ABI version errors before diagnostics and other errors
Otherwise they're difficult to find in the end of the compiler messages
2014-05-20 19:22:53 +04:00
Svetlana Isakova cab8709f1c Rename: JetNodeTypes.LABEL_REFERENCE -> LABEL
There is LABEL_REFERENCE node in LabeledExpression, but it isn't a reference there
2014-05-20 15:07:03 +04:00
Svetlana Isakova e0f37bbef0 Generate parse error on label without name '@' 2014-05-20 15:07:03 +04:00
Svetlana Isakova 04729f5985 Added JetLabeledExpression; added support to parser 2014-05-20 15:07:01 +04:00
Svetlana Isakova 69e5444ddf Added tests on labels
#KT-1703 Fixed
 #KT-361 Fixed
 #KT-3920 Fixed
 #KT-3988 Fixed
 #KT-4247 Fixed
 #KT-4586 Fixed
 #KT-4603 Fixed
 #KT-591 Fixed
2014-05-20 15:06:59 +04:00
Alexander Udalov 8f7c0f0b65 Introduce KFunctionImpl, KMemberFunctionImpl, KExtensionFunctionImpl
Old 23*3 classes will be dropped, since they have no value.

Simplify JvmFunctionImplTypes significantly because of that
2014-05-19 19:50:59 +04:00
Alexander Udalov 5488a8402f Move and rename KFunctionImpl classes
Move from package "kotlin.reflect" to "kotlin.reflect.jvm.internal". They are
internal detail of the compiler and should not be used directly (especially now
that "kotlin.reflect" is in default import paths).

Also rename "KFunctionImplN" to "KFunctionNImpl", because this name makes more
sense
2014-05-19 19:50:58 +04:00
Alexander Udalov de8b2b3668 Fix generic signature for SAM adapters and constructors
SAM-related code in codegen was using JavaClassDescriptor directly, which has
an erased signature. Create and use a new abstraction SamType which has a full
generic signature of a type which was used in the SAM construct
2014-05-19 19:50:58 +04:00
Alexander Udalov 41eb0deaa0 Introduce FunctionImpl and ExtensionFunctionImpl classes
Old FunctionImpl0,1,2,... will be dropped since they had no purpose
2014-05-19 19:50:58 +04:00
Alexander Udalov 845e3323f9 Create error type if reflection class isn't found
Introduce a new diagnostic fired when reflection types aren't found in the
classpath
2014-05-19 19:50:57 +04:00
Alexander Udalov c7a7f31e82 Introduce module 'reflection', move KFunctionN to it
Metadata for KFunction classes is now longer serialized along with built-in
classes. This effectively means that it's no longer possible to find KFunction
classes via dependency on built-ins. There should be a kotlin-runtime library
in the specified classpath for reflection types to be resolvable.

A lot of tests were moved and changed, because tests on callable references
require stdlib in classpath from now on
2014-05-19 19:50:57 +04:00
Andrey Breslav 8885d5709e Private inside a package should be visible only inside this package in the same module 2014-05-19 13:02:25 +04:00
Andrey Breslav 9983a567d4 Multi-module diagnostic tests supported
Test added for internal visibility
2014-05-19 13:02:25 +04:00
Mikhael Bogdanov 380f1875b8 Don't generate default method implementation in package facade (just delegation) 2014-05-16 18:34:07 +04:00
Nikolay Krasko 5839fda22f Fix recovery in enum initializers 2014-05-16 17:09:56 +04:00
Mikhael Bogdanov 30e921fa89 Diagnostic: support anonymous objects in inline functions 2014-05-16 15:55:11 +04:00
Mikhael Bogdanov c5e9ea0d29 Support anonymous object constructor transformation and inline 2014-05-16 15:55:08 +04:00
Mikhael Bogdanov 9007ba9c53 Anonymous object transformation 2014-05-16 13:33:57 +04:00
Mikhael Bogdanov 6fb0050575 KT-4982 this$0 is not initialized in the anonymous object
#KT-4982 Fixed
2014-05-16 13:33:39 +04:00
Natalia Ukhorskaya 0677075335 Parser for JetBlockCodeFragment 2014-05-15 13:54:25 +04:00
Natalia Ukhorskaya a0549f0ff5 Evaluate expression: allow to call invisible members
#KT-4935 Fixed
2014-05-15 13:54:22 +04:00
Andrey Breslav 4cb23eb1f1 A test for the case of finding binary class for a nested Java class 2014-05-14 18:58:57 +04:00
Andrey Breslav a861e5bc5e A test for the case fixed in 291741754b
When Java binaries refer to Kotlin binaries, and then some Kotlin source refers to the same Kotlin binary class, we should load this class consistently
2014-05-14 18:58:57 +04:00
Alexander Udalov 888a6c0c9b Add tests on Kotlin against compiled Java+Kotlin
The original purpose was to create a test that parameter names are inherited on
a K-J-K hierarchy when "K-J" is compiled to bytecode, but that's not possible
right now because of KT-4509
2014-05-14 18:58:57 +04:00
Andrey Breslav 3a9f577d1d All bounds may be specified in 'where' clause
Exception fixed in AlternativeMethodSignatureData
2014-05-13 20:19:43 +04:00
Alexander Udalov 3a0aac4857 Simplify type mapping logic in CodegenBinding
- inline asmType to calling getAsmType, which does something more
- refactor getJvmInternalName to use getAsmType as well
- simplify getAsmType and fix a probable bug in mapping singletons nested in
  enums (which wasn't reproduced, though a test is added)
- delete unnnecessary ASM_TYPE recording for enum entries in
  CodegenAnnotatingVisitor
2014-05-08 16:45:15 +04:00
Valentin Kipyatkov 0920ab2c25 Fixed mock jdk 2014-05-07 22:50:21 +04:00
Valentin Kipyatkov 717977af61 No more java lookup elements in code completion (except for one case) 2014-05-07 22:50:21 +04:00
Alexander Udalov d271be7f60 Add a test for an obsolete issue 2014-05-07 03:08:24 +04:00
Alexander Udalov 51b01b5d7d Replace some REFERENCE_TARGET calls with RESOLVED_CALL
Also don't do unnecessary and failing casts in CodegenAnnotatingVisitor for SAM
adapters

 #KT-3173 Fixed
 #KT-3999 Fixed
 #KT-4682 Fixed
2014-05-05 16:49:23 +04:00
Svetlana Isakova 73cd776715 Added test for KT-4640
#KT-4640 Obsolete
2014-04-30 13:54:21 +04:00
Svetlana Isakova 5a84ed4497 KT-4866 Resolve does not work inside brackets with unresolved reference before
#KT-4866 Fixed
2014-04-30 13:34:34 +04:00
Svetlana Isakova 775606f80a Do not remove trivial substitutions
to avoid substituting a new type parameter by default instead of leaving the same
 #KT-4887 Fixed
2014-04-30 13:34:34 +04:00
Svetlana Isakova 808cf75060 Fixed bug: resolution task wasn't recreated
The old resolved calls were used
2014-04-30 13:34:34 +04:00
Svetlana Isakova 928b28e080 Complete type inference for nested calls
inside non resolved invocation
2014-04-30 13:34:31 +04:00
Andrey Breslav 550c0ed998 Report "UNSUPPORTED" on usages of typedef 2014-04-29 19:12:55 +04:00
Andrey Breslav 31e859356f A test that fails in lazy mode (currently disabled) 2014-04-29 19:12:55 +04:00
Denis Zharkov cb1e762fc4 Optimizations of When expression with int constants:
Added test with dense constants (tableswitch should be used)
2014-04-25 18:17:37 +04:00
Denis Zharkov 3bc1c45fde Refactored tests for switch optimization of When expression 2014-04-25 18:17:36 +04:00
Denis Zharkov 95345a9bd4 Tests for switchOptimization: shuffled and added sparse version 2014-04-25 18:17:36 +04:00
Denis Zharkov 1952781e4b SwitchOptimization: generating `lookupswitch' opcode for 'when' in case of integral types 2014-04-25 18:17:36 +04:00
Denis Zharkov c73533d214 Switch Optimization 2014-04-25 18:16:24 +04:00
Alexander Udalov 61675de305 Optimize PropertyMetadataImpl instance creation
Create all property metadatas in <clinit> and save them to a static array
$propertyMetadata. Getter/setter of each delegated property will then just
obtain the corresponding instance from that array

 #KT-4232 Fixed
2014-04-24 16:10:15 +04:00
Alexander Udalov f7235e9d82 Fix abstract nested class in enums in JVM back-end
It caused InstantiationError because the enum had an incorrect ACC_ABSTRACT
flag
2014-04-24 16:10:13 +04:00
Alexander Udalov d913dfb1aa Correctly map declaration owner in JVM codegen
"context.contextKind()" was incorrect in
ExpressionCodegen.intermediateValueForProperty(), because it represents the
context of the call site, not the context of the property declaration

 #KT-4878 Fixed
2014-04-24 16:10:12 +04:00
Alexander Udalov fbf9f5f7d0 Don't generate bridges for equals(), hashCode(), toString()
Otherwise an assertion is failing in the algorithm which is related to an
inconsistency of java.lang.Object inheritance in JDR (KT-4890)
2014-04-24 16:10:12 +04:00
Andrey Breslav f0a29f190b USELESS_HIDDEN_IMPORT diagnostic fixed for LAZY mode 2014-04-18 21:28:23 +04:00
Alexander Udalov cdceaec79f Fix unjustified descriptorToDeclaration in bridge codegen
Delegated and synthesized members don't usually have a declaration as well as
fake overrides
2014-04-18 17:18:51 +04:00
Alexander Udalov 5e138a606b Report "cannot infer visibility" for delegated members 2014-04-17 19:51:32 +04:00
Alexander Udalov 1deb55bfde Add positioning strategy for diagnostics on illegal fake overrides
"funcitonTypes.kt" test data file was changed because now that there is a
positioning strategy, it takes the liberty of filtering out those diagnostics
that were reported on syntactically invalid elements
2014-04-17 19:51:31 +04:00