in playground shouldn't "hearts" be printed

6 views
Skip to first unread message

G G

unread,
Jun 14, 2015, 5:44:15 AM6/14/15
to swift-l...@googlegroups.com


enum Suit {


   case Spades, Hearts, Diamonds, Clubs

   

   func simpleDescription() -> String {

   

      switch self {

      

      case .Spades:

      

         return "spades"

         

      case .Hearts:

      

         return "hearts"

         

      case .Diamonds:

      

         return "diamonds"

         

      case .Clubs:

      

         return "clubs"

      }

   }

}


let hearts = Suits.Hearts


let heartsDescription = hearts.simpleDescription()


println(heartsDescription)


ads...@me.com

unread,
Jun 14, 2015, 6:23:10 AM6/14/15
to 'Jason Stokes' via Swift Language
Should it be "Suit.Hearts" instead of "Suits.Hearts"?

What result you actually seeing?


–Adam
--
You received this message because you are subscribed to the Google Groups "Swift Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swift-languag...@googlegroups.com.
To post to this group, send email to swift-l...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/swift-language/726667fa-89eb-4c81-bb4a-422ad04d2b9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

G G

unread,
Jun 14, 2015, 6:31:08 AM6/14/15
to swift-l...@googlegroups.com
Ah. ok

it showed nothing. it didn't indicate a problem
Reply all
Reply to author
Forward
0 new messages