Commit Graph

69 Commits

Author SHA1 Message Date
Mikhail Glukhikh 036b6c63f6 [FIR] During resolve, set correctly property reference type in delegate 2020-04-03 13:18:47 +03:00
Mikhail Glukhikh 5af4efd5a7 Remove FIR test data file accidentally left in 8884cbe4 2020-03-05 15:51:41 +03:00
Mikhail Glukhikh 8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Alexander Udalov 4692247897 Do not check backing field presence in AnnotationSplitter
This code can be invoked early, during body resolution and before the
fact that a property has backing field (which is only known for certain
after body resolution, because an implicit 'field' identifier may be
used). Since split annotations are cached until the end of the program,
they may end up on incorrect elements in the bytecode (or disappear
completely) as in KT-29507 or KT-28182.

Because the FIELD target has the lowest priority among implicit
annotation targets (see TARGET_PRIORITIES), it's safe to always assume
that FIELD is a valid target when splitting annotations. This only
changes the way annotations are split in case of incorrect code, as
changes in test data show.

 #KT-28182 Fixed
 #KT-29507 Fixed
2019-02-15 17:53:27 +01:00
Alexander Udalov d1e1e274d9 Render property accessor annotations in .txt test data
If property accessor rendering is disabled in a test, render annotations
on accessors as use-site-targeted, as was done with
`@setparam:`-annotations. Otherwise they were lost
2018-10-24 18:17:12 +02:00
Alexander Udalov fc87043cb3 Merge use-site targeted annotations into corresponding Annotations
Add PropertyDescriptor.backingField/delegateField to store annotations
on the field directly in an otherwise almost empty descriptor instance,
instead of storing them with use-sites in the corresponding property
descriptor. Instead of AnnotationWithTarget, create AnnotationDescriptor
instances in AnnotationSplitter. Change DescriptorRenderer to render
annotations on "related" declarations when needed, with the explicit
use-site target if applicable.

Most changes in diagnostic test data are related to the fact that
annotations which are known to have an incompatible use-site to the
declaration they're applied at (such as `@param:`-annotation on a
function), are now not loaded at all. It's fine because the code is
erroneous, so it doesn't really matter how do we load annotations with
invalid targets (some of this logic is also changed freely in subsequent
commits). Some changes are also explained by the fact that for example
an annotation on the property which is only applicable to FIELD is now
rendered with an explicit use-site target `@field:`, regardless of
whether it did have that use-site target syntactically or not.

Basically, after this change there's no point in calling
Annotations.getUseSiteTargetedAnnotations/getAllAnnotations anymore
because it's easier and more intuitive to just use Annotations of the
corresponding descriptor -- the backing / delegate field (introduced in
this commit) or the extension receiver / setter parameter (related
behavior was fixed in previous commits). Usages of
use-site-target-related methods will be refactored out in subsequent
commits
2018-09-06 19:13:11 +03:00
Dmitry Petrov 5767f84c0e Restrict retention for annotations with target EXPRESSION
#KT-13762 Fixed
2018-07-18 14:21:03 +03:00
Mikhail Glukhikh e76debb12b Report UNUSED_PARAMETER in setter #KT-21129 Fixed 2018-05-04 18:04:57 +03:00
Dmitry Savvinov ea72c76a37 [NI] Testdata changes after fixes in error types 2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
baratynskiy 01883a41cb javac-wrapper: refactoring, fixes and tests 2017-08-29 18:01:36 +03:00
Mikhail Zarechenskiy 32f609ceee Check lambda parameter for name shadowing
#KT-5160 Fixed
2017-04-17 17:12:44 +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
Denis Zharkov 84153f9636 Add warning for ambiguous annotated expression syntax
#KT-14238 In Progress
2016-10-12 11:40:12 +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
Alexander Udalov 090d157f86 Update test data for data classes 2016-09-15 16:45:48 +03:00
Denis Zharkov d0acb3674a Fix rendered testData
New members in enum member scope
2016-05-16 15:38:13 +03:00
Alexander Udalov 1b8f934b54 Delete deprecated enum 'values' property 2016-02-19 22:28:44 +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 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
Mikhail Glukhikh dc60c62781 Enum.values is now deprecated but Enum.values() is no more deprecated 2015-11-23 17:29:36 +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
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
Svetlana Isakova b401d46ae4 Check annotations on type arguments 2015-10-16 21:58:44 +03:00
Mikhail Glukhikh f8a356747e Stdlib rename: 'name' and 'ordinal' are now properties in Enum, same name functions are deprecated 2015-10-14 20:40:13 +03:00
Svetlana Isakova 9b1030de2e Annotations on type projection belong to type reference 2015-10-09 11:05:52 +03:00
Mikhail Glukhikh 7b4f18035f L-value of assignment expression can now be annotated with expression-targeted annotation #KT-9154 Fixed 2015-09-29 13:05:16 +03:00
Mikhail Glukhikh f4ccb16c2e Function expressions can be now annotated with expression-targeted annotation #KT-9323 Fixed 2015-09-29 13:05:13 +03:00
Yan Zhulanow 6db9344659 Fix compiler tests 2015-09-25 19:20:20 +03:00
Mikhail Glukhikh 74ba21b40c Extra annotation target test for prefix expression 2015-09-25 17:46:36 +03:00
Mikhail Glukhikh bd7ccc0138 Annotation on a function literal cannot be written to binary if it has FUNCTION target and the literal is inlined 2015-09-25 17:46:30 +03:00
Mikhail Glukhikh c4fb6d48c5 Object literals are now classes and expressions simultaneously for the purposes of annotation target checking 2015-09-23 16:47:07 +03:00
Mikhail Glukhikh dd4601fd08 Function literal is now expression and function simultaneously for purposes of annotation target checking 2015-09-23 16:47:04 +03:00
Mikhail Glukhikh 55c7df8b8d Deprecations: data class should now have at least one primary constructor parameter, parameters should be val / var and not vararg. 2015-09-23 16:33:05 +03:00
Denis Zharkov 4850fd10f0 Regenerate test data containing rendered descriptors
Introduced '@' after each annotation
2015-09-18 10:14:39 +03:00
Mikhail Glukhikh 22229af930 Annotation / modifier checking for setter parameters / for variables / multi declarations, tests, relevant test changes #KT-9145 Fixed 2015-09-16 09:51:37 +03:00
Yan Zhulanow 01b2d02196 Remove @get: @set:, reorder remaining annotation targets 2015-09-11 22:32:23 +03:00
Mikhail Glukhikh 3770e7f49f Introduction of AnnotationTarget.CLASS as a replacement for CLASSIFIER (first step) 2015-09-11 17:59:40 +03:00
Mikhail Glukhikh 1dee922861 kotlin.annotation.Target / Retention have now more priority than same java classes if import java.lang.annotation.* is available 2015-09-08 17:18:31 +03:00
Denis Zharkov 676ca86ea4 Deprecate escaped modifiers and unescaped annotations 2015-09-08 12:11:30 +03:00