Commit Graph

31 Commits

Author SHA1 Message Date
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
Mikhail Glukhikh e76debb12b Report UNUSED_PARAMETER in setter #KT-21129 Fixed 2018-05-04 18:04:57 +03:00
Alexey Andreev 6adb62f3a2 JS: prohibit declaration names that clash with JS builtin functions
See KT-18095, KT-17475, KT-18105, KT-5259
2017-10-23 17:19:52 +03:00
Alexey Andreev ca014468ee JS: improve name clash checker to handle complicated cases
See KT-18010
2017-09-26 13:56:19 +03:00
Alexey Andreev 28c9d274ec JS: prohibit illegal chars on dynamic call site
See KT-19540
2017-09-04 15:35:00 +03:00
Alexander Udalov 472959aca1 Improve rendering of modifiers in DescriptorRenderer
* Use bold font to render all modifiers
* Render 'external' according to the style guide, right after modality
2017-08-25 15:35:05 +03:00
Alexey Andreev 9375a1d984 Prohibit illegal identifiers in packages in JS BE
See KT-18032
2017-05-29 15:37:30 +03:00
Ilya Gorbunov f4ef98c327 Remove test for named native 2017-01-30 19:21:41 +03:00
Alexey Andreev 06e8f7b328 JS: don't report error when FAKE function overrides external function with optional parameters. Report only when it overrides at least two such functions. See KT-15961 2017-01-30 17:26:07 +03:00
Alexey Andreev 900adcf29b JS: prohibit stable (public) names with non-identifier chars. Rewrite unstable (private) names with non-identifier chars. See KT-4160 2016-12-30 16:21:18 +03:00
Alexey Andreev ed7ac7cea9 JS: do not report declaration clash when common redeclaration diagnostic applies. See KT-14577 2016-12-29 16:00:36 +03:00
Alexey Andreev fff1af4ff6 JS: allow to inherit external classes with overloaded functions in case we don't override them (see KT-13910). 2016-12-09 15:13:09 +03:00
Alexey Andreev 68412ae94f JS: replace all usages of @native annotation with external modifier, in tests, stdlib, etc 2016-12-08 15:41:39 +03:00
Alexey Andreev 71ef8c4f89 JS: fix exception in JS front-end when checking JsName that was resolved with errors 2016-11-11 11:11:19 +03:00
Alexey Andreev f22a507e39 JS: add test to prove that #KT-5051 is no more reproducible 2016-10-20 12:16:30 +03:00
Alexey Andreev c814a9d1d2 KT-2752: fix support of typealiases 2016-10-08 19:25:52 +03:00
Alexey Andreev 6f7e7d8504 KT-2752: fixes after code review 2016-10-08 19:25:49 +03:00
Alexey Andreev 4e2b1d68cf KT-2752: deprecate parameter of @native annotation, prohibit simultaneous usage of parameterized @native and @JsName 2016-10-08 19:25:42 +03:00
Alexey Andreev 49022fd5bc KT-2752: move some diagnostics from entire declarations to their headers 2016-10-08 19:25:41 +03:00
Alexey Andreev 681a428473 KT-2752: prohibit JSName on extension properties 2016-10-08 19:25:36 +03:00
Alexey Andreev 1dcb037aee KT-2752: remove diagnostic that reports about overridden method having several names from different sources. Generate proxies instead. Fix reporting name clash when two distinct fake overrides require same name. 2016-10-08 19:25:35 +03:00
Alexey Andreev c5087779e4 KT-2752: add diagnostics that reports about conflicting overridden declarations 2016-10-08 19:25:34 +03:00
Alexey Andreev 16c172f053 KT-2752: add diagnostic that reports about applying JsName on overridden declarations 2016-10-08 19:25:33 +03:00
Alexey Andreev 725d13b72e KT-2752: fix JsName with explicit use target. Add some tests for JsName with use targets 2016-10-08 19:25:33 +03:00
Alexey Andreev be0013d9f2 KT-2752: declare properties as a pair of functions when accessors are marked with @JsName 2016-10-08 19:25:32 +03:00
Alexey Andreev 6e1a0901ac KT-2752: add checkers for inconsistent usage of JsName 2016-10-08 19:25:31 +03:00
Alexey Andreev 50dd1e31c3 KT-2752: move tests, that check whether there's no name clash, to JS backend tests 2016-10-08 19:25:29 +03:00
Alexey Andreev 5ce158f297 KT-2752: add basic tests for JsName 2016-10-08 19:25:28 +03:00
Alexey Andreev 8738458c34 KT-2752: fix name clash diagnostic for case of extension property. Add more tests for the diagnostic 2016-10-08 19:25:27 +03:00
Alexey Andreev 8f829557c8 KT-2752: add diagnostic that checks whether Kotlin declarations produce conflicting names in generated JS 2016-10-08 19:25:26 +03:00