Created
November 1, 2016 09:39
-
-
Save ilandbt/910b7774e0a6c6bdd348f0958f12611e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import UIKit | |
class Pet { | |
} | |
class Cat: Pet { | |
} | |
class Dog: Pet { | |
} | |
public class Node<T> { | |
public var value: T | |
public init(value: T) { | |
self.value = value | |
} | |
} | |
var list = [Node<Pet>]() | |
//Error: Cannot convert value of Type Node<Dog> to expected argument type Node<Pet> | |
list.append(Node<Dog>(value: Dog())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment