A new resolution diagnostic UnsuccessfulCallableReferenceAtom is
introduced that is used in EagerResolveOfCallableReferences.
No diagnostic is reported on unresolved calls with this diagnostic
because
#KT-59856
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.
Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
Currently, FIR reports errors caused by previous resolution failure. For
example with unresolved `a` and `b` in code `a.b`, both `a` and `b` are
highlighted. FE1.0 only highlights `a` since it's the root cause. This
change applies this heuristics when reporting FirDiagnostics.
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
Previously helpers from checkType.kt was in special package, and
if directive was enabled then test runner (`AbstractDiagnosticTest`)
injected additional imports to test files and removed them after test
was completed.
It's very hard to support such behavior in new test infrastructure so
there was a decision about changing `CHECK_TYPE`:
1. All helpers from `checkType.kt` now stays in default package
2. `CHECK_TYPE` only adds `checkType.kt` to set of analyzed files
and don't modify their content
For test which are written in default package (most of tests actually)
there are no changes. On the other hand if there is a test where dev
want to use checkType functions in testfile with some package then he
should explicitly import functions which he needed (`checkSubtype`,
`checkType`, `_`)
Repeat the logic of KotlinConstraintSystemCompleter in ConstraintSystemCompleter.
Implement additional context operations required for updated lambda completion algorithm.
Call transformer previously ran completion of argument atoms
only for non-error candidates. This led to missing diagnostics,
i.e. from collection literal resolver.
Now arguments of calls resolved to error descriptor are completed,
with exception to not found provideDelegate calls.
provideDelegate's subatoms are not completed after failure, because
it is a part of delegate competion, which does not end with
unresolved provideDelegate.
Completing after provideDelegate failure removes constraint system
from resolved arguments, which breaks resolve for get/setValue.
^KT-33592 Fixed
When there is unsuccessful (e.g invisible) result of one kind (static/non-static)
and there is a successful candidate for another kind, choose the latter one.
Note, that we have to postpone commiting trace until we choose one of the results,
otherwise errors of unsuccessful results are reported
TODO: Maybe it makes sense to report all results when all of them are
unsuccessful (NONE_APPLICABLE or something like this)
#KT-16278 Fixed
Get rid of trace & reportOn parameters of
createReflectionTypeForCallableDescriptor: move the two checks that required
them to DoubleColonExpressionResolver and combine with other checks into a
single function that checks the validity of the referenced symbol. This also
makes these checks reported only once when invalid expressions are passed as
function arguments (previously they were also reported from
getResolvedCallableReferenceShapeType).
Also inline getReflectionTypeForCandidateDescriptor after this, and refactor
its usages
In the expression "Runnable::run" we were resolving the left-hand side to the
SAM constructor of Runnable. Now we detect this situation, ignore the result of
such resolution, and continue resolving the LHS as a type
Reuse it in the main type-checking path in DoubleColonExpressionResolver, as
well as in ArgumentTypeResolver which handles the case when a callable
reference appears as an argument to another call