See IDEA/f53c2114c38f856bdf0ff4d01de9fffeeeb630f2 commit.
In 222+ IDEA usage of the old ErrorUtils (and other classes)
was eliminated, but not in the 211-221 versions.
Relevant Kotlin commit: b5933c70e2
Also, I noticed that stub for createUnresolvedType do not
store arguments into Error type, so I've fixed that too
[JS IR] Test import.meta syntax
[JS IR] Add possibility to use import.meta
[JS IR] Check if import function-like returns Promise
[JS IR] Add test with import function syntax
[JS IR] Allow import function-like in js function
Merge-request: KT-MR-5948
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-51125 fixed
Also make it an abstract class and turn ReturnTypeCalculatorForFullBodyResolve
into object (because it has no state and there is no need to create
different instances of it)
See IDEA/f53c2114c38f856bdf0ff4d01de9fffeeeb630f2 commit.
In 222+ IDEA usage of the old ErrorUtils (and other classes)
was eliminated, but not in the 211-221 versions.
Relevant Kotlin commit: b5933c70e2
Also, there is usages of UnresolvedType or ErrorType from
the org.jetbrains.kotlin.types package in the safeargs tests,
but it is difficult to restore the compatibility for them.
So, I decided that it is ok to eliminate them in the
`kt-[212|213|221]-*` branches, because it is tests and not
production
Kotlin Gradle plugin was incorrectly assuming that com.android.lint implies an Android project.
com.android.lint works for any JVM project and is used that way in various projects.
If we do not do this, the state-machine builder will not know the type
of the ACONST_NULL, defaulting to Object, leading to VerifyError.
Alternatively, we could use LVT to deduce the type, but getting types
from LVT is something I got rid of long time ago, and I have no desire
to return it back.
Generating CHECKCAST hints the state-machine builder the type of the
variable avoiding the issue of VerifyError. However, this CHECKCAST
replaces StrictBasicValue.NULL_VALUE with BasicValue in
OptimizationBasicInterpreter. To preserve optimization on not-spilling
known nulls, introduce BasicValues, which represent typed nulls and
create BasicInterpreter, which is aware of them. This way we have the
best of two worlds - we do not spill known nulls, and we know the type
of ACONST_NULL.
#KT-51718 Fixed
along with source lines mapping, allows to "emulate" usage of the
PSI files which allows to extract source file and line mapping info
on every stage from source element.
It makes sense to use this mapping for the error reporting too.