Dmitry Petrov
d3721872b2
Tests for type alias diagnostics: type parameter bound violation in type alias constructor
2016-06-09 10:27:51 +03:00
Dmitry Petrov
b552425558
Tests for type alias diagnostics: type projections in type alias constructor
...
(should report same errors as for classes)
2016-06-09 10:27:51 +03:00
Dmitry Petrov
d86be43171
Tests for type alias diagnostics: wrong number of type arguments in type alias constructor
2016-06-09 10:27:51 +03:00
Dmitry Petrov
b2e5cfebee
Diagnostics for type alias expansion errors in type alias RHS
2016-06-09 10:27:50 +03:00
Denis Zharkov
759cb83dfb
Add checks that coroutines are available at the given language level
2016-06-08 18:53:16 +03:00
Denis Zharkov
b8d4d39f4d
Add custom applicability checks for suspend/coroutine modifiers
2016-06-08 18:53:16 +03:00
Denis Zharkov
d760a2ec3b
Add CallChecker prohibiting non-local suspension calls
...
Effectively suspension point is local <=> return to relevant lambda is allowed in place
2016-06-08 18:53:16 +03:00
Denis Zharkov
75e112e752
Implement basic support for coroutines in JVM backend
2016-06-08 18:53:16 +03:00
Denis Zharkov
1af9321c20
Revert "'async' reserved in front of function literals"
...
This reverts commit 6155d836a5 .
2016-06-08 18:53:16 +03:00
Denis Zharkov
7d3333e86e
Revert "Reserve "async* {}", extend the quick-fix"
...
This reverts commit a7e7d53e2b .
2016-06-08 18:53:16 +03:00
Denis Zharkov
372791eb15
Replace common extension receiver of coroutine-lambda with magic one
...
Currently it only contains additional synthetic declarations for suspend-functions
E.g. `fun <V> await(f: CompletableFuture<V>): V` for `fun <V> await(f: CompletableFuture<V>, machine: Continuation<V>): Unit`
2016-06-08 18:53:16 +03:00
Denis Zharkov
8f4ee0528e
Implement operator checks for controller's handleResult
2016-06-08 18:53:16 +03:00
Denis Zharkov
fcbff72f6f
Replace expected type for coroutine-lambda
...
Use 'handleResult' method of controller to determine what lambda should return
If original declaration was
fun builder(coroutine c: Controller.() -> Continuation<Unit>) = 1
and there is 'fun handleResult(x: X, c: Continuation<Nothing>)',
then expected type for lambda is 'Controller.() -> X'
2016-06-08 18:53:16 +03:00
Dmitry Petrov
9c74f27967
Type alias can't expand to 'dynamic'
2016-06-08 15:55:52 +03:00
Dmitry Petrov
ef4c3bdae8
Don't expand types that don't contain type aliases or type parameters.
2016-06-08 15:55:52 +03:00
Dmitry Petrov
cb08d976d3
Tests for importing type aliases
2016-06-08 15:55:52 +03:00
Mikhail Glukhikh
4b6b35dadf
Type parameter is considered capable of taking any value for the purpose of cast possibility check #KT-6611 Fixed
2016-06-08 15:25:34 +03:00
Alexander Udalov
526a64dc36
Pass data flow info from '::' expressions, fix expected type
2016-06-07 12:43:07 +03:00
Alexander Udalov
e2d6e0cbab
Propagate control flow to bound double colon expressions
...
"Unused expression" should be reported on unused double colon expressions, this
is postponed
#KT-12551 Open
2016-06-07 12:42:42 +03:00
Alexander Udalov
0ce6bd9999
Ignore resolution to function without arguments on LHS of '::'
...
In the expression "Runnable::run" we were resolving the left-hand side to the
SAM constructor of Runnable. Now we detect this situation, ignore the result of
such resolution, and continue resolving the LHS as a type
2016-06-07 12:42:19 +03:00
Alexander Udalov
04c190231a
Support bound references to objects and companion objects
...
Tweak member extension detection a little bit to prohibit extensions imported
from objects (they don't have one of the receiver parameters)
2016-06-07 12:41:30 +03:00
Alexander Udalov
d90b40c661
Use LanguageFeatureSettings instead of custom option for bound callable references
2016-06-07 12:41:29 +03:00
Dmitry Petrov
872b3e8a52
DeclarationsChecker runs checks on type alias declarations.
...
TYPEALIAS_SHOULD_EXPAND_TO_CLASS diagnostics
(implemented for type aliases expanded to type parameters).
2016-06-06 13:50:37 +03:00
Dmitry Petrov
ea249244c5
'where' clause in type alias declaration is a syntax error
...
(type alias parameters can't have bounds)
2016-06-06 13:50:37 +03:00
Dmitry Petrov
772fe5badb
Treat unsupported or malformed type alias as a type alias with error types.
2016-06-03 16:07:20 +03:00
Dmitry Petrov
3500f5a96b
Type alias: resolve type alias RHS during force-resolve.
2016-06-03 16:07:20 +03:00
Dmitry Petrov
df335b9e8d
Type aliases: do not reparse RHS of type alias declaration in expanded type resolution
2016-06-03 16:07:20 +03:00
Mikhail Glukhikh
a22e7d3bcf
KT-12152 : leaking this inspection: accessing non-final member / this in non-final class
2016-06-03 14:45:58 +03:00
Mikhail Glukhikh
be40cf8138
KT-12152 : constructor consistency: distinguish properties with and w/o backing fields, with default / custom accessors
2016-06-03 09:45:49 +03:00
Mikhail Glukhikh
422ea4c6cb
KT-12152 : constructor consistency: handle open property accessing
2016-06-03 09:45:45 +03:00
Mikhail Glukhikh
f7b5d67543
KT-12152 : constructor consistency: handle non-final classes
2016-06-03 09:45:41 +03:00
Mikhail Glukhikh
8e18165065
KT-12152 : constructor consistency analysis, base cases
2016-06-03 09:45:37 +03:00
Alexander Udalov
1339286261
Drop undocumented absolute name specification feature with 'package.'
2016-06-01 19:30:03 +03:00
Dmitry Petrov
0319d5a5aa
KT-11588 Type aliases
...
- Nested type aliases
- UNSUPPORTED_TYPEALIAS error (language level < 1.1)
- tests for is/as/as? with type alias
2016-06-01 14:32:46 +03:00
Dmitry Petrov
e979300579
KT-11588 Type aliases
...
Diagnostics for type arguments substitution in type alias expansion
(initial implementation; TODO: refactor).
2016-06-01 14:32:46 +03:00
Dmitry Petrov
9cf8ef287e
KT-11588 Type aliases
...
Additional tests for generic type alias arguments.
Small refactoring in TowerLevels.
2016-06-01 14:32:45 +03:00
Dmitry Petrov
62f8d00f89
KT-11588 Type aliases
...
Create substituted constructor descriptors for generic type aliases.
2016-06-01 14:32:45 +03:00
Dmitry Petrov
c63166047c
KT-11588 Type aliases
...
Additional tests for type alias constructor & companion object:
- codegen
- error diagnostics
2016-06-01 14:32:45 +03:00
Dmitry Petrov
1329a43d89
KT-11588 Type aliases
...
Type alias constructor
2016-06-01 14:32:44 +03:00
Dmitry Petrov
4a9507b3ab
KT-11588 Type aliases
...
Type alias companion object
2016-06-01 14:32:44 +03:00
Mikhael Bogdanov
bdc0b6b308
Local delegated properties moved to language feature option
2016-05-31 15:27:55 +03:00
Alexander Udalov
e1a21abd72
Report error on bare types in LHS of callable reference expressions
2016-05-26 22:22:41 +03:00
Alexander Udalov
a3b38cf6ed
Extract method to fully or partially resolve callable reference
...
Reuse it in the main type-checking path in DoubleColonExpressionResolver, as
well as in ArgumentTypeResolver which handles the case when a callable
reference appears as an argument to another call
2016-05-26 22:22:41 +03:00
Alexander Udalov
693c753988
Support for new double colon expressions in type checker
...
Despite the fact that the LHS of a double colon expression is now KtExpression
instead of KtUserType, we must still consider it a type for callable references
to work. Extract and reuse relevant parts of QualifiedExpressionResolver and
TypeResolver to support this behavior
2016-05-26 22:22:41 +03:00
Alexander Udalov
7cb61b81ab
Minor, capitalize language feature names in tests
...
To simplify textual search across the codebase
2016-05-26 22:21:22 +03:00
Alexander Udalov
331a6ee414
Use LanguageFeatureSettings instead of JVM option for top level sealed classes
2016-05-26 22:15:39 +03:00
Alexander Udalov
98c3e030a1
Support enabling/disabling language features in diagnostic tests
2016-05-26 22:15:39 +03:00
Mikhail Glukhikh
9a69b8b7b5
REDUNDANT_OPEN_FOR_INTERFACE warning: reported for open members without implementation #KT-12452 Fixed
2016-05-24 14:25:27 +03:00
Mikhail Glukhikh
e66acd8101
Default modality is abstract for interface. REDUNDANT_MODIFIER_FOR_TARGET applicability reduced #KT-12302 Fixed
2016-05-24 14:25:22 +03:00
Mikhail Glukhikh
93defed324
KT-12302: ABSTRACT_MODIFIER_IN_INTERFACE warning is removed as obsolete
2016-05-24 14:25:18 +03:00