From 4755a494f12c82d2d5f26476e706de5778d598bc Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 13 Mar 2018 20:28:34 +0300 Subject: [PATCH] Create basic version of FIR interfaces (mostly declarations) #KT-24014 Fixed --- .../org/jetbrains/kotlin/fir/FirElement.kt | 8 +++++++- .../org/jetbrains/kotlin/fir/FirSession.kt | 8 ++++++++ .../declarations/FirAnonymousInitializer.kt | 12 +++++++++++ .../fir/declarations/FirCallableMember.kt | 13 ++++++++++++ .../kotlin/fir/declarations/FirClass.kt | 20 +++++++++++++++++++ .../kotlin/fir/declarations/FirConstructor.kt | 12 +++++++++++ .../kotlin/fir/declarations/FirDeclaration.kt | 10 ++++++++++ .../declarations/FirDeclarationContainer.kt | 12 +++++++++++ .../declarations/FirDeclarationWithBody.kt | 12 +++++++++++ .../kotlin/fir/declarations/FirEnumEntry.kt | 12 +++++++++++ .../fir/declarations/FirErrorDeclaration.kt | 10 ++++++++++ .../kotlin/fir/declarations/FirFile.kt | 10 ++++++++++ .../kotlin/fir/declarations/FirFunction.kt | 13 ++++++++++++ .../kotlin/fir/declarations/FirImport.kt | 11 ++++++++++ .../fir/declarations/FirMemberDeclaration.kt | 16 +++++++++++++++ .../fir/declarations/FirNamedDeclaration.kt | 12 +++++++++++ .../fir/declarations/FirNamedFunction.kt | 9 +++++++++ .../fir/declarations/FirPackageFragment.kt | 11 ++++++++++ .../kotlin/fir/declarations/FirProperty.kt | 19 ++++++++++++++++++ .../fir/declarations/FirPropertyAccessor.kt | 14 +++++++++++++ .../kotlin/fir/declarations/FirTypeAlias.kt | 13 ++++++++++++ .../fir/declarations/FirTypeParameter.kt | 16 +++++++++++++++ .../declarations/FirTypeParameterContainer.kt | 10 ++++++++++ .../fir/declarations/FirTypedDeclaration.kt | 13 ++++++++++++ .../fir/declarations/FirValueParameter.kt | 18 +++++++++++++++++ .../fir/expressions/FirAnnotationCall.kt | 15 ++++++++++++++ .../fir/expressions/FirAnnotationContainer.kt | 10 ++++++++++ .../kotlin/fir/expressions/FirBody.kt | 11 ++++++++++ .../kotlin/fir/expressions/FirCall.kt | 10 ++++++++++ .../fir/expressions/FirConstructorCall.kt | 12 +++++++++++ .../kotlin/fir/expressions/FirExpression.kt | 9 +++++++++ .../kotlin/fir/expressions/FirStatement.kt | 11 ++++++++++ .../kotlin/fir/expressions/FirVariable.kt | 13 ++++++++++++ .../kotlin/fir/types/FirDelegatedType.kt | 12 +++++++++++ .../kotlin/fir/types/FirExplicitType.kt | 9 +++++++++ .../kotlin/fir/types/FirImplicitType.kt | 9 +++++++++ .../kotlin/fir/types/FirResolvedType.kt | 12 +++++++++++ .../kotlin/fir/types/FirStarProjection.kt | 8 ++++++++ .../org/jetbrains/kotlin/fir/types/FirType.kt | 11 ++++++++++ .../kotlin/fir/types/FirTypeProjection.kt | 12 +++++++++++ .../fir/types/FirTypeProjectionContainer.kt | 10 ++++++++++ .../types/FirTypeProjectionWithVariance.kt | 14 +++++++++++++ 42 files changed, 501 insertions(+), 1 deletion(-) create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSession.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirCallableMember.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirClass.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationContainer.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationWithBody.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirErrorDeclaration.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFile.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFunction.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirImport.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedDeclaration.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedFunction.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPackageFragment.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirProperty.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameterContainer.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationCall.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationContainer.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirBody.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirCall.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirConstructorCall.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirExpression.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirStatement.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirVariable.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirDelegatedType.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirExplicitType.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirImplicitType.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirResolvedType.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirStarProjection.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirType.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjection.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionContainer.kt create mode 100644 compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionWithVariance.kt diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirElement.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirElement.kt index b3cf9b09fda..a75403e5a0a 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirElement.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirElement.kt @@ -5,4 +5,10 @@ package org.jetbrains.kotlin.fir -interface FirElement \ No newline at end of file +import com.intellij.psi.PsiElement + +interface FirElement { + val psi: PsiElement? + + val session: FirSession +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSession.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSession.kt new file mode 100644 index 00000000000..0c40134b589 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/FirSession.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir + +interface FirSession \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt new file mode 100644 index 00000000000..27f11a38fb8 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirAnonymousInitializer.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +// Probably not a function +@Deprecated("May be not needed") +interface FirAnonymousInitializer : FirDeclarationWithBody { + +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirCallableMember.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirCallableMember.kt new file mode 100644 index 00000000000..55c7f4ddf5c --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirCallableMember.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.types.FirType + +// Good name needed (something with receiver, type parameters, return type, and name) +interface FirCallableMember : FirMemberDeclaration, FirTypedDeclaration { + val receiverType: FirType +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirClass.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirClass.kt new file mode 100644 index 00000000000..76744c8d6b5 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirClass.kt @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.fir.types.FirType + +interface FirClass : FirDeclarationContainer, FirMemberDeclaration { + // including delegated types + val superTypes: List + + val classKind: ClassKind + + val isCompanion: Boolean + + val isData: Boolean +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt new file mode 100644 index 00000000000..d55cd373e04 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirConstructor.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirConstructorCall + +interface FirConstructor : FirFunction { + val delegatedConstructor: FirConstructorCall? +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt new file mode 100644 index 00000000000..80f5e2dcd3c --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclaration.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.FirElement + +interface FirDeclaration : FirElement \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationContainer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationContainer.kt new file mode 100644 index 00000000000..1292ff8ad2c --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationContainer.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +interface FirDeclarationContainer { + // May be only member declarations should be here + // ?: FirAnonymousInitializer + val declarations: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationWithBody.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationWithBody.kt new file mode 100644 index 00000000000..905e19569db --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirDeclarationWithBody.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirBody + +interface FirDeclarationWithBody : FirDeclaration { + val body: FirBody +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt new file mode 100644 index 00000000000..c807af329d8 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirEnumEntry.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirExpression + +interface FirEnumEntry : FirClass { + val arguments: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirErrorDeclaration.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirErrorDeclaration.kt new file mode 100644 index 00000000000..b5e562da2ae --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirErrorDeclaration.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +// Is it necessary? +interface FirErrorDeclaration : FirDeclaration { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFile.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFile.kt new file mode 100644 index 00000000000..b85bdd29285 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFile.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +interface FirFile : FirPackageFragment { + val imports: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFunction.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFunction.kt new file mode 100644 index 00000000000..b959657e201 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirFunction.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirAnnotationContainer + +// May be should inherit FirTypeParameterContainer +interface FirFunction : FirDeclarationWithBody, FirAnnotationContainer { + val valueParameters: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirImport.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirImport.kt new file mode 100644 index 00000000000..d8874eb01c2 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirImport.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.FirElement + +interface FirImport : FirElement { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt new file mode 100644 index 00000000000..2987b957563 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirMemberDeclaration.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.fir.expressions.FirAnnotationContainer + +interface FirMemberDeclaration : FirTypeParameterContainer, FirNamedDeclaration, FirAnnotationContainer { + val visibility: Visibility + + val modality: Modality +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedDeclaration.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedDeclaration.kt new file mode 100644 index 00000000000..498c6eaad6d --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedDeclaration.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.name.Name + +interface FirNamedDeclaration : FirDeclaration { + val name: Name +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedFunction.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedFunction.kt new file mode 100644 index 00000000000..9500c4b41a4 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirNamedFunction.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +interface FirNamedFunction : FirFunction, FirCallableMember { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPackageFragment.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPackageFragment.kt new file mode 100644 index 00000000000..877e987c3c5 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPackageFragment.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.FirElement + +interface FirPackageFragment : FirElement, FirDeclarationContainer { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirProperty.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirProperty.kt new file mode 100644 index 00000000000..1d2e11bb8e8 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirProperty.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirExpression +import org.jetbrains.kotlin.fir.expressions.FirVariable + +// May be should not inherit FirVariable +interface FirProperty : FirCallableMember, FirVariable { + // Should it be nullable or have some default? + val getter: FirPropertyAccessor + + val setter: FirPropertyAccessor + + val delegate: FirExpression? +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt new file mode 100644 index 00000000000..ec9c1745d59 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirPropertyAccessor.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.descriptors.Visibility + +interface FirPropertyAccessor : FirFunction { + val isGetter: Boolean + + val visibility: Visibility +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt new file mode 100644 index 00000000000..4d4c98b9f58 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeAlias.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirAnnotationContainer +import org.jetbrains.kotlin.fir.types.FirType + +interface FirTypeAlias : FirMemberDeclaration, FirAnnotationContainer { + val abbreviatedType: FirType +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt new file mode 100644 index 00000000000..df18ff16685 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameter.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirAnnotationContainer +import org.jetbrains.kotlin.fir.types.FirType +import org.jetbrains.kotlin.types.Variance + +interface FirTypeParameter : FirNamedDeclaration, FirAnnotationContainer { + val variance: Variance + + val bounds: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameterContainer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameterContainer.kt new file mode 100644 index 00000000000..274c0bb9b81 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypeParameterContainer.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +interface FirTypeParameterContainer { + val typeParameters: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt new file mode 100644 index 00000000000..b2961a255cf --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirTypedDeclaration.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirAnnotationContainer +import org.jetbrains.kotlin.fir.types.FirType + +interface FirTypedDeclaration : FirDeclaration, FirAnnotationContainer { + val returnType: FirType +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt new file mode 100644 index 00000000000..d9cec6cc83f --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/declarations/FirValueParameter.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.declarations + +import org.jetbrains.kotlin.fir.expressions.FirExpression + +interface FirValueParameter : FirTypedDeclaration, FirNamedDeclaration { + val isCrossinline: Boolean + + val isNoinline: Boolean + + val isVararg: Boolean + + val defaultValue: FirExpression? +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationCall.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationCall.kt new file mode 100644 index 00000000000..6d667fcdbaf --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationCall.kt @@ -0,0 +1,15 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget +import org.jetbrains.kotlin.fir.types.FirType + +interface FirAnnotationCall : FirCall { + val annotationType: FirType + + val useSiteTarget: AnnotationUseSiteTarget +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationContainer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationContainer.kt new file mode 100644 index 00000000000..75572e44eb3 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirAnnotationContainer.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +interface FirAnnotationContainer { + val annotations: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirBody.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirBody.kt new file mode 100644 index 00000000000..553d89a0f3d --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirBody.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +// Should we have FirBlockBody / FirExpressionBody? +interface FirBody { + val statements: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirCall.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirCall.kt new file mode 100644 index 00000000000..7e0ecc8a849 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirCall.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +interface FirCall : FirExpression { + val arguments: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirConstructorCall.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirConstructorCall.kt new file mode 100644 index 00000000000..54da3020f44 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirConstructorCall.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +import org.jetbrains.kotlin.fir.types.FirType + +interface FirConstructorCall : FirCall { + val constructedType: FirType +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirExpression.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirExpression.kt new file mode 100644 index 00000000000..011eaca81cf --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirExpression.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +interface FirExpression : FirStatement { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirStatement.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirStatement.kt new file mode 100644 index 00000000000..ecca4f0d630 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirStatement.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +import org.jetbrains.kotlin.fir.FirElement + +interface FirStatement : FirElement { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirVariable.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirVariable.kt new file mode 100644 index 00000000000..b08a95c259a --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/expressions/FirVariable.kt @@ -0,0 +1,13 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.expressions + +import org.jetbrains.kotlin.fir.declarations.FirTypedDeclaration +import org.jetbrains.kotlin.fir.declarations.FirNamedDeclaration + +interface FirVariable : FirTypedDeclaration, FirNamedDeclaration, FirStatement { + val initializer: FirExpression? +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirDelegatedType.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirDelegatedType.kt new file mode 100644 index 00000000000..577d0c8822d --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirDelegatedType.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +import org.jetbrains.kotlin.fir.expressions.FirExpression + +interface FirDelegatedType : FirExplicitType { + val delegate: FirExpression +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirExplicitType.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirExplicitType.kt new file mode 100644 index 00000000000..16da2d56a2d --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirExplicitType.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +interface FirExplicitType : FirType, FirTypeProjectionContainer { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirImplicitType.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirImplicitType.kt new file mode 100644 index 00000000000..5839234ec6b --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirImplicitType.kt @@ -0,0 +1,9 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +interface FirImplicitType : FirType { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirResolvedType.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirResolvedType.kt new file mode 100644 index 00000000000..d6cf7250abc --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirResolvedType.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +import org.jetbrains.kotlin.types.KotlinType + +interface FirResolvedType : FirType { + val type: KotlinType +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirStarProjection.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirStarProjection.kt new file mode 100644 index 00000000000..bbc4254dc29 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirStarProjection.kt @@ -0,0 +1,8 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +interface FirStarProjection : FirTypeProjection \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirType.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirType.kt new file mode 100644 index 00000000000..5c6b59c98f7 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirType.kt @@ -0,0 +1,11 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +import org.jetbrains.kotlin.fir.FirElement + +interface FirType : FirElement { +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjection.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjection.kt new file mode 100644 index 00000000000..a2079f71090 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjection.kt @@ -0,0 +1,12 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +import org.jetbrains.kotlin.fir.FirElement + +interface FirTypeProjection : FirElement { + +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionContainer.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionContainer.kt new file mode 100644 index 00000000000..13d0036e1f0 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionContainer.kt @@ -0,0 +1,10 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +interface FirTypeProjectionContainer { + val arguments: List +} \ No newline at end of file diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionWithVariance.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionWithVariance.kt new file mode 100644 index 00000000000..27688746dd3 --- /dev/null +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/types/FirTypeProjectionWithVariance.kt @@ -0,0 +1,14 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.types + +import org.jetbrains.kotlin.types.Variance + +interface FirTypeProjectionWithVariance { + val variance: Variance + + val type: FirType +} \ No newline at end of file