Last active
August 29, 2015 14:04
-
-
Save akashivskyy/4dfc6ca736f5ff6fb222 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol protokol {} | |
class klass : protokol {} | |
let array : [protokol] = [klass()] as [klass] // EXC_BAD_ACCESS | |
////////////////////////////////////////////////// | |
class klass {} | |
var global : [Any] = [] | |
let block : () -> () = { | |
global = [klass()] as [klass] | |
for element in global {} // EXC_BAD_ACCESS | |
}; block() | |
////////////////////////////////////////////////// | |
protocol protokol {} | |
class klass : protokol {} | |
var outer = [protokol]() | |
var inner = [klass()] | |
outer = inner // EXC_BAD_ACCESS | |
////////////////////////////////////////////////// | |
class klass {} | |
var outer = [Any]() | |
var inner = [klass()] | |
outer = inner // EXC_BAD_ACCESS | |
////////////////////////////////////////////////// | |
protocol protokol {} | |
class klass : protokol {} | |
var outer = [protokol]() | |
var inner : [protokol] = [klass()] // WORKS | |
outer = inner |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment