This is because I use f!!.feedTitle at the last statement. If I don’t use it, then there’s no problem.
It works when I rewrite above code to both use for loop
``
for(var f : FeedSite? in river.updatedFeeds?.updatedFeed?.iterator()){
if (f != null){
for(var fi in f!!.item?.iterator()){
if (fi != null) {
newsItems.add(FeedItemMeta(fi!!, f!!.feedTitle, “”))//f?.feedTitle, f?.feedUrl))
}
}
}
}
Andrey this simple example is also throwing an exception @runtime : #IC - 123.72 , #KT - 0.4.280
val l = arrayList(arrayList(1, 2, 3), arrayList(1, 2, 3), arrayList(1, 2, 3))
for(var list in l){
list.forEach {
println("${list.size}")
}
}
Exception in thread "main" java.lang.VerifyError: (class: kotlin/bugs/namespace, method: main signature: ([Ljava/lang/String;)V) Incompatible type for getting or setting field
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
next loops are working fine
for(val list in l){
list.forEach {
println("${list.size}")
}
}
for(var list in l){
for(el in list){
println(“${list.size}”)
}
}