The case for KT-7237 belongs to /NoGTInTypeArguments test
It was fixed implicitly: before it recovery was working but the name for
the next parameter was attached to type argument list.
After that change, parameter without name gets parsed correctly (with an
error of course)
^KT-13731 Fixed
^KT-7237 Fixed
It's more consistent to normal function body for IDE.
Doc comments in file beginning are now sticks to declarations
correctly.
Moving declarations at the end of scripts is fixed
Lexer monitors "long string template" state end and will produce
LONG_TEMPLATE_ENTRY_END token when it is reached. If parser continues
without waiting for it, it will eventually get handling token that
will produce irrelevant error. Such behaviour also breaks lazy
elements (LAMBDA_EXPRESSION in this case) contract: range of parsed text
in eager mode should be same to one parsed in lazy mode.
#KT-14865 Fixed
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.
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).
(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).
Attach annotations to the closest prefix expression instead of
whole statement if no new line found after annotations
The motivation is for a simple annotated expression like '@ann x + y'
its syntax form must not change after prepending 'val z = ' just before it
This change only matters in cases of if/when/for/while having braceless
blocks
Annotations on them are parsed now as on block-level expressions, i.e.
they're attached to the whole expression
If a block statement starts with annotations treat them as they
belong to node of the statement rather than to the closest prefix expression
#KT-10210 Fixed
It's needed when declarations are parsed as a part of previous expression
(see tests)
Currently we apply this kind of recovery in a conservative way,
only when declaration starts at the next line, and while
the condition could be relaxed, there's no need to do this
#KT-4948 Fixed
#KT-7118 Fixed
If property name is parsed on the next line and declaration is invalid
(no receiver/type/initializer), treat that name as it does not belong to property
#KT-12987 In Progress