FIR: record 'suspend' function modifier in type references

This commit is contained in:
Jinseong Jeon
2020-04-17 14:49:07 -07:00
committed by Mikhail Glukhikh
parent bf97391c51
commit 88f81b9b71
31 changed files with 60 additions and 10 deletions
@@ -232,6 +232,7 @@ object BuilderConfigurator : AbstractBuilderConfigurator<FirTreeBuilder>(FirTree
}
builder(resolvedTypeRef) {
defaultFalse("isSuspend")
defaultNull("delegatedTypeRef")
}
@@ -376,6 +376,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
withGetter = true
}
default("annotations", "mutableListOf()")
defaultFalse("isSuspend")
useTypes(coneClassErrorTypeType)
}
@@ -398,12 +399,23 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
useTypes(errorTypeRefImpl)
}
impl(functionTypeRef)
impl(implicitTypeRef) {
defaultEmptyList("annotations")
impl(dynamicTypeRef) {
defaultFalse("isSuspend")
}
impl(composedSuperTypeRef)
impl(functionTypeRef) {
// Note that we intentionally do _not_ set default value (false) for `isSuspend`, since function type reference is the only
// place where type modifier `suspend` matters.
}
impl(implicitTypeRef) {
defaultEmptyList("annotations")
defaultFalse("isSuspend")
}
impl(composedSuperTypeRef) {
defaultFalse("isSuspend")
}
impl(reference, "FirStubReference") {
default("source") {
@@ -454,6 +466,7 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
delegate = "typeRef"
}
}
defaultFalse("isSuspend")
}
noImpl(userTypeRef)
@@ -530,6 +530,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
typeRef.configure {
+annotations
+booleanField("isSuspend")
}
resolvedTypeRef.configure {