IR: drop IrTypeAlias
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.ir.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
|
||||
|
||||
interface IrTypeAlias : IrDeclaration {
|
||||
override val descriptor: TypeAliasDescriptor
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.ir.declarations.impl
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeAlias
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
class IrTypeAliasImpl(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
override val descriptor: TypeAliasDescriptor
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrTypeAlias {
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R {
|
||||
return visitor.visitTypeAlias(this, data)
|
||||
}
|
||||
|
||||
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
|
||||
// no children
|
||||
}
|
||||
|
||||
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
|
||||
// no children
|
||||
}
|
||||
}
|
||||
@@ -141,15 +141,6 @@ open class DeepCopyIrTreeWithSymbols(
|
||||
declaration.transformDeclarationsTo(this)
|
||||
}
|
||||
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias): IrTypeAlias =
|
||||
IrTypeAliasImpl(
|
||||
declaration.startOffset, declaration.endOffset,
|
||||
mapDeclarationOrigin(declaration.origin),
|
||||
declaration.descriptor
|
||||
).apply {
|
||||
transformAnnotations(declaration)
|
||||
}
|
||||
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction): IrSimpleFunction =
|
||||
IrFunctionImpl(
|
||||
declaration.startOffset, declaration.endOffset,
|
||||
|
||||
@@ -226,10 +226,6 @@ class RenderIrElementVisitor(
|
||||
"inline".takeIf { isInline }
|
||||
)
|
||||
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias, data: Nothing?): String =
|
||||
"TYPEALIAS ${declaration.renderOriginIfNonTrivial()}${declaration.descriptor.ref()} " +
|
||||
"type=${DECLARATION_RENDERER.renderType(declaration.descriptor.underlyingType)}"
|
||||
|
||||
override fun visitVariable(declaration: IrVariable, data: Nothing?): String =
|
||||
"VAR ${declaration.renderOriginIfNonTrivial()}" +
|
||||
"name:${declaration.name} type:${declaration.type.render()} flags:${declaration.renderVariableFlags()}"
|
||||
|
||||
@@ -38,7 +38,6 @@ interface IrElementTransformer<in D> : IrElementVisitor<IrElement, D> {
|
||||
declaration.also { it.transformChildren(this, data) }
|
||||
|
||||
override fun visitClass(declaration: IrClass, data: D) = visitDeclaration(declaration, data)
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias, data: D) = visitDeclaration(declaration, data)
|
||||
override fun visitFunction(declaration: IrFunction, data: D) = visitDeclaration(declaration, data)
|
||||
override fun visitSimpleFunction(declaration: IrSimpleFunction, data: D) = visitFunction(declaration, data)
|
||||
override fun visitConstructor(declaration: IrConstructor, data: D) = visitFunction(declaration, data)
|
||||
|
||||
@@ -49,9 +49,6 @@ abstract class IrElementTransformerVoid : IrElementTransformer<Nothing?> {
|
||||
open fun visitClass(declaration: IrClass) = visitDeclaration(declaration)
|
||||
final override fun visitClass(declaration: IrClass, data: Nothing?) = visitClass(declaration)
|
||||
|
||||
open fun visitTypeAlias(declaration: IrTypeAlias) = visitDeclaration(declaration)
|
||||
final override fun visitTypeAlias(declaration: IrTypeAlias, data: Nothing?) = visitTypeAlias(declaration)
|
||||
|
||||
open fun visitFunction(declaration: IrFunction) = visitDeclaration(declaration)
|
||||
final override fun visitFunction(declaration: IrFunction, data: Nothing?) = visitFunction(declaration)
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ interface IrElementVisitor<out R, in D> {
|
||||
|
||||
fun visitDeclaration(declaration: IrDeclaration, data: D) = visitElement(declaration, data)
|
||||
fun visitClass(declaration: IrClass, data: D) = visitDeclaration(declaration, data)
|
||||
fun visitTypeAlias(declaration: IrTypeAlias, data: D) = visitDeclaration(declaration, data)
|
||||
fun visitFunction(declaration: IrFunction, data: D) = visitDeclaration(declaration, data)
|
||||
fun visitSimpleFunction(declaration: IrSimpleFunction, data: D) = visitFunction(declaration, data)
|
||||
fun visitConstructor(declaration: IrConstructor, data: D) = visitFunction(declaration, data)
|
||||
|
||||
@@ -43,9 +43,6 @@ interface IrElementVisitorVoid : IrElementVisitor<Unit, Nothing?> {
|
||||
fun visitClass(declaration: IrClass) = visitDeclaration(declaration)
|
||||
override fun visitClass(declaration: IrClass, data: Nothing?) = visitClass(declaration)
|
||||
|
||||
fun visitTypeAlias(declaration: IrTypeAlias) = visitDeclaration(declaration)
|
||||
override fun visitTypeAlias(declaration: IrTypeAlias, data: Nothing?) = visitTypeAlias(declaration)
|
||||
|
||||
fun visitFunction(declaration: IrFunction) = visitDeclaration(declaration)
|
||||
override fun visitFunction(declaration: IrFunction, data: Nothing?) = visitFunction(declaration)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user