Assignment 6, task 2 not compiling in Scala 2.13

Moderator: Konzepte der Programmiersprachen

KimB
Neuling
Neuling
Beiträge: 5
Registriert: 16. Okt 2019 00:25

Assignment 6, task 2 not compiling in Scala 2.13

Beitrag von KimB »

Since 2.13 (which is indicated in build.sbt), scala.collection.mutable.ArraySeq is abstract and can't be instanciated directly. The code compiles when lowering the version to 2.12. A working alternative seems to be:

Code: Alles auswählen

val memory = new scala.collection.mutable.ArraySeq.ofRef[Val](new Array(maxSize))
which can probably still be simplified, but at least seems to compile.

mirko-koehler
Moderator
Moderator
Beiträge: 82
Registriert: 16. Okt 2017 12:28

Re: Assignment 6, task 2 not compiling in Scala 2.13

Beitrag von mirko-koehler »

Thanks. The code is fixed now. You can also use the version that you proposed here.

Antworten

Zurück zu „Konzepte der Programmiersprachen“