Commit Graph

5528 Commits

Author SHA1 Message Date
Mikhail Glukhikh 6e2395471d Sealed code generation: sealed is considered abstract, correct serialization
A pair of tests provided.
2015-06-25 19:07:23 +03:00
Mikhail Glukhikh 4517e15299 Minor refactoring of resolveDelegationSpecifierList 2015-06-25 19:07:18 +03:00
Mikhail Glukhikh f6872dfbea Exhaustive when support for sealed classes #KT-7606 Fixed
When on sealed can use is (both for derived classes and objects) or just comparison (only for derived objects).
A pack of tests provided.
2015-06-25 19:07:16 +03:00
Mikhail Glukhikh 8d25c20169 Introduction of sealed classes
Sealed classes can be derived only by their own inner classes or objects.
Their constructors cannot be called explicitly, so compiler knows all their descendants.
Incompatible modifier checks (final, abstract). Impossible with interface, object, enum.
A pack of tests provided.
2015-06-25 19:07:13 +03:00
Alexander Udalov 0593b833b5 Check extension receiver properly for property references
Without this, the unrelated type specified on the LHS of a property reference
literal was considered to be an extension receiver of the candidate, and the
resolution was erroneously successul. This is only reproducible for properties,
because if we're trying to resolve an extension, we consider all properties
from the scope, even non-extensions, because there may be a property of an
extension-functional type (T.() -> R). (We don't do this for functions.)

 #KT-7430 Fixed
 #KT-7945 Fixed
2015-06-23 23:35:17 +03:00
Nikolay Krasko 8013cbe4ef Fix forEach method in TrackingSlicedMap 2015-06-23 16:00:40 +03:00
Pavel V. Talanov f454b7d15e AnalyzerFacade: resolvers for modules are created lazily 2015-06-23 15:19:31 +03:00
Pavel V. Talanov 96199ecc1f Refactor AnalyzerFacade: move module.initialize() outside of createResolverForModule() 2015-06-23 15:19:22 +03:00
Pavel V. Talanov 997a6f1381 Fix import resolution for some cases of malformed imports ("import some.")
Fix parsing import directives in case of non-identifier after "import"
Add diagnostics test for malformed imports
2015-06-23 15:19:14 +03:00
Pavel V. Talanov 37bcd455b5 Make ModuleDescriptor#getPackage() return not null lazy object with lazy scope
Refactor: no need to create package view in order to obtain its subpackages
LazyPackageViewDescriptorImpl to replace PackageViewDescriptorImpl
This allows to avoid computations when package views are requested but their contents not necessarily queried
For example: DescriptorResolver.resolvePackageHeader()
2015-06-23 15:19:06 +03:00
Pavel V. Talanov 1cf38e4799 Convert PackageViewDescriptor to Kotlin 2015-06-23 15:18:57 +03:00
Pavel V. Talanov c5e6dea8b0 Minor: Inline and remove JetModuleUtil 2015-06-23 14:15:17 +03:00
Pavel V. Talanov ade898775c Minor: remove unused parameter 2015-06-23 14:14:35 +03:00
Pavel V. Talanov 257b8f31e7 Change import resolution algorithm
The new algorithm: move from right to left, trying to find package, (new code) when found go right resolving descriptors (uses old code)
This allows to avoid unnecessary computations (matters in IDE moslty) for resolving root packages
This changes semantics of imports resolution: when package clashes with any declaration package is preffered
2015-06-23 14:14:25 +03:00
Alexey Sedunov 3266d8c29a Parser: Disable joining complex tokens while parsing type references
#KT-8141 Fixed
2015-06-19 21:45:13 +03:00
Mikhail Glukhikh 065db07e1c More accurate check on an enum entry deprecated super constructor #EA-69735 Fixed 2015-06-19 13:50:49 +03:00
dnpetrov 046189087a KT-5963 Call to super shouldn't require type specification if there is no conflict
Implemented unqualified 'super' type resolution (in BasicExpressionTypingVisitor).

No overload resolution of any kind is involved.
Corresponding supertype is determined by the expected member name only:
- 'super.foo(...)' - function or property (of possibly callable type) 'foo'
- 'super.x' - property 'x'
Supertype should provide a non-abstract implementation of such member.
As a fall-back solution for diagnostics purposes, consider supertypes with abstract implementation of such member.

Diagnostics:
- AMBIGUOUS_SUPER on 'super', if multiple possible supertypes are available;
- ABSTRACT_SUPER_CALL on selector expression, if the only available implementation is abstract.

#KT-5963 Fixed
2015-06-18 14:16:34 +03:00
Alexander Udalov 1a3209e1dc Drop traits with required classes
#KT-4771 Rejected
2015-06-17 16:23:58 +03:00
Mikhail Glukhikh 707307b19c Fix for a cyclic generic upper bound for a class type parameter. A pair of tests. 2015-06-17 11:56:28 +03:00
Alexey Sedunov 62f9672461 Rename: Fix field identifier replacement #KT-8018 Fixed 2015-06-16 21:15:40 +03:00
Alexey Sedunov dda271d38d Delete/Move: Delete entire file when deleting top-level class or object and no other top-level declarations are present. Ask the user confirmation if deletion if caused by the Move refactoring
#KT-8033 Fixed
2015-06-16 21:15:38 +03:00
Alexey Sedunov f08c7d0fd8 Call Resolver: Fix nullability of parenthesized safe calls used as value arguments
#KT-7903 Fixed
2015-06-16 21:15:29 +03:00
Dmitry Jemerov ed7cc67f19 thread-safe usage of performance counters list
#KT-8046 Fixed
2015-06-16 16:45:51 +02:00
Valentin Kipyatkov efdfa4b247 Minor changes after review 2015-06-15 18:27:25 +03:00
Valentin Kipyatkov 1dbd342938 Minor 2015-06-15 18:27:25 +03:00
Valentin Kipyatkov 95baf9b884 Minor 2015-06-15 18:27:25 +03:00
Valentin Kipyatkov 2248abd93a Inlined method 2015-06-15 18:27:24 +03:00
Valentin Kipyatkov b20179af9f WritableScope: got rid of mutability of implicit receiver 2015-06-15 18:27:24 +03:00
Valentin Kipyatkov 32bfd53101 Renames 2015-06-15 18:27:24 +03:00
Valentin Kipyatkov 9139a8f060 WritableScope: removed addLabeledDeclarations 2015-06-15 18:27:24 +03:00
Valentin Kipyatkov 89c2aca3a8 Memory optimization 2015-06-15 18:27:23 +03:00
Valentin Kipyatkov b301b22f47 KT-4822 Wrong scope is used for local variable name completion
#KT-4822 Fixed
2015-06-15 18:27:23 +03:00
Valentin Kipyatkov 14ddc9d972 Memory optimization 2015-06-15 18:27:23 +03:00
Valentin Kipyatkov f38267e21d One more simplification 2015-06-15 18:27:23 +03:00
Valentin Kipyatkov 99001f0fe2 More correct and simple 2015-06-15 18:27:23 +03:00
Valentin Kipyatkov 2ab86192c3 One more simplification 2015-06-15 18:27:23 +03:00
Valentin Kipyatkov 060aeb60e1 Minor optimization 2015-06-15 18:27:23 +03:00
Valentin Kipyatkov db0f212b3e More code simplifications 2015-06-15 18:27:22 +03:00
Valentin Kipyatkov 472841de16 Inlined method 2015-06-15 18:27:22 +03:00
Valentin Kipyatkov f88d603f5c Removed unused code in WritableScopeImpl 2015-06-15 18:27:22 +03:00
Valentin Kipyatkov 483da9607c KT-4893 Code completion should not show multiple functions with the same signature
#KT-4893 Fixed
2015-06-15 18:27:21 +03:00
Alexander Udalov 3a6ba67602 Delete unused diagnostic about j.l.Class in annotations 2015-06-15 15:55:23 +03:00
Alexander Udalov 54dfd626ab CLI: improve diagnostic message format
- render the whole line where the error/warning points to, if any, and another
  line with '^', like other compilers do
- lowercase diagnostic severity
- decapitalize the message if it doesn't start with a proper name
2015-06-15 15:42:41 +03:00
Mikhail Glukhikh e623aadf00 Exception fix: more accurate parsing of class base type #EA-65509 Fixed 2015-06-15 14:43:37 +03:00
Mikhail Glukhikh d77c6eb30e Exception fix: diagnose an error for a generic type which is a subtype of itself, a set of tests #EA-64453 Fixed 2015-06-15 14:43:24 +03:00
Pavel V. Talanov 846c0e2522 AnalyzerFacade: compute module dependencies lazily 2015-06-13 20:36:50 +03:00
Pavel V. Talanov 705f35450f Refactor setting dependencies for ModuleDescriptors 2015-06-13 20:36:47 +03:00
Pavel V. Talanov 1d696c2e54 Do not force evaluation of parent package in ResolveSession#createPackage 2015-06-13 20:36:44 +03:00
Denis Zharkov e3c3af6aab Change MISSING_CONSTRUCTOR_KEYWORD severity to error
And adjust testData
2015-06-12 11:23:13 +03:00
Denis Zharkov eb7114bd53 Add 'constructor' keyword in whole project where needed 2015-06-12 09:55:15 +03:00