No synthetic properties of type Unit

This commit is contained in:
Valentin Kipyatkov
2015-07-09 12:43:32 +03:00
parent bfdc74ce74
commit 82f1eafa0b
3 changed files with 8 additions and 1 deletions
@@ -31,6 +31,7 @@ import org.jetbrains.kotlin.resolve.lazy.FileScopeProvider
import org.jetbrains.kotlin.resolve.scopes.JetScope
import org.jetbrains.kotlin.storage.StorageManager
import org.jetbrains.kotlin.types.JetType
import org.jetbrains.kotlin.types.typeUtil.isUnit
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
import org.jetbrains.kotlin.utils.addIfNotNull
import java.util.*
@@ -69,6 +70,7 @@ class SyntheticExtensionsScope(storageManager: StorageManager) : JetScope by Jet
return descriptor.getValueParameters().isEmpty()
&& descriptor.getTypeParameters().isEmpty()
&& descriptor.getVisibility() == Visibilities.PUBLIC //TODO: what about protected and package-local?
&& !(descriptor.getReturnType()?.isUnit() ?: true)
}
private fun isGoodSetMethod(descriptor: FunctionDescriptor, propertyType: JetType): Boolean {