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:
David Siegel 2018-04-26 13:55:30 -07:00
Родитель 2b51ccce42
Коммит 7e0c1c8bb2
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -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[] = [];