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 trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Kyle Lambert](https://secure.gravatar.com/avatar/e871b5db52a4fb5be8602e5bb2042041?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Kyle Lambert
1,969 PointsChallenge Task 1
Can someone please explain what I'm doing wrong here.. I keep getting a compile error. Something to do with assigning a property to itself. Thanks
// Enter your code below
class Shape {
var numberOfSides: Int
init(sides numberOfSide: Int) {
self.numberOfSides = numberOfSides
}
}
let someShape = Shape(sides: 3)
2 Answers
![Tobias Helmrich](https://secure.gravatar.com/avatar/2c796664737186546139ab14e7600534?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Tobias Helmrich
31,602 PointsHey Kyle,
you almost got it right! The only problem is a typo: You called the parameter in the init method numberOfSide
instead of numberOfSides
. If you fix this it should work.
I hope that helps! :)
![Kyle Lambert](https://secure.gravatar.com/avatar/e871b5db52a4fb5be8602e5bb2042041?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Kyle Lambert
1,969 PointsAhh I see, thank you :)