- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Anyone seen this TypeError...?
Sun, 2010-05-16, 03:00
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-
Sun, 2010-05-16, 14:57
#2
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-
>>
>>
>>
>
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-
>
>
>