Commit Graph

206 Commits

Author SHA1 Message Date
Dmitry Neverov cd24adac32 Detect redundant 'is' check
#KT-14187 Fixed
2017-05-15 11:24:35 +03:00
Mikhail Zarechenskiy 32f609ceee Check lambda parameter for name shadowing
#KT-5160 Fixed
2017-04-17 17:12:44 +03:00
Mikhail Zarechenskiy 682fe9e9ca Don't forget to resolve annotations from constructor parameter
#KT-12245 Fixed
2017-04-10 12:48:10 +03:00
Mikhail Glukhikh 7a53b2f4c8 Introduce UNUSED_ANONYMOUS_PARAMETER for anonymous functions
It is not reported for 1.0 language version because
renaming to _ is not possible. It has weak warning severity

So #KT-8813 Fixed
So #KT-16875 Fixed
2017-04-04 14:23:30 +03:00
Dmitry Petrov 5ef27f7ad3 KT-15010 Missing error on an usage non-constant property in annotation default argument 2017-01-24 17:52:52 +03:00
Dmitry Petrov b9f9894310 KT-15677 KT-15775
Update parser & descriptor renderer to handle parenthesized types and function types properly.
Resolve annotations in parenthesized types.

AnnotationsImpl.isEmpty() returned false for targeted annotations only
(e.g., 'fun @receiver:Ann C?.foo()').
Properly keep track of targeted annotations.
2017-01-19 09:53:17 +03:00
Mikhail Glukhikh 5f3c1dfc41 More accurate check of repeated use-site annotations #KT-13859 Fixed 2016-12-28 19:01:20 +03:00
Dmitry Petrov cf4fb1eb25 Since '@A R.() -> T' is now parsed as '@A (R.() -> T)',
receiver type with modifiers or annotations should be surrounded in parentheses on rendering: '(@A R).() -> T'

This also fixes stub builder tests (which check that stubs are consistent with rendered descriptors).
2016-12-15 23:57:42 +03:00
Dmitry Petrov a15d423db4 Support modifiers on types in parser
(required for 'suspend' on functional types).

TYPE_REFERENCE element now has MODIFIER_LIST child, which hosts annotations and modifiers for the corresponding type reference.

Annotations and modifiers written before an extension function type are now parsed as annotations and modifiers for the functional type, not the receiver type.
So, '@Ann A.(B) -> C' was '(@Ann A).(B) -> C', and became '@Ann (A.(B) -> C)'.
NB: DSL_SCOPE_VIOLATION testData updated accordingly.

Type projection variance modifiers ('in', 'out') belong to a separate modifier list under corresponding type projection (not under a type reference).
'A<in suspend T>' is 'A<(in (suspend T))>', 'A<suspend in T>' is an error.

In stub builder, create a modifier list node to host annotations and modifiers (none so far; TODO properly serialize/deserialize types with modifiers).
2016-12-15 23:57:41 +03:00
Alexander Udalov eacf64e4db Report initializer block-related diagnostic on 'init' keyword 2016-11-22 18:19:01 +03:00
Denis Zharkov 4c69416f2b Report warning on unused entities that can be renamed to _
Currently it's all about lambda parameters/destructuring entries

 #KT-14347 In Progress
2016-10-24 10:19:25 +03:00
Ilya Chernikov 846797ff61 Switch to templates in the separate script runtime 2016-10-12 15:38:52 +02:00
Denis Zharkov 84153f9636 Add warning for ambiguous annotated expression syntax
#KT-14238 In Progress
2016-10-12 11:40:12 +03:00
Valentin Kipyatkov 31a4c6671e Fixed incorrect test 2016-10-11 23:38:55 +03:00
Valentin Kipyatkov ec51076355 DescriptorRenderer to render annotations for all types + separate option to render annotation arguments + use it in IdeDescriptorRenderers 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov 8baa9ba1de No parameter names in type of lambda expression and anonymous function 2016-10-11 23:38:54 +03:00
Valentin Kipyatkov 41ee06ec96 Use parameter names in DescriptorRenderer 2016-10-11 23:38:49 +03:00
Alexander Udalov 4eac12e350 Report warning when SinceKotlin value is greater than -api-version value
To prevent this diagnostic be reported in each test on SinceKotlin, disable it
when a diagnostic test contains the "!API_VERSION" directive
2016-10-11 17:46:14 +03:00
Alexander Udalov e3df8ed2fe Introduce SinceKotlin annotation, check validity of its value
#KT-14297 Fixed
2016-10-11 17:45:51 +03:00
Mikhail Glukhikh 8d48b0d2a0 UNUSED_VARIABLE is now reported only for last entry of destructuring declaration (if applicable) #KT-14221 Fixed 2016-10-10 14:42:09 +03:00
Mikhail Zarechenskiy 0ba2d374bc Create standard script definition from standard template
Now each script without specified template has a StandardSriptTemplate
class as a base one. This allows to generalize script codegen and
resolve.
2016-09-20 15:44:44 +03:00
Alexander Udalov 090d157f86 Update test data for data classes 2016-09-15 16:45:48 +03:00
Mikhail Glukhikh cffdce908e Annotation parameters now cannot be mutable #KT-12367 Fixed 2016-05-23 13:04:00 +03:00
Denis Zharkov d0acb3674a Fix rendered testData
New members in enum member scope
2016-05-16 15:38:13 +03:00
Valentin Kipyatkov f0ef04a6a8 Changed highlighting range for unresolved annotation name to not include '@'
#KT-11529 Fixed
2016-03-24 16:44:58 +03:00
Alexander Udalov e42cb2af40 Render 'annotation class not found' for error types in tests
After 13ae3d9 it became unclear whether an annotation mentioned in test data is
resolved or not, this change fixes that
2016-03-18 14:48:54 +03:00
Pavel V. Talanov 597c571f25 Fix diagnostic range when some qualifier is unresolved in "@a.b.c.Anno"
#KT-7747 Fixed
2016-03-11 15:00:02 +03:00
Alexander Udalov 1b8f934b54 Delete deprecated enum 'values' property 2016-02-19 22:28:44 +03:00
Michael Bogdanov 7c2920febe Don't allow use standalone constants in complexExpressions, fix for KT-11043: Inconsisten result for class literal and string concatenation
#KT-11043 Fixed
2016-02-17 16:53:18 +03:00
Denis Zharkov 4cf1393e81 Minor. Render annotations on type parameters 2016-01-22 19:17:22 +03:00
Ilya Gorbunov f4822cd757 Fix testData in compiler: add collections and ranges package to fq-names. 2016-01-22 05:54:38 +03:00
Mikhail Glukhikh b78d481bb1 delegate use-site targeted annotations: parser, front-end, codegen with some tests #KT-10502 Fixed 2016-01-19 11:38:41 +03:00
Mikhail Glukhikh 474076a550 Annotation use-site refactoring: field, property, getter 2016-01-19 11:38:36 +03:00
Dmitry Petrov 142e85be04 Prohibit functions (and constructors) with multiple vararg parameters. 2015-12-22 10:40:41 +03:00
Alexander Udalov 7449ad2763 Rename Extension annotation to ExtensionFunctionType
The old one is kept temporarily and will be removed later
2015-12-21 20:33:32 +03:00
Mikhail Glukhikh 3fb04aceb9 Check backing field availability for AnnotationTarget.FIELD #KT-10387 Fixed
Some duplicated checks deleted (UseSiteTargetChecker / JvmFieldApplicabilityChecker)
2015-12-17 15:06:58 +03:00
Mikhail Glukhikh c8b50eec1e Enum.values: deprecation (warning) --> deprecation (error) 2015-12-11 11:11:42 +03:00
Dmitry Jemerov e97e82d119 use terms "lambda expression" and "anonymous function" instead of "function literal" and "function expression" 2015-12-09 13:55:40 +01:00
Alexander Udalov 877129340f Revert "Rename Extension annotation to ExtensionFunctionType"
This reverts commit 460dad135c.

The old compiler will not see the new runtime correctly. Postponing this until
1.0
2015-11-30 19:24:58 +03:00
Pavel V. Talanov 337701670c Refactor script registering in frontend and jvm backend 2015-11-30 18:21:02 +03:00
Alexander Udalov 460dad135c Rename Extension annotation to ExtensionFunctionType 2015-11-30 02:51:04 +03:00
Mikhail Glukhikh dc60c62781 Enum.values is now deprecated but Enum.values() is no more deprecated 2015-11-23 17:29:36 +03:00
Pavel V. Talanov 2b955bc6ec Script refactoring, frontend tests: changes according to semantic changes in scripts
Add checker tests for scripts
2015-11-19 22:56:57 +03:00
Mikhail Glukhikh fe13f39de9 Use of uninitialized variables in lambdas / object literals / local functions is forbidden now #KT-4475 Fixed
Local declarations CFA: variable initialization information before them is now taken into account
2015-11-17 18:21:09 +03:00
Alexey Tsvetkov 1e2256207c Update test data 2015-10-19 20:45:02 +03:00
Alexey Tsvetkov dc27363452 Remove @annotation from test data 2015-10-19 20:45:01 +03:00
Alexey Tsvetkov 1973573a89 Remove @data from test data 2015-10-19 20:45:00 +03:00
Svetlana Isakova 7208efc784 Fix tests with type annotations 2015-10-17 19:07:25 +03:00
Denis Zharkov 1c02231cda Regenerate rendered descriptors after transforming Enum.values to property 2015-10-17 17:46:16 +03:00
Svetlana Isakova 082469aee4 Resolve annotations on type parameters of functions and properties 2015-10-16 21:58:45 +03:00