Commit Graph

5055 Commits

Author SHA1 Message Date
Denis Zharkov eefea26d54 Recovery for initializer if no LBRACE
- If no LBRACE after 'init' keyword parse initializer without body
- Made getBody() nullable, appropriate checks added
2015-03-18 19:59:25 +03:00
Denis Zharkov df23ff3473 Improve AddInitKeyword quickfix
- Extract quickfix method
- Delete redundant semicolon
- Do not replace initializer PSI element
2015-03-18 19:59:25 +03:00
Denis Zharkov bd5dbb665e Fix header scope for secondary constructors
Add companion object's scope and nested classes

 #KT-6996 fixed
2015-03-18 19:59:24 +03:00
Stanislav Erokhin 47e8b1e77c Create warning for old lambda syntax. 2015-03-18 16:06:44 +03:00
Stanislav Erokhin c24c3daf54 Allowed shorthand parameter list with type reference in lambda. 2015-03-18 16:06:44 +03:00
Stanislav Erokhin 446816e3db Created automatic labeling of function expression. 2015-03-18 16:06:44 +03:00
Stanislav Erokhin 4eac3f3f0e Remove useless casts after fixing subtyping for star projections 2015-03-18 16:06:44 +03:00
Denis Zharkov e05cbf5e9f Support secondary constructors and delegation calls in Change Signature.
Initial support of Find Usages
2015-03-18 10:56:36 +03:00
Alexey Sedunov 7d278f2f42 Use class name as secondary constructor name 2015-03-18 10:56:33 +03:00
Denis Zharkov 36665fe3b8 Change logic of constructor delegation call resolution
- If class has type arguments (A<T1,..>) then
  resolve it's delegation call to `this` as for expression A<T1, ..>()
  like type arguments are explicitly specified.

- Same logic works for `super` delegation calls.

- It could be just enough to substitute all candidates before resolve
  but diagnostic messages looks more correct when substitution is
  performed within CandidateResolver.performResolutionForCandidateCall
  because it works the same way as when resolving A<T1, ..>().

 #KT-6992 Fixed
 #KT-6993 Fixed
 #KT-6994 Fixed
2015-03-17 23:18:35 +03:00
Denis Zharkov 52ba8333dc Refactor delegation call resolution
- Move resolution logic from BodyResolver to CallResolver
- Call resolveConstructorDelegationCall explicitly without resolveFunctionCall
- Drop dead condition and unused method
2015-03-17 23:18:35 +03:00
Denis Zharkov 9cecd69a9e Drop unneeded condition that leads to error
This check is obsolete but leads to problems.

It appears when resolving recursive calls (see sameTypeParameterUse.kt):

`foo<R>(x: R, y: R)` within call `foo<R>(x, "")` after substitution
has R as type of it's second argument, and when checking value arguments,
x is not checked because supposed to be dependent on type parameter of candidate
(that is effectively false), so there are two successful candidates
in resolution results and wrong OVERLOAD_RESOLUTION_AMBIGUITY error.
2015-03-17 23:18:34 +03:00
Denis Zharkov 682f8a3110 Use original constructor descriptor when searching cycles 2015-03-17 23:18:34 +03:00
Denis Zharkov 6c46606f2b Fix constructors redeclaration message
#KT-6966 Fixed
2015-03-17 23:18:34 +03:00
Denis Zharkov 9e5192e0e3 Prohibit val/vars/modifiers on secondary constructor parameter
#KT-6962 Fixed
2015-03-17 23:18:33 +03:00
Pavel V. Talanov dfa8fbcb0d default -> companion: Replace missed default in error message 2015-03-17 18:26:59 +03:00
Pavel V. Talanov a50b218c6a default -> companion: Replace some missed usages of "isDefault" 2015-03-17 17:10:53 +03:00
Pavel V. Talanov 94937a39be Increase ABI and stub versions 2015-03-17 15:52:41 +03:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +03:00
Pavel V. Talanov 2a6facaef6 default -> companion: default object -> class object in project code, builtins and libs code 2015-03-17 15:46:48 +03:00
Nikolay Krasko 8c5109d819 Generate descriptor for trait constructor. Exception is thrown otherwise...
EA-38416, EA-65189, EA-60850
2015-03-16 20:16:25 +03:00
Michael Bogdanov 41e4b1ce9b Set proper call element 2015-03-16 18:52:00 +03:00
Evgeny Gerashchenko 5a262b976e Fixed overridden/implemented line markers in abstract classes. 2015-03-16 14:11:42 +03:00
Evgeny Gerashchenko 510974e07c Supported renaming default objects with default names. 2015-03-16 14:11:41 +03:00
Alexey Sedunov 9cb42944d1 Extraction Engine: Generate function/property accessor with expression body (whenever applicable)
#KT-6405 Fixed
2015-03-13 23:16:57 +03:00
Pavel V. Talanov c0a031eafe Support secondary constructors in decompiled text
Build cls stubs for secondary constructors
2015-03-13 20:17:32 +03:00
Pavel V. Talanov fd718ad366 JetConstructorDelegationCall should not be stubbed 2015-03-13 20:17:07 +03:00
Alexander Udalov e5d5b49ce2 Fix exception from ::class literals on unresolved classes 2015-03-12 23:14:55 +03:00
Stanislav Erokhin 2627dc76c2 Compilation fix. 2015-03-12 17:11:54 +03:00
Stanislav Erokhin 8accdcc5cb Fix type inference for function expression parameters 2015-03-12 17:11:53 +03:00
Stanislav Erokhin af4aff38e5 Minor: remove duplicate code 2015-03-12 17:11:53 +03:00
Stanislav Erokhin f47f285868 Expected function type used for parameter types inference in function expression 2015-03-12 17:11:53 +03:00
Stanislav Erokhin 639003b8a8 Allowed function parameter without type declaration in the parser 2015-03-12 17:11:52 +03:00
Stanislav Erokhin d9882a6d0b Move inference parameter type in FunctionDescriptorResolver 2015-03-12 17:11:52 +03:00
Stanislav Erokhin 0c74675e6e Changed element parameter for EXPECTED_PARAMETERS_NUMBER_MISMATCH diagnostic 2015-03-12 17:11:52 +03:00
Stanislav Erokhin 072a9f4977 Refactoring: extract FunctionResolver from DescriptorResolver 2015-03-12 17:11:51 +03:00
Stanislav Erokhin 8ed3314b2c Divided resolveFunctionDescriptor method in to several pieces 2015-03-12 17:11:51 +03:00
Stanislav Erokhin 07a691f4b7 Merge methods resolveFunctionDescriptor && resolveFunctionDescriptorWithAnnotationArguments 2015-03-12 17:11:50 +03:00
Stanislav Erokhin dbcb4fb060 Minor: used util method 2015-03-12 17:11:50 +03:00
Stanislav Erokhin 4050e7a48b Rename ClosureExpressionsTypingVisitor to FunctionsTypingVisitor. 2015-03-12 17:11:50 +03:00
Stanislav Erokhin 711c5bb88f Rename ClosureExpressionsTypingVisitor.java -> .kt 2015-03-12 17:11:49 +03:00
Stanislav Erokhin 779c6deb34 Convert ClosureExpressionsTypingVisitor to kotlin 2015-03-12 17:11:49 +03:00
Stanislav Erokhin ee4892c99f Moved method visitNamedFunction from BasicExpressionTypingVisitor to ClosureExpressionsTypingVisitor. 2015-03-12 17:11:48 +03:00
Stanislav Erokhin bd525eac31 Moved method visitObjectLiteralExpression from ClosureExpressionsTypingVisitor to BasicExpressionTypingVisitor. 2015-03-12 17:11:48 +03:00
Stanislav Erokhin 6fb8af1dda Move util backend function isNamedFun && isNamedFunOrLambda to frontend 2015-03-12 17:11:47 +03:00
Stanislav Erokhin 929f1bc9ba Fixed method hasTypeParameterListBeforeFunctionName in JetNamedFunction 2015-03-12 17:11:47 +03:00
Stanislav Erokhin 44895a23cf Frontend support for function as expression 2015-03-12 17:11:46 +03:00
Stanislav Erokhin 6ccd8ab764 Move method visitNamedFunction from ExpressionTypingVisitorForStatements to BasicExpressionTypingVisitor.
This commit done only for clean history
2015-03-12 17:11:45 +03:00
Stanislav Erokhin a235110d44 Fixed function expression recovery 2015-03-12 17:11:45 +03:00
Stanislav Erokhin 983e1bc932 Added function as expression support to parser 2015-03-12 17:11:44 +03:00