Skip to content

Commit

Permalink
Update specs formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dzharkov committed Mar 18, 2015
1 parent 6f60bfa commit f4ed05c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec-docs/secondary-constructors.md
Expand Up @@ -20,14 +20,14 @@ class Foo(a: Bar): MySuper() {
No primary constructor:
``` kotlin
class Foo: MySuper { // initialization of superclass is not allowed
constructor(a: Int): super(a + 1) { ... } // must call super() here
constructor(a: Int) : super(a + 1) { ... } // must call super() here
}
```

No primary constructor + two overloaded constructors
``` kotlin
class Foo: MySuper { // initialization of superclass is not allowed
constructor(a: Int): super(a + 1) { ... }
constructor(a: Int) : super(a + 1) { ... }
constructor() : this(1) { ... } // either super() or delegate to another constructor
}
```
Expand All @@ -47,7 +47,7 @@ class Foo: MySuper { // initialization of superclass is not allowed
No primary constructor => no supertype initialization allowed in the class header:
``` kotlin
class Foo : Bar() { // Error
constructor(x: Int): this() {}
constructor(x: Int) : this() {}
}
```

Expand Down

0 comments on commit f4ed05c

Please sign in to comment.