4
iOS에서 실행되는 프로그래밍 언어의 제네릭은 무엇입니까? 닥치고 내 돈을 가져가!표현식 유형 'StaticString'을 'StringLiteralConvertible'(Swift) 유형으로 변환 할 수 없습니다.
Cannot convert the expression's type 'StaticString' to type 'StringLiteralConvertible'
I :
이var foo = Foo.floop("test")
마지막 부분에 오류 메시지가 발생합니다 :에 의해
class Foo<GenericType1> {
var value:GenericType1?
init(value:GenericType1) {
self.value = value;
}
}
class Foo2<GenericType2> : Foo<GenericType2> {
override init(value:GenericType2) {
super.init(value:value);
}
}
extension Foo {
class func floop<T>(value: T) -> Foo2<T> {
return Foo2<T>(value:value)
}
}
이어 :
여기에 내 실험 코드 (이 놀이터에서 실행)입니다 왜 내 인생에서 그럴 수 없습니까? 어떤 도움이라도 대단히 감사 할 것입니다.