Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Commit

Permalink
Make type variables mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouke committed Apr 16, 2017
1 parent 98dbac6 commit fe30ad8
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Sources/CodeGenerator/SwiftCodeGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ extension SwiftType {

extension SwiftProperty {
func toLineOfCode() -> LineOfCode {
return "let \(name): \(type.toSwiftCode())"
return "var \(name): \(type.toSwiftCode())"
}
}

Expand Down
10 changes: 5 additions & 5 deletions Tests/SchemaParserTests/Inputs/complex_extension.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
typealias Employee = Fullpersoninfo
class Fullpersoninfo: Personinfo {
let address: String
let city: String
let country: String
var address: String
var city: String
var country: String
init(firstname: String, lastname: String, address: String, city: String, country: String) {
self.address = address
self.city = city
Expand Down Expand Up @@ -41,8 +41,8 @@ class Fullpersoninfo: Personinfo {
}
}
class Personinfo: XMLDeserializable {
let firstname: String
let lastname: String
var firstname: String
var lastname: String
init(firstname: String, lastname: String) {
self.firstname = firstname
self.lastname = lastname
Expand Down
4 changes: 2 additions & 2 deletions Tests/SchemaParserTests/Inputs/complex_nested_type.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Foo: XMLDeserializable {
let bar: Bar
var bar: Bar
init(bar: Bar) {
self.bar = bar
}
Expand All @@ -16,7 +16,7 @@ class Foo: XMLDeserializable {
try bar.serialize(barNode)
}
class Bar: XMLDeserializable {
let buz: String
var buz: String
init(buz: String) {
self.buz = buz
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/SchemaParserTests/Inputs/complex_sequence.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class MyType: XMLDeserializable {
let a: String
let b: String?
let c: String
let d: [String]
let e: [String]
var a: String
var b: String?
var c: String
var d: [String]
var e: [String]
init(a: String, b: String? = nil, c: String, d: [String], e: [String]) {
self.a = a
self.b = b
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
typealias MyElement = MyType
class MyType: XMLDeserializable {
let a: String
var a: String
init(a: String) {
self.a = a
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/SchemaParserTests/Inputs/element_with_complex_base.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
typealias MyElement = MyType
class MyType: XMLDeserializable {
let a: String
let b: String?
let c: String
let d: [String]
let e: [String]
var a: String
var b: String?
var c: String
var d: [String]
var e: [String]
init(a: String, b: String? = nil, c: String, d: [String], e: [String]) {
self.a = a
self.b = b
Expand Down
2 changes: 1 addition & 1 deletion Tests/SchemaParserTests/Inputs/nillable_array.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Employee: XMLDeserializable {
let nicknames: [String?]
var nicknames: [String?]
init(nicknames: [String?]) {
self.nicknames = nicknames
}
Expand Down
6 changes: 3 additions & 3 deletions Tests/SchemaParserTests/Inputs/nillable_identifier.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Employee: XMLDeserializable {
let firstname: String
let lastname: String
let tussenvoegsel: String?
var firstname: String
var lastname: String
var tussenvoegsel: String?
init(firstname: String, tussenvoegsel: String? = nil, lastname: String) {
self.firstname = firstname
self.tussenvoegsel = tussenvoegsel
Expand Down
2 changes: 1 addition & 1 deletion Tests/SchemaParserTests/Inputs/nillable_optional.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Employee: XMLDeserializable {
let manager: String?
var manager: String?
init(manager: String? = nil) {
self.manager = manager
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Lark
// MARK: - SOAP Structures
//
class GetSMSCodesResponse: XMLDeserializable {
let getSMSCodesResult: String?
var getSMSCodesResult: String?
init(getSMSCodesResult: String? = nil) {
self.getSMSCodesResult = getSMSCodesResult
}
Expand All @@ -30,7 +30,7 @@ class GetSMSCodesResponse: XMLDeserializable {
}

class GetSMSCodes: XMLDeserializable {
let identifier: String?
var identifier: String?
init(identifier: String? = nil) {
self.identifier = identifier
}
Expand Down

0 comments on commit fe30ad8

Please sign in to comment.