Always emit a default intializer for classes
It's a compiler error to define an immutable class without an initializer (or initail values) Fixes #827
This commit is contained in:
Родитель
2b51ccce42
Коммит
7e0c1c8bb2
|
@ -524,10 +524,9 @@ export class SwiftRenderer extends ConvenienceRenderer {
|
|||
}
|
||||
}
|
||||
|
||||
// If using classes with convenience initializers,
|
||||
// this main initializer must be defined within the class
|
||||
// declaration since it assigns let constants
|
||||
if (isClass && (this._convenienceInitializers || this._justTypes)) {
|
||||
if (isClass) {
|
||||
// Make an initializer that initalizes all fields
|
||||
this.ensureBlankLine();
|
||||
let properties: Sourcelike[] = [];
|
||||
|
|
Загрузка…
Ссылка в новой задаче