क्यों जब मैं सामान्य वर्ग के लिए enum जोड़ने मैं कोई त्रुटि मिलती है:जब मैं सामान्य वर्ग में enum जोड़ता हूं तो एक्सकोड बिल्ड त्रुटि?
class TestClass<T>{
enum TestEnum {
case test
}
}
त्रुटि:
1. While type-checking 'ExampleTest' at /Users/xxx/xxx/xx/xx/ExampleTest.swift:11:1
<unknown>:0: error: unable to execute command: Segmentation fault: 11
<unknown>:0: error: swift frontend command failed due to signal (use -v to see invocation)
Command /Applications/Xcode6-Beta3 2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift failed with exit code 254
लेकिन जब मैं यह कर मैं एक त्रुटि नहीं मिलता:
class TestClass{
enum TestEnum {
case test
}
}
या यह:
class TestClass<T>{
}
आपके पहले दो उदाहरण बिल्कुल समान हैं - क्या यह संभव है कि आपने दो बार एक ही स्निपेट पोस्ट किया हो? – weltraumpirat
जेनेरिक क्लास और नेस्टेड एनम के संयोजन के साथ कंपाइलर बग। [एक बग रिपोर्ट फ़ाइल करें] (https://bugreport.apple.com/) और अब कामकाज के रूप में गणना के लिए गणना करें। –
@weltraumpirat धन्यवाद, उदाहरण को सही किया। – Jimmy