< : B라면 A는 하위 유형이고 B는 수퍼 유형이라는 것을 알았습니다. B의 자리에 A를 사용한다고 생각했습니다. B의 모든 속성을 상속 받았기 때문에 B가 필요합니다. B. 이제 내 문제는 여기에스칼라에서 수퍼 유형을 찾는 방법
type One
type Two
type Three
type Four
type Five
type Six
type Seven
type Eight
type Fun1 = { val a: One } => { val b: Two }
type Fun2 = { val b: Two } => { val a: One }
type SuperType = {
??
}
type TypeOne = {
def apply: { val func: Fun1 ; val c: Three } => { val b: Two ; val d: Four }
val g: Seven
}
type TypeTwo = {
def apply: { val func: Fun2 ; val e: Five } => { val b: Two ; val f: Six }
val h: Eight
}
어떻게하면 TypeOne 및 TypeTwo의 상위 유형 인 SuperType을 만들 수 있습니까? 'Any'라는 키워드 만 사용하면됩니다. 또한
def apply: {val func: Fun1}=>{val b: Two}
내가 볼과의 관계 어쩌면 이것은 당신이 찾고 있지만이 작업을 수행하는지 아니다
매우 구체적인 스칼라 하위 집합을 고수하고있는 것처럼 보입니다. 그렇게 할 이유가 있습니까? – stefanobaghino