scala - Type aliasing type constraints in generics -


i have situation want use bounded generic type constraint on class can produced. problem need

abstract class someabstractclass  trait foo[a <: someabstractclass]  trait bar[a] extends foo[a]     //  fails error: type arguments [a] not conform trait foo's type parameter bounds [a <: someabstractclass]  // need write this, every single subclass of foo trait bar[a <: someabstractclass] extends foo[a] 

is there easier way promote through system without having retype bounds every time?

constraints on type parameters constraints. don't propagate transitively via inheritance them to.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -