[JS IR BE] Remove support for dynamic symbols and descriptors

Dynamic expressions in IR are now represented as IrDynamicOperatorExpression

We don't have dynamic functions, dynamic dispatch receivers anymore
This commit is contained in:
Svyatoslav Kuzmich
2019-02-21 19:32:56 +03:00
parent d323dce2b6
commit e9cdad1143
6 changed files with 12 additions and 123 deletions
@@ -126,6 +126,12 @@ class CheckIrElementVisitor(
override fun visitCall(expression: IrCall) {
super.visitCall(expression)
val function = expression.symbol.owner
if (function.dispatchReceiverParameter?.type is IrDynamicType) {
reportError(expression, "Dispatch receivers with 'dynamic' type are not allowed")
}
val returnType = expression.descriptor.returnType
if (returnType == null) {
reportError(expression, "${expression.descriptor} return type is null")
@@ -232,6 +238,10 @@ class CheckIrElementVisitor(
override fun visitFunction(declaration: IrFunction) {
super.visitFunction(declaration)
if (declaration.dispatchReceiverParameter?.type is IrDynamicType) {
reportError(declaration, "Dispatch receivers with 'dynamic' type are not allowed")
}
for ((i, p) in declaration.valueParameters.withIndex()) {
if (p.index != i) {
reportError(declaration, "Inconsistent index of value parameter ${p.index} != $i")
@@ -188,9 +188,7 @@ class InlineClassLowering(val context: BackendContext) {
override fun visitCall(call: IrCall): IrExpression {
call.transformChildrenVoid(this)
val function = call.symbol.owner
if (
function.isDynamic() ||
function.parent !is IrClass ||
if (function.parent !is IrClass ||
function.isStaticMethodOfClass ||
!function.parentAsClass.isInline ||
(function is IrSimpleFunction && !function.isReal) ||