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