我似乎在使用[foo]()樣式語法實例化嵌套類類型的空數組時遇到問題:// Playground - noun: a place where people can playclass outsideClass {}class Wrapper { class InsideClass { }}var foo = [outsideClass]() // Works fine// Invalid use of '()' to call a value of non-function type '[Wrapper.InsideClass.Type]'var bar = [Wrapper.InsideClass]() 這是我誤會的東西嗎?那是我喝咖啡之前的事,但是我已經檢查了發行說明,并且我認為您應該能夠引用這樣的嵌套類,或者是Beta 7中的錯誤?作為一種變通辦法,它可以正常工作:var foobar: [Wrapper.InsideClass] = []
- 2 回答
- 0 關注
- 456 瀏覽
添加回答
舉報
0/150
提交
取消