FIR: use implicit Unit type in setters
This commit is contained in:
@@ -85,6 +85,9 @@ class RawFirBuilder(val session: FirSession) {
|
||||
private fun KtTypeReference?.toFirOrImplicitType(): FirType =
|
||||
convertSafe() ?: FirImplicitTypeImpl(session, this)
|
||||
|
||||
private fun KtTypeReference?.toFirOrUnitType(): FirType =
|
||||
convertSafe() ?: implicitUnitType
|
||||
|
||||
private fun KtTypeReference?.toFirOrErrorType(): FirType =
|
||||
convertSafe() ?: FirErrorTypeImpl(session, this, if (this == null) "Incomplete code" else "Conversion failed")
|
||||
|
||||
@@ -111,7 +114,11 @@ class RawFirBuilder(val session: FirSession) {
|
||||
this,
|
||||
isGetter,
|
||||
visibility,
|
||||
returnTypeReference.toFirOrImplicitType(),
|
||||
if (isGetter) {
|
||||
returnTypeReference.toFirOrImplicitType()
|
||||
} else {
|
||||
returnTypeReference.toFirOrUnitType()
|
||||
},
|
||||
bodyExpression.toFirBody()
|
||||
)
|
||||
extractAnnotationsTo(firAccessor)
|
||||
@@ -374,7 +381,7 @@ class RawFirBuilder(val session: FirSession) {
|
||||
function.hasModifier(KtTokens.EXTERNAL_KEYWORD),
|
||||
function.receiverTypeReference.convertSafe(),
|
||||
if (function.hasBlockBody()) {
|
||||
typeReference?.toFirOrImplicitType() ?: implicitUnitType
|
||||
typeReference.toFirOrUnitType()
|
||||
} else {
|
||||
typeReference.toFirOrImplicitType()
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ FILE: simpleClass.kt
|
||||
public? get(): <implicit> {
|
||||
STUB
|
||||
}
|
||||
public? set(value: Boolean): <implicit> {
|
||||
public? set(value: Boolean): kotlin.Unit {
|
||||
}
|
||||
|
||||
public? final? lateinit property fau(var): Double
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ FILE: simpleClass.kt
|
||||
public? get(): R|error: Not supported: FirImplicitTypeImpl| {
|
||||
STUB
|
||||
}
|
||||
public? set(value: R|kotlin/Boolean|): R|error: Not supported: FirImplicitTypeImpl| {
|
||||
public? set(value: R|kotlin/Boolean|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public? final? property fau(var): R|kotlin/Double|
|
||||
|
||||
Reference in New Issue
Block a user