Files
swift-mirror/test/expr/delayed-ident/enum.swift
Dmitri Hrybenko 3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00

25 lines
422 B
Swift

// RUN: %target-parse-verify-swift
// Simple enumeration type
enum E1 {
case First
case Second(Int)
case Third(Int, Double)
}
var e1: E1 = .First
e1 = .Second(5)
e1 = .Third(5, 3.14159)
// Generic enumeration type
enum E2<T> {
case First
case Second(T)
}
var e2a: E2<Int> = .First
e2a = .Second(5)
var e2b: E2 = .Second(5)
e2b = .First
var e2c: E2 = .First // expected-error{{could not find member 'First'}}