These tests used the old type inference constraint system, so it didn't cover the current compiler logic almost at all
It'd be fine to implement similar test for the new type inference constraint system
^KT-52699
The constraint system for the old type inference is going to be removed.
Also, `CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION` isn't used in the production
A lot of calls to Objective-C runtime are potentially blocking. This
commit adds a number of thread state switches to ensure these Obj-C
runtime calls happen in "Native" thread state.
Also, remove a bunch of such functions from CallsChecker exclude list.
For a box test, the test engine generates a test launcher -- a function
that calls `box` function. The latter might require an opt-in. To deal
with this, the test engine was using some heuristics to detect possibly
used opt-ins and applied them to the test launcher.
This commit provides an alternative solution -- it uses
`@Suppress("OPT_IN_USAGE_ERROR")` annotation for the test launcher. This
way, it doesn't have to guess which opt-ins to apply.
This directive makes the test standalone, i.e. disables grouping it with
other tests into a single compilation, and in particular disables
package renaming for the test.
Also, remove the old hard-coded way to mark tests standalone.
The test engine detected tests using typeOf and made them "standalone",
i.e. disabled test grouping and thus package renaming for them, to keep
the reflection information intact.
Now, with `ReflectionPackageName` annotation, this is not required
anymore.
The test engine renames packages in test files to allow group many tests
into single compilation for performance reasons.
As a result, reflection APIs return different package names. To deal
with this, the test engine uses certain heuristics to detect tests using
reflection APIs, and disables grouping (and thus package renaming) for
them.
This commit provides an alternative solution for the same problem --
now the test engine instructs the compiler to use original package names
for reflection information, by means of the introduced
`ReflectionPackageName` annotation.
Previously, the test engine was copying @file:OptIn annotations from
each file to all the other files inside the same test data, and also was
removing other file annotations in certain cases.
Now it only adds the opt-ins specified with `!OPT_IN` directives, and
doesn't remove anything.
They were compared based on the name of the file only disregarding
the module. Therefore, the test framework would only patch
package declarations for one file with a given name even if there
were multiple files with that name in different packages.
`owner` is a PSI element, it can never be an instance of
`KtConstructorSymbol`
Also, make `MutableCollection` an extension receiver instead of context
receiver for the consistency