Commit Graph

2552 Commits

Author SHA1 Message Date
Svetlana Isakova 68b4b8e946 KT-5182 Data flow info is lost for 'when' branches
#KT-5158 Fixed
  #KT-4332 Fixed
2014-06-06 15:56:02 +04:00
Nikolay Krasko 432eabdbcb Don't process val and var keywords in lambda parameters forever (KT-5170)
#KT-5170 Fixed
2014-06-04 18:53:59 +04:00
Alexey Sedunov 4a5d2e6728 Add tests for element -> pseudo-value mapping 2014-06-03 18:17:07 +04:00
Alexey Sedunov d2c055e9da Pseudocode: Introduce pseudo-value analysis 2014-06-03 18:17:05 +04:00
Andrey Breslav 37532e8d02 Compare return types when structurally comparing callables 2014-06-02 22:05:34 +04:00
Andrey Breslav 7f60ccf663 Support equalityAxioms in isSubtypeOf() 2014-06-02 22:05:33 +04:00
Andrey Breslav e50a17e668 Do not compare local classes by FqNames 2014-06-02 22:05:32 +04:00
Andrey Breslav 204fa76691 When checking overrides, compare methods structurally
Because they may come from different copies of the same class from different modules
2014-06-02 22:05:28 +04:00
Laszlo Hornyak 9dec0fb779 Correct the argument types of the StringBuilder.append
Modified AsmUtil to generate calls to more specific append methods
in the StringBuilder class in order to save computation time and make
less temporary objects.

Also adds unit-test to verify that the append(Object) method was
invoked 0 times while the append(String) 3 times

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>
2014-06-02 16:34:44 +04:00
Mikhael Bogdanov 34e8cae89e KT-5112 - test file update 2014-06-02 15:21:28 +04:00
Mikhael Bogdanov c80901bafa KT-5112 Generic signature lost for a field copied from class object to containing class
#KT-5112 Fixed
2014-06-02 13:12:25 +04:00
Alexander Udalov 796912bfcb Provide implicit receiver to extension property initializer
This is safe because initializers for extension properties are forbidden
anyway, we'll just won't be generating noisy error messages about non-existent
'this'
2014-05-29 21:24:06 +04:00
Alexander Udalov d78d4bc44c Disallow extension properties with backing fields
#KT-1682 Fixed
2014-05-29 21:24:05 +04:00
Alexander Udalov ea31f372aa Check for syntax/diagnostic errors in some tests 2014-05-29 21:24:05 +04:00
Alexander Udalov 2b5bc6b63d Fix logic of forcing method return type to be wrapped
Return type must be wrapped if any super-method in the hierarchy, not just the
direct super-method, returns a reference type (as opposed to a primitive type)

Actually there was a test reflecting this, but it wasn't running because of an
unfixed diagnostic error
2014-05-29 21:24:02 +04:00
Alexander Udalov 33f8c49275 Minor, change test case according to its name 2014-05-29 21:07:34 +04:00
Alexander Udalov 6210e45fbc Minor, improve test case for KT-1157
Multithreaded version was not working correctly and was throwing NPEs in the
log sometimes
2014-05-29 21:07:34 +04:00
Alexander Udalov 8a84d07645 Fix warnings in JVM codegen tests
Add generics where needed, add nullability annotations, etc.
Also delete some testcases from ArrayGenTest which will never be supported
2014-05-29 21:07:34 +04:00
Alexander Udalov cc94010d07 Fix broken test data file 2014-05-26 16:49:10 +04:00
Mikhael Bogdanov 69ef648005 Write outer class info for closures 2014-05-26 14:48:37 +04:00
Mikhael Bogdanov 449e26ce6d New tests for outer class info 2014-05-26 14:48:34 +04:00
Mikhael Bogdanov 950840b8c7 KT-5076 Error on inlining into object
#KT-5076 Fixed
2014-05-23 11:59:05 +04:00
Alexander Udalov 3c3d120004 Prohibit implicit overrides with lesser visibility
A non-abstract super-declaration is allowed to stand as 'an implementation' of
a fake override only if its visibility is not less than visibilities of all
other super-declarations

 #KT-2491 Fixed
2014-05-22 19:32:10 +04:00
Alexander Udalov db25f568dc Don't report "cannot infer visibility" on property accessors
If the diagnostic is already reported on the corresponding property, no need to
report it again for accessors
2014-05-22 19:32:10 +04:00
Alexander Udalov 9760f30c99 Don't allow fake override to inherit implementation with wrong return type
#KT-4763 Fixed
2014-05-22 19:32:10 +04:00
Andrey Breslav a66f44e4f5 TypeConstructor's equality for classes relies on FqNames
This is needed because different modules/libraries may define classes with the same FqNames, which may be identical or slightly different.
 Such classes must be considered equal, because your dependencies may rely on different packagings of the same codebase, and the classes there will be distinct though identical
  (think intellij-core vs idea-full).
2014-05-21 23:31:32 +04:00
Pavel V. Talanov b3898cfb0d Force the user of AstAccessControl to write at least one test violating restriction, implement such tests for existing tests
This is needed because the slightest change in the test setup can make the check useless without the client knowing
The solution is ugly but gives at least some protection against this
2014-05-21 15:40:29 +04:00
Pavel V. Talanov 0d4feb3bf3 JetInitializerList#getInitializers() by stub 2014-05-21 15:40:09 +04:00
Pavel V. Talanov 72bdacb074 Add explicit return types to several test data files so that AST access is not needed
Test cases are chosen so that addition/removal of explicit type will not interfere with the original purpose of the test
2014-05-21 15:40:08 +04:00
Pavel V. Talanov a807712ce7 Mark test data files for cases which can't be resolved without AST access 2014-05-21 15:40:07 +04:00
Andrey Breslav 773cb9efbe Signature comparison used to find super functions in SignaturesPropagationData
#KT-4509 Fixed
2014-05-21 15:26:05 +04:00
Mikhael Bogdanov 6ad2814b01 Suppot inlining default methods, inlining function into its default. 2014-05-21 13:56:09 +04:00
Mikhael Bogdanov d73ffc2f48 Diagnostic update to support default parameters in inline methods 2014-05-21 13:56:08 +04:00
Alexander Udalov af3d56b44e Fix JVM type mapping of arrays of type variables
#KT-4262 Fixed
 #KT-5056 Fixed
2014-05-20 19:22:53 +04:00
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