Excluding android source sets can actually bring unexpected behaviour
when, for example, androidInstrumentedTest get depends on commonMain.
In this case "nativeMain" will be reported as checked skipped android
source sets, but they are still present in dependsOn edges.
Another important aspect is that mpp+android is a majority and their
cases should be checked as well
^KT-47144 Verification Pending
Introduce "White Crow" heuristic that will report incorrect dependency
edge when there is only one source set with different Source Set Tree.
Otherwise, report all source sets from all Source Set Tree groups
to user to choose which of them are incorrect.
And cover with more tests.
^KT-47144 Verification Pending
In Kotlin Multiplatform it is not possible to have
source set dependencies between two different SourceSet Trees.
For example commonTest can't dependOn commonMain as SourceSet dependency
instead binaries of commonMain should be included as dependency to
commonTest. Which is implemented through different mechanisms
^KT-47144 Verification Pending
Previously the argument type was being used for the actual type error
display. However, safe-call arguments are unwrapped which causes
nullable types to be displayed as non-null. Change to use the actual
type provided by the diagnostic instead of extracting the type from
the argument.
#KT-58844 Fixed
Since we know that in most cases signatures for JS and NATIVE are
the same, when running a signature test for the first time, let's print
`// CHECK JS NATIVE:` instead of `// CHECK JS:` or `// CHECK NATIVE:`.
^KT-59204 Fixed
`getReturnTypeForKtDeclaration` is called by UAST on probably compiled declarations.
In order to avoid redundant decompilation + building raw FIR + resolve,
let's delegate to deserialized FIR which is already prepared in stubs
Fixes KTIJ-24810
When `findSourceNonLocalFirDeclaration` is called on non-physical property accessor e.g.,
during completion, then traverse tree should allow drilling into FirProperty;
otherwise, no FIR would be found
In case of broken code e.g., duplicated classes provider would return first class,
though we definitely need some code insight in this case
at least to add navigation fixes, etc.
Similar to this, a file copy is created during completion,
where additional elements might appear and we need to search for them.
Added test cases for duplicated classes.
Otherwise, if fir was requested with non-physical element
inside existing analysis session (not on-air, e.g.,
`FirPositionCompletionContextDetector#analyzeInContext` with
`FirSimpleParameterPositionContext`) all consequent requests
would return fir with that non-physical source,
which might be already invalidated.
On-air sessions should be protected from invalidation problem but some clients
might expect original elements anyway and in this case, it would be
impossible to retrieve correct fir for them.
In order to find parameters, allow to traverse tree till functions.
To make sure all possible types are resolved and any additional errors
are reported, resolve children of function calls using independent
resolution mode when the callee reference is an error.
#KT-59041 Fixed
Error message was only printing the calling inline function and not the
class member being accessed. Make sure both pieces for diagnostic
information are included in the error message.
#KT-58972 Fixed
Mangle invocations of functions with value classes in signature which
override (directly or indirectly) a method declared in Kotlin code.
Otherwise, NoSuchMethodError is being thrown.
^KT-55945: Fixed
CompileTimeConstantProvider could receive a reference expression,
whose grandparent is KtTypeReference (seen that in UAST inspection).
FIR would not contain anything explicit for this reference,
FirResolvedTypeRef would be received as the nearest parent.
Of course, in this case, there could be no compile time constant anyway.
In this commit we have a lot of change in test data. This was caused
by the way where we evaluate constants. We split constant evaluation
into two distinct parts: only necessary evaluations for `fir2ir`
(like const val and annotations) and optimizations for lowering.
Now we don't do all constant evaluation on `fir2ir`, but IR
dump is executed after this phase, so test data changed.
#KT-58923
This way we achieve faster compilation time. We want to traverse
IR tree as little as possible. If we add new checker than the time
to evaluate constants basically doubles.
#KT-58923
We can interpret all const elements. It wasn't true on early
prototype phase because of some problems with unsigned numbers,
but right now it is correct to assume that all const are valid.
#KT-58923
Variables in `IrInlinedFunctionBlock` declared before the composite
blocks with arguments evaluation may lead to error on codegen while
processing `IrInlinedFunctionBlock`.
^KT-58779: Fixed
- CompilationFreeArgsValidator got accidentally unused at some point,
and for now we don't see a reason to enable it back. A proper solution
includes exposing K/N linker options more explicitly via DSL, which
would address the initial problem of passing linker options to compiler
accidentally
- With ComplationFreeArgsValidator removal and migration of
DisabledNativeTargetsReporter to diagnostics infra, AggregateReporter
becomes unused so it can be removed as well