Propagate option deprecation to options impl class
This is to avoid the new warning OVERRIDE_DEPRECATION that is reported when a base method is deprecated and an overriding method is not.
This commit is contained in:
committed by
TeamCityServer
parent
7917e511ed
commit
bd856ad726
@@ -202,11 +202,13 @@ private fun Printer.generateImpl(
|
||||
println()
|
||||
val propertyType = property.gradleReturnType
|
||||
if (propertyType.endsWith("?")) {
|
||||
generateOptionDeprecation(property)
|
||||
generatePropertyDeclaration(property, modifiers = "override", value = "null")
|
||||
} else {
|
||||
val backingField = property.backingField()
|
||||
val visibilityModified = property.gradleBackingFieldVisibility.name.lowercase(Locale.US)
|
||||
println("$visibilityModified var $backingField: $propertyType? = null")
|
||||
generateOptionDeprecation(property)
|
||||
generatePropertyDeclaration(property, modifiers = "override")
|
||||
withIndent {
|
||||
println("get() = $backingField ?: ${property.gradleDefaultValue}")
|
||||
|
||||
Reference in New Issue
Block a user