Grantas33
03/03/2021, 11:22 PMrobfletcher
03/04/2021, 12:31 AMkotlin.Result
when I enable IR. No other changes. [This line of code](https://github.com/robfletcher/strikt/blob/main/strikt-core/src/main/kotlin/strikt/assertions/Result.kt#L17) starts throwing
java.lang.ClassCastException: class kotlin.Result$Failure cannot be cast to class kotlin.Result (kotlin.Result$Failure and kotlin.Result are in unnamed module of loader 'app')
Anton Yalyshev [JB]
03/05/2021, 8:02 AMgbaldeck
03/06/2021, 7:28 PMAgi Maulana
03/08/2021, 5:16 AMkotlinOptions.useIR = true
The view model has a LiveData that hold Kotlin's Result class
fun doSomething(code: String, price: Long) {
repository.doX(code, price)
.doOnComplete { _priceSubmission.postValue(Result.success(true)) }
.doOnError { _priceSubmission.postValue(Result.failure(it.cause ?: it)) }
.fromIo2Ui()
.subscribe()
.disposeOnCleared()
}
and the activity observing it by
viewModel.priceSubmission.observe(this) { result ->
if (result.isSuccess) {
setResult(RESULT_OK)
finish()
} else {
val error = result.exceptionOrNull()
if (error is HttpException && error.code() == 400) {
showDialog()
} else {
ToastUtils.showNetworkFailureToast()
}
}
}
I got an error on runtime
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
com/app/package/ui/MyActivity$onCreate$1.onChanged(Lkotlin/Result;)V @31: invokevirtual
Reason:
Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'kotlin/Result'
Current Frame:
bci: @31
flags: { }
locals: { 'com/app/package/ui/MyActivity$onCreate$1', 'kotlin/Result' }
stack: { 'java/lang/Object' }
Bytecode:
0x0000000: 2b59 c600 09b6 001c a700 0557 0112 1eb8
0x0000010: 0024 2b59 c600 09b6 001c a700 0557 01b6
0x0000020: 001c b800 2899 0015 2ab4 000d 02b6 002e
0x0000030: 2ab4 000d b600 31a7 004d 2b59 c600 09b6
0x0000040: 001c a700 0557 0112 1eb8 0024 2b59 c600
0x0000050: 09b6 001c a700 0557 01b6 001c b800 354d
0x0000060: 2cc1 0037 9900 1a2c c000 37b6 003b 1101
0x0000070: 90a0 000d 2ab4 000d b800 3ea7 0009 b200
0x0000080: 44b6 0047 b1
Stackmap Table:
same_locals_1_stack_item_frame(@11,Object[#24])
same_locals_1_stack_item_frame(@13,Object[#5])
same_locals_1_stack_item_frame(@29,Object[#24])
same_locals_1_stack_item_frame(@31,Object[#5])
same_frame(@58)
same_locals_1_stack_item_frame(@69,Object[#24])
same_locals_1_stack_item_frame(@71,Object[#5])
same_locals_1_stack_item_frame(@87,Object[#24])
same_locals_1_stack_item_frame(@89,Object[#5])
append_frame(@126,Object[#76])
chop_frame(@132,1)
at com.app.package.ui.MyActivity.onCreate(MyActivity.kt:36)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
The 36th line of MyActivity
is the priceSubmission
observer
Is this Kotlin's IR backend issue? Thanks.ralf
03/15/2021, 1:14 AMuseIR
flag became a no-op with 1.5. Was this intentional? I’m aware that the new IR backend will be the default with 1.5. But I assumed setting it to false will go back to the old backend (rather than using another property). https://github.com/JetBrains/kotlin/blob/1.5.0-M1/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt#L195-L200Roland Yeghiazaryan
03/16/2021, 1:36 PMkotlinOptions.useIR = true
for every module we have?
New IR works fine, no issues so far 👌eygraber
03/25/2021, 10:33 PMralf
03/29/2021, 1:58 PM1.5.20
rather than the 1.5.0
release https://youtrack.jetbrains.com/issue/KT-44891wasyl
03/29/2021, 3:51 PMwasyl
03/29/2021, 4:09 PMivan.savytskyi
03/29/2021, 4:13 PMSteffen Funke
04/01/2021, 2:29 PMuseIR
does slow down the build a bit:
useIR: false, clean & rebuild:
1. 41s
2. 41s
3. 40s
useIR: true, clean & rebuild:
1. 44s
2. 43s
3. 43s
Granted, it is only marginal slower since it is also only a relatively small project (single module) - but will it affect larger projects proportionally?
Out of curiosity I also tried with compose: true
and was rather disappointed:
useIR: true, compose: true, clean & rebuild:
1. 53s
2. 52s
3. 52s
I honestly expected the new Backend to be if anything, then faster than the existing one?Colton Idle
04/02/2021, 7:58 PMhho
04/07/2021, 10:24 PMZac Sweers
04/08/2021, 4:11 AMralf
04/08/2021, 5:52 PMmarios proto
04/21/2021, 10:43 AMprotected val activity: T by lazy {
activityRule.activity
} must not be null
This is happening somehow else.
also, if it helps,
@JvmField
@Rule
var activityRule: SomeActivityTestRule<out T> =
eygraber
04/29/2021, 3:54 PMZac Sweers
05/06/2021, 12:56 AMAnalysisHandlerExtension
, it just generates some extra files and nothing too complicated. It works fine on the old backend, but when IR is enabled it fails somewhere deep in the compiler for reasons that aren’t clear to me. Looking to see if I should file a bug or if there’s something I’m doing wrong using this API.
Caused by: java.lang.AssertionError: IR backend shouldn't call KotlinTypeMapper.mapType
Repo is here: https://github.com/ZacSweers/auto-service-kt, stacktrace in threadmarios proto
05/07/2021, 4:34 PMJeff Lockhart
05/15/2021, 3:02 AMIllegalStateException: IrTypeAliasSymbol expected: Unbound public symbol for public kotlinx.coroutines/CancellationException|null[0]
compiling KMM module for Kotlin/Native with Kotlin 1.5:
https://youtrack.jetbrains.com/issue/KT-46697neworldlt
06/23/2021, 1:47 PMprivate static final void setupStrictMode$lambda-2(com.vinted.MDApplication, android.os.strictmode.Violation);
private static final void safePenaltyListener$lambda-3(com.vinted.MDApplication, android.os.strictmode.Violation);
neworldlt
06/23/2021, 1:47 PMJon Miller
07/12/2021, 1:13 PMNikhilkumar80
12/09/2021, 8:46 PMprintln(weakStateRef.get())
used to return null
prior to upgrading. Now, it is not cleared when `System.gc()`is called. Is this expected?
data class State(val stateKey: String? = null)
fun func1(newState: State) {
// do nothing
}
fun func2() {
val weakStateRef = WeakReference(State("Foo"))
func1(weakStateRef.get()!!)
System.gc()
println(weakStateRef.get()) // State(stateKey="Foo")
}
ipe_1221
01/20/2022, 10:46 AMvio
03/30/2022, 10:58 AM# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f2734cd8aac, pid=19064, tid=19263
#
# JRE version: OpenJDK Runtime Environment Temurin-17.0.2+8 (17.0.2+8) (build 17.0.2+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (17.0.2+8, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V [libjvm.so+0x8d8aac] jni_SetStaticIntField+0x8c
ralf
02/14/2023, 1:17 AMudalov