Commit Graph

2418 Commits

Author SHA1 Message Date
Alexander Udalov 0e881daba3 Update diagnostic tests ReadMe, explain tests with diagnostic arguments 2016-06-19 12:45:22 +03:00
Alexander Udalov 456ba79793 Consider callable reference's LHS when resolving RHS
Previous resolution sequence (static scope, nested classes scope, receiver) and
a check against type parameters only made sense when there's a type, not an
expression, on the LHS of a callable reference. Also TransientReceiver is
incorrect in such case because private-to-this visibility check only works for
ExpressionReceiver values
2016-06-19 12:45:22 +03:00
Mikhail Glukhikh 5ccbf47531 Elvis / if / when now infer error type in case of ErrorType + Nothing #KT-6665 Fixed
(cherry picked from commit 9a50a0b)
2016-06-17 16:43:24 +03:00
Mikhail Glukhikh 49fb9ff424 Sealed class hierarchies are now correctly processed in when (by checking possible smart casts to nested sealed classes) #KT-10648 Fixed
(cherry picked from commit 2eaaf9c)
2016-06-17 15:22:15 +03:00
Stanislav Erokhin 01430b4b99 Create hack for exception about "Empty intersection for types".
Hackaround for KT-11266, EA-79963, EA-72093,  EA-79976.
2016-06-17 01:39:44 +03:00
Alexander Udalov af9883bccf Add test on accidental redeclaration of final members from java.lang.Enum
This is working because of the additional built-ins members added in 1.1
2016-06-16 16:51:18 +03:00
Alexander Udalov 79ecc9751b Report error on accidentally "overriding" wait/notify
Hard-code only Object members because diagnostics are reported for all other
classes out of the box in 1.1

 #KT-7174 Fixed
2016-06-16 16:51:18 +03:00
Stanislav Erokhin 585dcbf1f3 KT-10717 Type inference for lambda with local return
#KT-10717 Fixed
2016-06-10 21:28:05 +03:00
Dmitry Petrov c414f456a4 Like nested classes, it is not possible to reference inherited nested type alias by a child class. 2016-06-10 16:21:27 +03:00
Dmitry Petrov 7b6c1c092c Inherited type alias capturing type parameters of generic base class:
doesn't work partially due to KT-11123.
2016-06-10 16:21:27 +03:00
Dmitry Petrov bee1762b0e 'Nothing' as function return type and property type can't be abbreviated. 2016-06-10 16:21:27 +03:00
Dmitry Petrov 0ff677596f Modifiers checking for type aliases.
Exposed type checking for type aliases.
2016-06-10 16:21:26 +03:00
Dmitry Petrov 139e219ebd Star projections in type alias expansions are substituted to star projections
for corresponding type parameters in expanded type.
Test that type alias arguments are substituted literally,
and no type approximation is performed on substitution.
2016-06-10 16:21:26 +03:00
Dmitry Petrov 1efbd34529 Test: arguments of type aliases should be substituted literally,
without type approximation.
TYPE_MISMATCH is an expected error.
2016-06-10 16:21:26 +03:00
Dmitry Petrov 7da50069eb Additional tests for illegal type in type alias expansion:
'Array<Nothing>' passed as an unused parameter to type alias.
2016-06-10 16:21:26 +03:00
Dmitry Petrov 115f40d371 UNUSED_TYPEALIAS_PARAMETER: special diagnostic for typealias parameters
explicitly telling that such type parameters are not used in type checking.
Move typealias-related utility functions on types to TypeUtils.kt.
2016-06-10 16:21:25 +03:00
Dmitry Petrov 40dd36bcf6 Recursive type alias expansion:
when resolving abbreviated type, do not check bounds
if the resulting type contains type aliases.
2016-06-10 16:21:25 +03:00
Dmitry Petrov c04b16d6cc Type parameters for type alias constructor are declared type parameters for type alias
(no implicit type parameters from containing scopes).
2016-06-10 10:25:09 +03:00
Dmitry Petrov bcd1df4efe More tests for type alias constructor type parameters. 2016-06-10 10:25:09 +03:00
Dmitry Petrov 6924ed53ec Local type aliases: resolve 2016-06-10 10:25:09 +03:00
Dmitry Petrov 9a7bbc1516 Type alias shouldn't expand to a malformed type (e.g., 'Array<Nothing>'). 2016-06-10 10:25:09 +03:00
Dmitry Petrov d02785806d Type alias shouldn't capture type parameters of inaccessible outer classes. 2016-06-10 10:25:09 +03:00
Dmitry Petrov 12710bec2f Redeclaration errors for type aliases: type alias vs function. 2016-06-10 10:25:08 +03:00
Dmitry Petrov 5ad4c8b9c7 Redeclaration errors for type aliases: type alias vs property. 2016-06-10 10:25:08 +03:00
Denis Zharkov 92bd6880da Add AdditionalBuiltInsMembers language feature and relevant checks 2016-06-09 17:57:15 +03:00
Stanislav Erokhin cd4c9968df Minor. fix test 2016-06-09 16:42:42 +03:00
Stanislav Erokhin 53bf720503 Fix type alias problems after rebase. 2016-06-09 16:42:41 +03:00
Stanislav Erokhin 93b27417af Minor. update testdata. 2016-06-09 12:59:06 +03:00
Stanislav Erokhin 541b9954f5 Minor. Roll back behaviour for FlexibleType.isError. 2016-06-09 12:58:23 +03:00
Stanislav Erokhin 8c2ad82de7 Minor. fixes after review 2016-06-09 12:58:07 +03:00
Stanislav Erokhin 203c4cd94d Remake Raw type representation.
(cherry picked from commit b21cede)
2016-06-09 12:57:53 +03:00
Dmitry Petrov 44829a61e7 Report redeclaration errors for type aliases vs class/interface/object. 2016-06-09 10:27:51 +03:00
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