Swift function Generic -


i user swift function return class or a's subclass like

func test(tst: int) -> {     if(tst == 1) {         return a()     }     else {         return b()     } } 

b subclass of a

when return b. use dynamictype it's type. return type a. how can real type.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -