Repository: square/kotlinpoet
Issue: lateinit var with private setter doesnt work

Here's my approach:
```kotlin
PropertySpec.varBuilder("foo", String::class, LATEINIT)
    .setter(FunSpec.setterBuilder()
        .addModifiers(PRIVATE)
        .build()
    ).build()
```
I would expect the following kotlin code to be generated:

```kotlin
lateinit var foo: String
    private set
```
But I get:
```java
java.lang.IllegalStateException: set() can have only one parameter
        at com.squareup.kotlinpoet.FunSpec$Builder.build(FunSpec.kt:339)
        ...
```

Changed files:
src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt, src/main/java/com/squareup/kotlinpoet/FunSpec.kt

diff --git a/src/main/java/com/squareup/kotlinpoet/FunSpec.kt b/src/main/java/com/squareup/kotlinpoet/FunSpec.kt
index d29d87a8..9eb3ec79 100644
--- a/src/main/java/com/squareup/kotlinpoet/FunSpec.kt
+++ b/src/main/java/com/squareup/kotlinpoet/FunSpec.kt
@@ -44,13 +44,14 @@ class FunSpec private constructor(builder: Builder) {
   val delegateConstructor = builder.delegateConstructor
   val delegateConstructorArguments = builder.delegateConstructorArguments.toImmutableList()
   val body = builder.body.build()
+  private val isEmptySetter = name == SETTER && parameters.isEmpty()
 
   init {
     require(body.isEmpty() || ABSTRACT !in builder.modifiers) {
       "abstract function ${builder.name} cannot have code"
     }
-    require(name != SETTER || parameters.size == 1) {
-      "$name must have exactly one parameter"
+    require(name != SETTER || parameters.size <= 1) {
+      "$name can have at most one parameter"
     }
     require(INLINE in modifiers || typeVariables.none { it.reified }) {
       "only type parameters of inline functions can be reified!"
@@ -95,7 +96,7 @@ class FunSpec private constructor(builder: Builder) {
 
     if (asExpressionBody != null) {
       codeWriter.emitCode(" = %L", asExpressionBody)
-    } else {
+    } else if (!isEmptySetter) {
       codeWriter.emit(" {\\n")
       codeWriter.indent()
       codeWriter.emitCode(body)
@@ -122,8 +123,10 @@ class FunSpec private constructor(builder: Builder) {
       codeWriter.emitCode("%L", escapeIfNecessary(name))
     }
 
-    parameters.emit(codeWriter) { param ->
-      param.emit(codeWriter, includeType = name != SETTER)
+    if (!isEmptySetter) {
+      parameters.emit(codeWriter) { param ->
+        param.emit(codeWriter, includeType = name != SETTER)
+      }
     }
 
     if (emitReturnType(returnType)) {
@@ -399,7 +402,7 @@ class FunSpec private constructor(builder: Builder) {
     fun build(): FunSpec {
       check(typeVariables.isEmpty() || !name.isAccessor) { "$name cannot have type variables" }
       check(!(name == GETTER && parameters.isNotEmpty())) { "$name cannot have parameters" }
-      check(!(name == SETTER && parameters.size != 1)) { "$name can have only one parameter" }
+      check(!(name == SETTER && parameters.size > 1)) { "$name can have at most one parameter" }
       return FunSpec(this)
     }
   }
diff --git a/src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt b/src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt
index 84e9f772..c2697c01 100644
--- a/src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt
+++ b/src/test/java/com/squareup/kotlinpoet/PropertySpecTest.kt
@@ -36,6 +36,20 @@ class PropertySpecTest {
     assertThat(prop.toString()).isEqualTo("val foo: kotlin.String by Delegates.notNull()\\n")
   }
 
+  @Test fun emptySetter() {
+    val prop = PropertySpec.builder("foo", String::class)
+        .mutable()
+        .setter(FunSpec.setterBuilder()
+            .addModifiers(KModifier.PRIVATE)
+            .build())
+        .build()
+
+    assertThat(prop.toString()).isEqualTo("""
+      |var foo: kotlin.String
+      |    private set
+      """.trimMargin())
+  }
+
   @Test fun inlineSingleAccessor() {
     val prop = PropertySpec.builder("foo", String::class)
         .getter(FunSpec.getterBuilder()