diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index ee8249b2b..54f2bd672 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -4,6 +4,6 @@
-
+
\ No newline at end of file
diff --git a/codeCore/src/prog8/code/core/BuiltinFunctions.kt b/codeCore/src/prog8/code/core/BuiltinFunctions.kt
index 67962fbc0..e1fef8abd 100644
--- a/codeCore/src/prog8/code/core/BuiltinFunctions.kt
+++ b/codeCore/src/prog8/code/core/BuiltinFunctions.kt
@@ -85,7 +85,7 @@ val BuiltinFunctions: Map = mapOf(
"abs__float" to FSignature(true, listOf(FParam("value", arrayOf(DataType.FLOAT))), DataType.FLOAT),
"len" to FSignature(true, listOf(FParam("values", IterableDatatypes)), DataType.UWORD),
// normal functions follow:
- "sizeof" to FSignature(true, listOf(FParam("object", DataType.values())), DataType.UBYTE),
+ "sizeof" to FSignature(true, listOf(FParam("object", DataType.entries.toTypedArray())), DataType.UBYTE),
"sgn" to FSignature(true, listOf(FParam("value", NumericDatatypesNoBool)), DataType.BYTE),
"sqrt" to FSignature(true, listOf(FParam("value", NumericDatatypesNoBool)), null),
"sqrt__ubyte" to FSignature(true, listOf(FParam("value", arrayOf(DataType.UBYTE))), DataType.UBYTE),
diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AsmAssignment.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AsmAssignment.kt
index 93c2d2604..19e581d46 100644
--- a/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AsmAssignment.kt
+++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/assignment/AsmAssignment.kt
@@ -178,10 +178,8 @@ internal class AsmAssignSource(val kind: SourceStorageKind,
AsmAssignSource(SourceStorageKind.EXPRESSION, program, asmgen, value.type, expression = value)
}
is PtFunctionCall -> {
- val symbol = asmgen.symbolTable.lookup(value.name)
- if(symbol==null)
- TODO("${value.name}")
- val sub = symbol!!.astNode as IPtSubroutine
+ val symbol = asmgen.symbolTable.lookup(value.name) ?: throw AssemblyError("lookup error ${value.name}")
+ val sub = symbol.astNode as IPtSubroutine
val returnType = sub.returnsWhatWhere().firstOrNull { rr -> rr.first.registerOrPair != null || rr.first.statusflag!=null }?.second
?: throw AssemblyError("can't translate zero return values in assignment")
diff --git a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt
index 2eb1d79b1..49ace8a75 100644
--- a/compiler/src/prog8/compiler/astprocessing/AstChecker.kt
+++ b/compiler/src/prog8/compiler/astprocessing/AstChecker.kt
@@ -743,13 +743,13 @@ internal class AstChecker(private val program: Program,
"%output" -> {
if(directive.parent !is Module)
err("this directive may only occur at module level")
- if(directive.args.size!=1 || directive.args[0].name !in OutputType.values().map {it.name.lowercase()})
+ if(directive.args.size!=1 || directive.args[0].name !in OutputType.entries.map {it.name.lowercase()})
err("invalid output directive type")
}
"%launcher" -> {
if(directive.parent !is Module)
err("this directive may only occur at module level")
- if(directive.args.size!=1 || directive.args[0].name !in CbmPrgLauncherType.values().map{it.name.lowercase()})
+ if(directive.args.size!=1 || directive.args[0].name !in CbmPrgLauncherType.entries.map{it.name.lowercase()})
err("invalid launcher directive type")
}
"%zeropage" -> {
diff --git a/compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt b/compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
index dbc1e3e04..c8abc0994 100644
--- a/compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
+++ b/compilerAst/src/prog8/ast/antlr/Antlr2Kotlin.kt
@@ -468,7 +468,7 @@ private fun Prog8ANTLRParser.CharliteralContext.toAst(): CharLiteral {
val enc = this.encoding?.text
val encoding =
if(enc!=null)
- Encoding.values().singleOrNull { it.prefix == enc }
+ Encoding.entries.singleOrNull { it.prefix == enc }
?: throw SyntaxError("invalid encoding", toPosition())
else
Encoding.DEFAULT
@@ -485,7 +485,7 @@ private fun Prog8ANTLRParser.StringliteralContext.toAst(): StringLiteral {
val enc = encoding?.text
val encoding =
if(enc!=null)
- Encoding.values().singleOrNull { it.prefix == enc }
+ Encoding.entries.singleOrNull { it.prefix == enc }
?: throw SyntaxError("invalid encoding", toPosition())
else
Encoding.DEFAULT
diff --git a/docs/source/todo.rst b/docs/source/todo.rst
index e01fee141..76b9fa7f8 100644
--- a/docs/source/todo.rst
+++ b/docs/source/todo.rst
@@ -1,7 +1,6 @@
TODO
====
-- upgrade to Kotlin 1.9.0 enum.values() -> enum.entries
- IR: don't use ext.b to clear the msb of an unsigned word, add a specialized instruction for this zmsb.w?
- Fix expericodegen errors (on rockrunners etc)
diff --git a/gradle.properties b/gradle.properties
index 2091ecd34..b50839e78 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -4,5 +4,5 @@ org.gradle.parallel=true
org.gradle.daemon=true
kotlin.code.style=official
javaVersion=11
-kotlinVersion=1.8.21
+kotlinVersion=1.9.0
version=9.1-SNAPSHOT
diff --git a/intermediate/test/TestInstructions.kt b/intermediate/test/TestInstructions.kt
index 955fe049e..d1f92417b 100644
--- a/intermediate/test/TestInstructions.kt
+++ b/intermediate/test/TestInstructions.kt
@@ -123,8 +123,8 @@ class TestInstructions: FunSpec({
}
test("all instructionformats") {
- instructionFormats.size shouldBe Opcode.values().size
- Opcode.values().forEach {
+ instructionFormats.size shouldBe Opcode.entries.size
+ Opcode.entries.forEach {
val fmt = instructionFormats.getValue(it)
fmt.values.forEach { format ->
require(format.reg2==OperandDirection.UNUSED || format.reg2==OperandDirection.READ) {"reg2 can only be used as input"}