Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialPaul Denlinger
2,380 PointsError: Use of unresolved identifier 'Booktype'
My answer to the task is
let book = Booktype.Pdf("Game of Thrones")
But I get the above error. What is wrong?
Thanks in advance.
enum BookType {
// Write your members with associated values here
case Pdf(String)
case Epub(String)
}
let book = Booktype.Pdf("Game of Thrones")
2 Answers
agreatdaytocode
24,757 PointsPaul you have "let book" it should be var :)
enum BookType {
case Pdf (String)
case Epub (String)
}
var book = BookType.Pdf("Game of Thrones")
Joshua Rapoport
8,415 PointsI would just like to add that, besides the let/var thing, you didn't capitalize the "t" in "BookType"
Aaron already wrote this his code bit, but he didn't point it out, so I thought somebody should.
agreatdaytocode
24,757 PointsGood catch!
Paul Denlinger
2,380 PointsPaul Denlinger
2,380 PointsThank you!