Commit Graph

1320 Commits

Author SHA1 Message Date
Mikhail Glukhikh 39e01f4df2 Tests for KT-3899. Passes already in M11 or even earlier 2015-04-07 19:03:27 +03:00
Mikhail Glukhikh f49c79f4f0 Tests for KT-3224 and KT-3244. Both pass already in M11 or even earlier 2015-04-07 19:03:24 +03:00
Nikolay Krasko 2946c1d6a8 KT-7271 Accessing an extension property of Char.Companion leads to ClassNotFoundException in runtime
#KT-7271 Fixed
2015-04-07 15:59:05 +03:00
Mikhail Glukhikh 88441814b9 Test for KT-5502 (works after KT-4450 / KT-5907 fix) 2015-04-06 18:32:19 +03:00
Mikhail Glukhikh d92ccad35d Implementation and tests for KT-5840 and newly created KT-7204. Now a safe call provides not-null receiver state *inside* argument list. It works also for ?. chains. #KT-5840 Fixed.
On the other hand, argument states do not propagate to successor statements for a safe call. #KT-7204 Fixed. A few additional comments.
2015-04-06 18:29:52 +03:00
Dmitry Jemerov 252c4118eb report 'break' and 'continue' inside 'when' as errors (even if 'when' is nested in a loop) 2015-04-05 00:33:14 +03:00
Alexander Udalov 4474005183 Fix codegen tests and overloads diagnostic test 2015-04-03 01:38:31 +03:00
Dmitry Jemerov 7b507276ed frontend diagnostics for kotlin.jvm.overloads
#KT-7203 Fixed
2015-04-02 20:30:36 +02:00
Dmitry Jemerov 39828bfd32 Implement kotlin.jvm.overloads annotation for generating all overloads of a method that has default parameter values.
#KT-2095 Fixed

fix backend-side issues with kotlin.jvm.overloads: support the annotation on constructors, generate nullablity annotations on parameters, generate generic signatures, add various tests
2015-04-02 20:30:26 +02:00
Ilya Ryzhenkov 2f02024c24 checkLValue for array indexing expression should resolve set method #KT-7218 Fixed 2015-04-01 21:02:05 +03:00
Pavel V. Talanov a986d913c3 Remove traces of class object constraints feature from parser, frontend, tests and psi 2015-04-01 20:09:34 +03:00
Svetlana Isakova 61d0bcdf76 KT-7068 None of the following functions can be called with two functions with extention function parameter
#KT-7068 Fixed
2015-04-01 11:57:15 +03:00
Denis Zharkov 99f1ab333e Report illegal modifiers and annotations on primary constructor
#KT-7057 Fixed
 #KT-6772 Fixed
2015-03-31 20:20:22 +03:00
Mikhail Glukhikh 620b7954ac Tests for already working KT-3993 and KT-5427. These test cases pass at least since M11 2015-03-31 17:15:46 +03:00
Mikhail Glukhikh 9c1551bca9 Implementation of smart casts for public / protected immutable properties that are not open and used in the same module.
DataFlowValueFactory and its environment refactoring: containing declaration is added into factory functions
as an argument and used to determine identifier stability. A few minor fixes. #KT-5907 Fixed. #KT-4450 Fixed. #KT-4409 Fixed.

New tests for KT-4409, KT-4450, KT-5907 (public and protected value properties used from the same module or not,
open properties, variable properties, delegated properties, properties with non-default getter).
Public val test and KT-362 test changed accordingly.
2015-03-31 16:19:03 +03:00
Denis Zharkov 418034add3 Prohibit instance access before super call
- Before this change members just left unresolved as they were absent in the
  specific scope named scopeForSecondaryConstructorHeaderResolution that
  created just to prohibit such accesses.
- Now they are resolved the same way as other members, but diagnostic is
  repored by in-place injected CallChecker
- Drop obsolete type of class scope

 #KT-6995 Fixed
2015-03-27 20:15:00 +03:00
Denis Zharkov d0c72c2c3d Mark value arguments in case of empty delegation call
It's useful for quickfixes for these diagnostics
2015-03-27 16:09:41 +03:00
Denis Zharkov 023e1a13a9 Do not try to detect cycles if delegation call resolution is unsuccessful 2015-03-27 16:09:41 +03:00
Denis Zharkov 7aa2642a2b Unify reporting resolution errors for empty delegation calls
- Always report "There is no applicable constructor for call without arguments in superclass"
  under `constructor` keyword by replacing default TracingStrategy
- Remove positioning strategy used for reporting non-applicable
  for empty delegation calls

 #KT-6971 Fixed
2015-03-27 16:09:41 +03:00
Denis Zharkov 683bc4709f Add test case: 'platformStatic' on constructors 2015-03-27 16:09:41 +03:00
Denis Zharkov ce3bf423ad Prohibit 'native' annotation on constructors
Currently doesn't work for primary ones

 #KT-7000 Fixed
2015-03-27 16:09:41 +03:00
Denis Zharkov 29b03e8175 Report illegal modifiers on secondary constructors 2015-03-27 16:09:41 +03:00
Denis Zharkov 66023e6f31 Prohibit platformName on secondary constructor
#KT-6999 Fixed
2015-03-27 16:09:41 +03:00
Denis Zharkov 8aa4e9bd94 Report error for inappropriate modifiers usages 2015-03-27 16:09:40 +03:00
Denis Zharkov 01e5ee718f Allow secondary constructors without body
#KT-6967 Fixed
2015-03-27 16:09:40 +03:00
Alexey Tsvetkov 5ff5cea17a JS: report error when js() produces empty AST 2015-03-23 16:43:49 +03:00
Alexey Tsvetkov b5797eb15b JS: added tests for recursion cycle in inline functions 2015-03-23 16:43:48 +03:00
Zalim Bashorov d569ea5974 JS frontend: added diagnostic about secondary constructors not supported yet. 2015-03-23 13:52:56 +03:00
Zalim Bashorov 1b530887cd Minor: fix testdata 2015-03-20 21:23:31 +03:00
Zalim Bashorov aaa7f6d5e4 JS frontend: added diagnostic about non-toplevel classifiers are unsupported yet. 2015-03-20 21:23:31 +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 43e24f6b0d Fixed test data for new lambda syntax 2015-03-18 16:06:44 +03:00
Stanislav Erokhin 371908a280 Temporary added DEPRECATED_LAMBDA_SYNTAX to tests.
It will be fixed soon.
2015-03-18 16:06:44 +03:00
Stanislav Erokhin 47e8b1e77c Create warning for old lambda syntax. 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
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 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 9e5192e0e3 Prohibit val/vars/modifiers on secondary constructor parameter
#KT-6962 Fixed
2015-03-17 23:18:33 +03:00
Pavel V. Talanov 06916d98c6 default -> companion: replace all mentions of default and default object 2015-03-17 15:47:39 +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
Alexander Udalov e5d5b49ce2 Fix exception from ::class literals on unresolved classes 2015-03-12 23:14:55 +03:00
Stanislav Erokhin 8accdcc5cb Fix type inference for function expression parameters 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 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 560c32c0f1 Added diagnostic error when in function declaration name was omitted 2015-03-12 17:11:44 +03:00
Stanislav Erokhin a33450395c Resolve parenthesized element as expression 2015-03-12 17:11:43 +03:00
Stanislav Erokhin 3b92cab9e0 Changed containing declaration for PropertyDeclarationInnerScope 2015-03-12 17:11:43 +03:00