Files
swift-mirror/test/expr/cast/set_coerce.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

22 lines
339 B
Swift

// RUN: %target-typecheck-verify-swift
class C : Hashable {
var x = 0
var hashValue: Int {
return x
}
}
func == (x: C, y: C) -> Bool { return true }
class D : C {}
var setC = Set<C>()
var setD = Set<D>()
// Test set upcasts
setC = setD
setD = setC // expected-error{{cannot assign value of type 'Set<C>' to type 'Set<D>'}}