Commit Graph

611 Commits

Author SHA1 Message Date
Evgeny Gerashchenko 65f1a8f430 Added test with number literals passed as constants. 2013-01-28 18:29:21 +04:00
Evgeny Gerashchenko 18b5495a8c KT-1895 Make it possible to pass 1.0 as Float without explicit casting
#KT-1895 fixed
2013-01-28 18:29:21 +04:00
Alexander Udalov a0a22b7be6 Outer's superclass' method is now inaccessible from nested
Also the diagnostic error message reported the wrong nested class name: it
should be the nested class in the hierarchy which is static, not the class of
the scope where we're checking the accessibility
2013-01-23 20:18:16 +04:00
Kirill Berezin e89a8c684f KT-3159 Disallow overriding var with different type #KT-3159 fixed 2013-01-21 15:42:39 -08:00
Jack Zhou 2f47e30a1a Fixed UnsupportedOperationException when a namespace is used in place of an expression. 2013-01-21 13:10:19 +04:00
Alexander Udalov 8dff523858 Add some regression tests for obsolete issues
Regenerate tests
2013-01-17 17:38:46 +04:00
Alexander Udalov 192a81591b Resolve qualified nested class expressions
lookupNamespaceType now returns NamespaceType of a scope not only of the
namespace found by name, but also of the classifier static classes scope found
by the same name. This allows correct resolution of expressions
"Class.Nested.member()", where Class comes from Java (previously it was
resolved into a NamespaceDescriptor with a NamespaceType).

NamespaceDescriptor.getNamespaceType() is deleted since there are no sense in
namespace's NamespaceType alone anymore.

Also some minor refactoring (referencedName param is useless)

 #KT-1174 In Progress
2013-01-16 23:11:50 +04:00
Alexander Udalov c4b5577555 Do not report NO_CLASS_OBJECT when namespacesAllowed=true
Now with nested classes the expression "A.something" makes sense even when A
doesn't have a class object ("something" could be a nested class)

Also "A" expression now gets a NamespaceType with the scope of all static
nested classes of A

 #KT-1174 In Progress
2013-01-16 23:11:50 +04:00
Alexander Udalov 051e94b1c5 Get rid of MutableClassDescriptorLite.isStatic()
isStatic() is now precisely !isInner()
2013-01-16 23:11:48 +04:00
Alexander Udalov b612989eb0 Remove 'inner enum' hack & fix Java inner class resolve
Inner enum was placed into the class object of the outer class. Remove the
hack from frontend, frontend.java & backend. Fix tests

 #KT-1174 In Progress
2013-01-16 23:11:47 +04:00
Alexander Udalov 0b51a6cae0 Disallow nested classes within inner & local classes
#KT-1174 In Progress
2013-01-16 23:11:45 +04:00
Alexander Udalov a0caa88adf Report ILLEGAL_MODIFIER on inappropriate 'inner' keyword usage
#KT-1174 In Progress
2013-01-16 23:11:44 +04:00
Alexander Udalov 0a1907de11 Check all modifiers for objects
DeclarationsChecker didn't check visibility modifiers for objects
2013-01-16 23:11:43 +04:00
Alexander Udalov 7a3000ccac Forbid usage of outer's generic parameter in nested class
#KT-1174 In Progress
2013-01-16 23:11:42 +04:00
Alexander Udalov 43c37398af Labeled this & super to nested class' outer is an error
#KT-1174 In Progress
2013-01-16 23:11:42 +04:00
Alexander Udalov 5d92453532 Inaccessible outer class member is now an error
#KT-1174 In Progress
2013-01-16 23:11:41 +04:00
Evgeny Gerashchenko 6574eca393 Fixed test after introducing new warning. 2013-01-16 15:58:02 +04:00
Vladimir Rudev 290681ceee KT-614 Emit a warning when non-null type is checked for instance of nullable type
#KT-614 Fixed
2013-01-15 23:44:20 +04:00
Andrey Breslav 1a03850951 A test for K-J-K inheritance with generics 2013-01-15 15:32:04 +04:00
Andrey Breslav d4854c22c4 A test for K-J-K inheritance 2013-01-15 15:32:04 +04:00
Andrey Breslav 9d538dad8a EA-36903 - ISE: JavaTypeTransformer$.visitClassType Fixed 2013-01-10 16:16:49 +04:00
Svetlana Isakova 33a82da493 supertype of error type should be an error type, not any 2013-01-10 15:55:50 +04:00
Svetlana Isakova 142d9a090c no senseless comparison for error type 2013-01-10 15:55:50 +04:00
Pavel V. Talanov 293b272a22 Fix for a problem where inner (or nested) classes were not analyzed in some situations
# KT-3124 Fixed
2013-01-09 18:38:58 +04:00
Svetlana Isakova 0b53bd25bd KT-2397 Prohibit final methods in traits with no implementation
#KT-2397 fixed
2012-12-29 20:08:10 +04:00
Svetlana Isakova 55968aabad fixed an exception from 'getConstructorReferenceExpression'
(from exception analyzer)
2012-12-29 20:08:10 +04:00
Svetlana Isakova 22d3adc89f KT-3184 Type inference seems partially broken
#KT-3184 fixed
2012-12-27 18:45:24 +04:00
Svetlana Isakova 70cde87052 checking subtype for invariant type with error generic argument may success 2012-12-26 18:58:57 +04:00
Svetlana Isakova 38cc3e39e4 test for obsolete KT-2741
#KT-2741 obsolete
2012-12-26 18:01:23 +04:00
Svetlana Isakova a299cec2eb KT-3174 Call resolver doesn't understand type is not-nullable after ?. safe call
#KT-3174 fixed
2012-12-26 16:43:59 +04:00
Svetlana Isakova 9b645589df KT-2838 Type inference failed on passing null as a nullable argument
#KT-2838 fixed
2012-12-26 14:38:53 +04:00
Svetlana Isakova e6594ed5b1 KT-2883 Type inference fails due to non-Unit value returned
#KT-2883 fixed
2012-12-26 13:53:42 +04:00
Svetlana Isakova 54dffd6aad tests for obsolete tasks
#KT-3007 obsolete
 #KT-3038 obsolete
2012-12-26 13:01:48 +04:00
Svetlana Isakova b0302246a0 HtmlTabledDescriptorRendererTest renamed to DiagnosticMessageTest 2012-12-25 19:12:01 +04:00
Svetlana Isakova 76a62d8b7d added PLACEHOLDER_FUNCTION_TYPE tests 2012-12-25 19:12:01 +04:00
Svetlana Isakova 4089ac68bd improved error reporting
when error type is a generic parameter
2012-12-25 19:12:01 +04:00
Svetlana Isakova 19e6b02da8 CANNOT_INFER_PARAMETER_TYPE reporting improvement 2012-12-25 19:12:01 +04:00
Svetlana Isakova 2077faa76a no ambiguity when overloading with different function type
(in incomplete resolve)
2012-12-25 19:12:01 +04:00
Svetlana Isakova c37d7352a5 improved reporting TYPE_MISMATCH error for function literals
(introduced EXPECTED_PARAMETER_TYPE_MISMATCH, EXPECTED_RETURN_TYPE_MISMATCH, EXPECTED_PARAMETERS_NUMBER_MISMATCH
instead of reporting TYPE_MISMATCH on the whole function literal)
2012-12-25 19:12:00 +04:00
Svetlana Isakova 972b234db6 KT-3150 Kotlin m4 don't recognize function literals
#KT-3150 fixed

 added check for PLACEHOLDER_FUNCTION_TYPE to constraint system
2012-12-25 19:12:00 +04:00
Svetlana Isakova a5cf54d370 do not miss repeated 'uninitialized' error for properties 2012-12-18 19:47:55 +04:00
Svetlana Isakova 67d0d8b1a9 fix: val can be reassigned through backing field inside its own getter 2012-12-18 19:47:54 +04:00
Svetlana Isakova 58de1cabbc update tests according to package properties check 2012-12-18 19:47:54 +04:00
Svetlana Isakova 11bc01795f check package declaration in a file
to have the right properties initialization order
not to report errors if isDeclaredLocally (only recordInitializedVariables)
2012-12-18 19:47:54 +04:00
Svetlana Isakova f697098fb4 KT-2960 Perform control flow checks for package property initializers
#KT-2960 fixed
2012-12-18 19:47:52 +04:00
Svetlana Isakova d7a60f5fed added tests for KT-2369, KT-2585 and KT-2972
KT-2369 Variable is not marked as uninitialized in 'finally' section
 #KT-2369 fixed
KT-2585 Code in try-finally is incorrectly marked as unreachable
 #KT-2585 fixed
KT-2972 Wrong "unused value" warning when finally is present
 #KT-2972 fixed
2012-12-18 16:00:26 +04:00
Svetlana Isakova 9904f21ceb added ThrowExceptionInstruction
(to store throw expression in it)
2012-12-18 16:00:26 +04:00
Svetlana Isakova 93327a3e31 check uninitialized vars inside local declarations
added parameter 'includeInsideLocalDeclarations' to getDeclaredVariables
2012-12-18 16:00:26 +04:00
Svetlana Isakova 8141229744 added edge from try start to error through finally block
KT-2845 Wrong cf-analysys for variable initialization in try..finally
 #KT-2845 fixed
todo: some errors now are reported for several times (each time when analyzing finally block)
2012-12-18 16:00:25 +04:00
Evgeny Gerashchenko 34f9ae77ba Getting super methods correctly for inheritors of Collection, etc. 2012-12-10 21:43:42 +04:00