This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Anyone seen this TypeError...?

2 replies
Sciss
Joined: 2008-12-17,
User offline. Last seen 28 weeks 5 days ago.

hi,

i'm getting a nasty compiler error:

Error during sbt execution: scala.tools.nsc.symtab.Types$TypeError: type mismatch;
found : de.sciss.synth.io.SampleFormat{def bidiFactory(): Some[Any]; def writerFactory(): Some[Any]; def readerFactory(): Some[Any]}
required: de.sciss.synth.io.SampleFormat{def bidiFactory(): Some[Any]; def writerFactory(): Some[Any]; def readerFactory(): Some[Any]} with NotNull

i filed a ticket, but i wonder if in the meantime someone has come across this and has a hint as to circumvent the problem... code goes like this:

abstract class SampleFormat( val id: String, val bitsPerSample: Int ) {
def readerFactory : Option[ BufferReaderFactory ]
def writerFactory : Option[ BufferWriterFactory ]
def bidiFactory : Option[ BufferBidiFactory ]
}

object SampleFormat {
case object UInt8 extends SampleFormat( "uint8", 8 ) {
def readerFactory = Some( BufferReader.Byte )
def writerFactory = Some( BufferWriter.Byte )
def bidiFactory = Some( BufferBidi.Byte )
}
...
}

i tried to comment out stuff from SampleFormat, added and removed modifiers, etc. no luck

best, -sciss-

Mark Harrah
Joined: 2008-12-18,
User offline. Last seen 35 weeks 3 days ago.
Re: Anyone seen this TypeError...?

On Saturday 15 May 2010, Sciss wrote:
> hi,
>
> i'm getting a nasty compiler error:
>
> Error during sbt execution: scala.tools.nsc.symtab.Types$TypeError: type mismatch;
> found : de.sciss.synth.io.SampleFormat{def bidiFactory(): Some[Any]; def writerFactory(): Some[Any]; def readerFactory(): Some[Any]}
> required: de.sciss.synth.io.SampleFormat{def bidiFactory(): Some[Any]; def writerFactory(): Some[Any]; def readerFactory(): Some[Any]} with NotNull
>
> i filed a ticket, but i wonder if in the meantime someone has come across this and has a hint as to circumvent the problem... code goes like this:

In AIFFHeader, explicitly annotate the return type of intSampleFormat to be SampleFormat.

-Mark

> abstract class SampleFormat( val id: String, val bitsPerSample: Int ) {
> def readerFactory : Option[ BufferReaderFactory ]
> def writerFactory : Option[ BufferWriterFactory ]
> def bidiFactory : Option[ BufferBidiFactory ]
> }
>
> object SampleFormat {
> case object UInt8 extends SampleFormat( "uint8", 8 ) {
> def readerFactory = Some( BufferReader.Byte )
> def writerFactory = Some( BufferWriter.Byte )
> def bidiFactory = Some( BufferBidi.Byte )
> }
> ...
> }
>
> i tried to comment out stuff from SampleFormat, added and removed modifiers, etc. no luck
>
>
> best, -sciss-
>
>
>

Sciss
Joined: 2008-12-17,
User offline. Last seen 28 weeks 5 days ago.
Re: Anyone seen this TypeError...?

perfect, thanks!!

Am 16.05.2010 um 03:46 schrieb Mark Harrah:

> On Saturday 15 May 2010, Sciss wrote:
>> hi,
>>
>> i'm getting a nasty compiler error:
>>
>> Error during sbt execution: scala.tools.nsc.symtab.Types$TypeError: type mismatch;
>> found : de.sciss.synth.io.SampleFormat{def bidiFactory(): Some[Any]; def writerFactory(): Some[Any]; def readerFactory(): Some[Any]}
>> required: de.sciss.synth.io.SampleFormat{def bidiFactory(): Some[Any]; def writerFactory(): Some[Any]; def readerFactory(): Some[Any]} with NotNull
>>
>> i filed a ticket, but i wonder if in the meantime someone has come across this and has a hint as to circumvent the problem... code goes like this:
>
> In AIFFHeader, explicitly annotate the return type of intSampleFormat to be SampleFormat.
>
> -Mark
>
>> abstract class SampleFormat( val id: String, val bitsPerSample: Int ) {
>> def readerFactory : Option[ BufferReaderFactory ]
>> def writerFactory : Option[ BufferWriterFactory ]
>> def bidiFactory : Option[ BufferBidiFactory ]
>> }
>>
>> object SampleFormat {
>> case object UInt8 extends SampleFormat( "uint8", 8 ) {
>> def readerFactory = Some( BufferReader.Byte )
>> def writerFactory = Some( BufferWriter.Byte )
>> def bidiFactory = Some( BufferBidi.Byte )
>> }
>> ...
>> }
>>
>> i tried to comment out stuff from SampleFormat, added and removed modifiers, etc. no luck
>>
>>
>> best, -sciss-
>>
>>
>>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland