Run "Add 'init' keyword in whole project" quickfix

This commit is contained in:
Denis Zharkov
2015-03-31 12:22:34 +03:00
parent 99f1ab333e
commit a4018d9eae
65 changed files with 85 additions and 82 deletions
@@ -115,7 +115,7 @@ public abstract class CoveringTryCatchNodeProcessor<T: IntervalWithHandler>() {
public class DefaultProcessor(val node: MethodNode) : CoveringTryCatchNodeProcessor<TryCatchBlockNodeWrapper>() {
{
init {
node.tryCatchBlocks.forEach { addNode(it) }
}
@@ -194,8 +194,9 @@ public open class DefaultSourceMapper(val sourceInfo: SourceInfo, override val p
var fileMappings: LinkedHashMap<String, RawFileMapping> = linkedMapOf()
protected var origin: RawFileMapping by Delegates.notNull();
{
protected var origin: RawFileMapping by Delegates.notNull()
init {
visitSource(sourceInfo.source, sourceInfo.pathOrCleanFQN)
//map interval
(1..maxUsedValue).forEach {origin.mapLine(it, it - 1, true) }
@@ -52,7 +52,7 @@ public class IncrementalPackageFragmentProvider(
val fqNameToPackageFragment = HashMap<FqName, PackageFragmentDescriptor>()
val fqNamesToLoad: Set<FqName>
;{
init {
fun createPackageFragment(fqName: FqName) {
if (fqNameToPackageFragment.containsKey(fqName)) {
return
@@ -29,7 +29,7 @@ public class VariableDeclarationInstruction(
element: JetDeclaration,
lexicalScope: LexicalScope
) : InstructionWithNext(element, lexicalScope) {
{
init {
assert(element is JetVariableDeclaration || element is JetParameter) { "Invalid element: ${render(element)}}" }
}
@@ -41,9 +41,9 @@ public abstract class JetCodeFragment(
): JetFile((PsiManager.getInstance(_project) as PsiManagerEx).getFileManager().createFileViewProvider(LightVirtualFile(name, JetFileType.INSTANCE, text), true), false), JavaCodeFragment {
private var viewProvider = super<JetFile>.getViewProvider() as SingleRootFileViewProvider
private var myImports = LinkedHashSet<String>();
private var myImports = LinkedHashSet<String>()
{
init {
getViewProvider().forceCachedPsi(this)
init(TokenType.CODE_FRAGMENT, elementType)
if (context != null) {
@@ -490,7 +490,7 @@ public class JetPsiFactory(private val project: Project) {
return createExpression(sb.toString()) as JetWhenExpression
}
{
init {
if (subjectText != null) {
sb.append("(").append(subjectText).append(") ")
}
@@ -35,7 +35,7 @@ public class KotlinFunctionStubImpl(
private val hasTypeParameterListBeforeFunctionName: Boolean,
private val isProbablyNothingType: Boolean
) : KotlinStubBaseImpl<JetNamedFunction>(parent, JetStubElementTypes.FUNCTION), KotlinFunctionStub {
{
init {
if (isTopLevel && fqName == null) {
throw IllegalArgumentException("fqName shouldn't be null for top level functions")
}
@@ -38,7 +38,7 @@ public class KotlinPropertyStubImpl(
private val fqName: FqName?
) : KotlinStubBaseImpl<JetProperty>(parent, JetStubElementTypes.PROPERTY), KotlinPropertyStub {
{
init {
if (isTopLevel && fqName == null) {
throw IllegalArgumentException("fqName shouldn't be null for top level properties")
}
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.lexer.JetModifierKeywordToken
import kotlin.platform.platformStatic
public object ModifierMaskUtils {
{
init {
assert(MODIFIER_KEYWORDS_ARRAY.size() <= 32, "Current implementation depends on the ability to represent modifier list as bit mask")
}
@@ -31,7 +31,7 @@ public class MutablePackageFragmentProvider(public val module: ModuleDescriptor)
private val fqNameToPackage = HashMap<FqName, MutablePackageFragmentDescriptor>()
private val subPackages = MultiMap.create<FqName, FqName>()
;{
init {
fqNameToPackage.put(FqName.ROOT, MutablePackageFragmentDescriptor(module, FqName.ROOT))
}
@@ -33,7 +33,7 @@ public class FakeCallableDescriptorForObject(
public val classDescriptor: ClassDescriptor
) : DeclarationDescriptorWithVisibility by classDescriptor.getClassObjectReferenceTarget(), VariableDescriptor {
{
init {
assert(classDescriptor.getClassObjectType() != null) {
"FakeCallableDescriptorForObject can be created only for objects, classes with companion object or enum entries: $classDescriptor"
}
@@ -90,7 +90,7 @@ public class LazyAnnotationDescriptor(
val annotationEntry: JetAnnotationEntry
) : AnnotationDescriptor, LazyEntity {
{
init {
c.trace.record(BindingContext.ANNOTATION, annotationEntry, this)
}
@@ -56,7 +56,7 @@ public class LazyScriptDescriptor(
ScriptDescriptor.NAME,
jetScript.toSourceElement()
) {
{
init {
resolveSession.getTrace().record(BindingContext.SCRIPT, jetScript, this)
}
@@ -72,7 +72,7 @@ public class KotlinLightClassForPackage private(
}
}
{
init {
assert(!files.isEmpty()) { "No files for package " + packageFqName }
}
@@ -178,7 +178,7 @@ public abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdi
private class SyntheticPackageViewForTest(private val module: ModuleDescriptor) : PackageViewDescriptor {
private val scope = WritableScopeImpl(JetScope.Empty, this, RedeclarationHandler.THROW_EXCEPTION, "runtime descriptor loader test")
;{
init {
scope.changeLockLevel(WritableScope.LockLevel.BOTH)
}
@@ -34,7 +34,7 @@ private val INCOMPLETE_PATTERN = Pattern.compile("\\.\\.\\.( *)(.*)$")
private val INCOMPLETE_LINE_MESSAGE = "incomplete line"
public abstract class AbstractReplInterpreterTest : UsefulTestCase() {
{
init {
System.setProperty("java.awt.headless", "true")
}
@@ -132,7 +132,7 @@ class MutableDiagnosticsTest : KotlinTestWithEnvironment() {
private inner class DummyDiagnostic : Diagnostic {
val dummyElement = JetPsiFactory(getEnvironment().project).createType("Int")
;{
init {
dummyElement.getContainingJetFile().doNotAnalyze = null
}
@@ -37,7 +37,7 @@ public class ConstraintSystemTestData(
private val functionFoo: FunctionDescriptor
private val scopeToResolveTypeParameters: JetScope
{
init {
val functions = context.getSliceContents(BindingContext.FUNCTION)
functionFoo = findFunctionByName(functions.values(), "foo")
val function = DescriptorToSourceUtils.descriptorToDeclaration(functionFoo) as JetFunction
@@ -37,9 +37,9 @@ public object LibraryUtils {
private val METAINF = "META-INF/"
private val MANIFEST_PATH = "${METAINF}MANIFEST.MF"
private val METAINF_RESOURCES = "${METAINF}resources/"
private val KOTLIN_JS_MODULE_ATTRIBUTE_NAME = Attributes.Name(KOTLIN_JS_MODULE_NAME);
private val KOTLIN_JS_MODULE_ATTRIBUTE_NAME = Attributes.Name(KOTLIN_JS_MODULE_NAME)
{
init {
var jsStdLib = ""
var jsLib = ""
@@ -46,9 +46,9 @@ class LazyJavaClassDescriptor(
) : ClassDescriptorBase(outerC.storageManager, containingDeclaration, fqName.shortName(),
outerC.sourceElementFactory.source(jClass)), JavaClassDescriptor {
private val c: LazyJavaResolverContext = outerC.child(this, jClass);
private val c: LazyJavaResolverContext = outerC.child(this, jClass)
{
init {
c.javaResolverCache.recordClass(jClass, this)
}
@@ -31,9 +31,9 @@ public class DeserializationComponentsForJava(
annotationAndConstantLoader: BinaryClassAnnotationAndConstantLoaderImpl,
packageFragmentProvider: LazyJavaPackageFragmentProvider
) {
val components: DeserializationComponents;
val components: DeserializationComponents
{
init {
val localClassResolver = LocalClassResolverImpl()
components = DeserializationComponents(
storageManager, moduleDescriptor, classDataFinder, annotationAndConstantLoader, packageFragmentProvider,
@@ -27,9 +27,9 @@ public class KotlinClassHeader(
public val classKind: KotlinClass.Kind?,
public val syntheticClassKind: KotlinSyntheticClass.Kind?
) {
public val isCompatibleAbiVersion: Boolean get() = AbiVersionUtil.isAbiVersionCompatible(version);
public val isCompatibleAbiVersion: Boolean get() = AbiVersionUtil.isAbiVersionCompatible(version)
{
init {
if (isCompatibleAbiVersion) {
assert((annotationData == null) == (kind != Kind.CLASS && kind != Kind.PACKAGE_FACADE)) {
"Annotation data should be not null only for CLASS and PACKAGE_FACADE (kind=$kind)"
@@ -32,7 +32,7 @@ public class ModuleDescriptorImpl(
override val defaultImports: List<ImportPath>,
override val platformToKotlinClassMap: PlatformToKotlinClassMap
) : DeclarationDescriptorImpl(Annotations.EMPTY, moduleName), ModuleDescriptor {
{
init {
if (!moduleName.isSpecial()) {
throw IllegalArgumentException("Module name must be special: $moduleName")
}
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns
public class CapturedTypeConstructor(
public val typeProjection: TypeProjection
): TypeConstructor {
{
init {
assert(typeProjection.getProjectionKind() != Variance.INVARIANT) {
"Only nontrivial projections can be captured, not: $typeProjection"
}
@@ -152,7 +152,7 @@ public open class DelegatingFlexibleType protected (
}
}
{
init {
assert (!lowerBound.isFlexible()) { "Lower bound of a flexible type can not be flexible: $lowerBound" }
assert (!upperBound.isFlexible()) { "Upper bound of a flexible type can not be flexible: $upperBound" }
assert (lowerBound != upperBound) { "Lower and upper bounds are equal: $lowerBound == $upperBound" }
@@ -50,7 +50,7 @@ class FuzzyType(
private val usedTypeParameters: HashSet<TypeParameterDescriptor>?
public val freeParameters: Set<TypeParameterDescriptor>
;{
init {
if (freeParameters.isNotEmpty()) {
usedTypeParameters = HashSet()
usedTypeParameters!!.addUsedTypeParameters(type)
@@ -46,7 +46,7 @@ class PartialBodyResolveFilter(
override val filter: ((JetElement) -> Boolean)? = { it is JetExpression && statementMarks.statementMark(it) != MarkLevel.SKIP }
;{
init {
assert(declaration.isAncestor(elementToResolve))
assert(!JetPsiUtil.isLocal(declaration),
"Should never be invoked on local declaration otherwise we may miss some local declarations with type Nothing")
@@ -383,7 +383,7 @@ class PartialBodyResolveFilter(
private val receiverName: SmartCastName?,
private val selectorName: String? /* null means "this" (and receiverName should be null */
) {
{
init {
if (selectorName == null) {
assert(receiverName == null, "selectorName is allowed to be null only when receiverName is also null (which means 'this')")
}
@@ -87,8 +87,9 @@ public class LibraryDependenciesCache(private val project: Project) {
}
private inner class LibraryUsageIndex {
val modulesLibraryIsUsedIn: MultiMap<Library, Module> = MultiMap.createSet();
{
val modulesLibraryIsUsedIn: MultiMap<Library, Module> = MultiMap.createSet()
init {
ModuleManager.getInstance(project).getModules().forEach {
module ->
ModuleRootManager.getInstance(module).getOrderEntries().forEach {
@@ -35,7 +35,7 @@ class LibraryModificationTracker(project: Project) : SimpleModificationTracker()
platformStatic fun getInstance(project: Project) = ServiceManager.getService(project, javaClass<LibraryModificationTracker>())!!
}
{
init {
val connection = project.getMessageBus().connect()
connection.subscribe(VirtualFileManager.VFS_CHANGES, BulkVirtualFileListenerAdapter(
object : VirtualFileAdapter() {
@@ -52,7 +52,7 @@ class ModuleTypeCacheManager private (project: Project) {
}
private class VfsModificationTracker(project: Project): SimpleModificationTracker() {
{
init {
val connection = project.getMessageBus().connect();
connection.subscribe(VirtualFileManager.VFS_CHANGES, BulkVirtualFileListenerAdapter(
object : VirtualFileAdapter() {
@@ -90,7 +90,7 @@ public class DeserializerForDecompiler(val packageDirectory: VirtualFile, val di
}
}
{
init {
moduleDescriptor.initialize(packageFragmentProvider)
moduleDescriptor.addDependencyOnModule(moduleDescriptor)
moduleDescriptor.addDependencyOnModule(KotlinBuiltIns.getInstance().getBuiltInsModule())
@@ -68,7 +68,7 @@ private class MissingDependencyErrorClassDescriptor(
private val scope = ScopeWithMissingDependencies(fullFqName, this)
;{
init {
val emptyConstructor = ConstructorDescriptorImpl.create(this, Annotations.EMPTY, true, SourceElement.NO_SOURCE)
emptyConstructor.initialize(listOf(), listOf(), Visibilities.INTERNAL)
emptyConstructor.setReturnType(createErrorType("<ERROR RETURN TYPE>"))
@@ -31,7 +31,7 @@ class KotlinSuppressableWarningProblemGroup(
private val diagnosticFactory: DiagnosticFactory<*>
) : SuppressableProblemGroup {
{
init {
assert (diagnosticFactory.getSeverity() == Severity.WARNING)
}
@@ -40,7 +40,7 @@ public trait SearchRequestWithElement<T : PsiElement> : DeclarationSearchRequest
}
abstract class DeclarationsSearch<T: PsiElement, R: DeclarationSearchRequest<T>>: QueryFactory<T, R>() {
{
init {
registerExecutor(
object : QueryExecutorBase<T, R>(true) {
override fun processQuery(queryParameters: R, consumer: Processor<T>) {
@@ -161,7 +161,7 @@ public class KotlinPsiSearchHelper(private val project: Project): PsiSearchHelpe
}
public object UsagesSearch: QueryFactory<PsiReference, UsagesSearchRequest>() {
{
init {
val executorImpl = object : QueryExecutorBase<PsiReference, UsagesSearchRequest>() {
override fun processQuery(request: UsagesSearchRequest, consumer: Processor<PsiReference>) {
val searchHelper = KotlinPsiSearchHelper(request.project)
@@ -40,9 +40,9 @@ public class SubpackagesIndexService(private val project: Project) {
public inner class SubpackagesIndex(allPackageFqNames: Collection<String>) {
// a map from any existing package (in kotlin) to a set of subpackages (not necessarily direct) containing files
private val fqNameByPrefix = MultiMap.createSet<FqName, FqName>();
private val fqNameByPrefix = MultiMap.createSet<FqName, FqName>()
{
init {
for (fqNameAsString in allPackageFqNames) {
val fqName = FqName(fqNameAsString)
var prefix = fqName
@@ -28,7 +28,7 @@ public object JetPsiPrecedences {
private val LOG = Logger.getInstance(javaClass<JetPsiPrecedences>())
private val precedence: Map<IElementType, Int>
{
init {
val builder = HashMap<IElementType, Int>()
for ((i, record) in JetExpressionParsing.Precedence.values().withIndices()) {
for (elementType in record.getOperations().getTypes()) {
@@ -72,7 +72,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
protected val reference: JetSimpleNameReference?
protected val expression: JetExpression?
;{
init {
val reference = position.getParent()?.getReferences()?.firstIsInstanceOrNull<JetSimpleNameReference>()
if (reference != null) {
if (reference.expression is JetLabelReferenceExpression) {
@@ -104,7 +104,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
private val kotlinIdentifierStartPattern: ElementPattern<Char>
private val kotlinIdentifierPartPattern: ElementPattern<Char>
;{
init {
val includeDollar = position.prevLeaf()?.getNode()?.getElementType() != JetTokens.SHORT_TEMPLATE_ENTRY_START
if (includeDollar) {
kotlinIdentifierStartPattern = StandardPatterns.character().javaIdentifierStart()
@@ -174,7 +174,7 @@ private class JetDeclarationRemotenessWeigher(private val file: JetFile) : Looku
private val preciseImportPackages = HashSet<FqName>()
private val allUnderImports = HashSet<FqName>()
;{
init {
for (import in file.getImportDirectives()) {
val importPath = import.getImportPath() ?: continue
val fqName = importPath.fqnPart()
@@ -38,7 +38,7 @@ import org.jetbrains.kotlin.types.TypeUtils
public object HeuristicSignatures {
private val signatures = HashMap<Pair<FqName, Name>, List<String>>()
;{
init {
registerSignature("kotlin.Collection", "contains", "E")
registerSignature("kotlin.Collection", "containsAll", "kotlin.Collection<E>")
registerSignature("kotlin.MutableCollection", "remove", "E")
@@ -87,7 +87,7 @@ object KeywordCompletion {
}
private class ParentFilter(filter : ElementFilter) : PositionElementFilter() {
{
init {
setFilter(filter)
}
@@ -52,7 +52,7 @@ public class KotlinCompletionContributor : CompletionContributor() {
private val DEFAULT_DUMMY_IDENTIFIER = CompletionUtilCore.DUMMY_IDENTIFIER_TRIMMED + "$" // add '$' to ignore context after the caret
;{
init {
val provider = object : CompletionProvider<CompletionParameters>() {
override fun addCompletions(parameters: CompletionParameters, context: ProcessingContext, result: CompletionResultSet) {
performCompletion(parameters, result)
@@ -31,7 +31,8 @@ class ToFromOriginalFileMapper(
private val shift: Int
//TODO: lazy initialization?
;{
init {
val originalText = originalFile.getText()
val syntheticText = syntheticFile.getText()
assert(originalText.subSequence(0, completionOffset) == syntheticText.subSequence(0, completionOffset)) //TODO: drop it
@@ -96,7 +96,7 @@ public enum class CaretPosition {
public data class GenerateLambdaInfo(val lambdaType: JetType, val explicitParameters: Boolean)
public class KotlinFunctionInsertHandler(val caretPosition : CaretPosition, val lambdaInfo: GenerateLambdaInfo?) : KotlinCallableInsertHandler() {
{
init {
if (caretPosition == CaretPosition.AFTER_BRACKETS && lambdaInfo != null) {
throw IllegalArgumentException("CaretPosition.AFTER_BRACKETS with lambdaInfo != null combination is not supported")
}
@@ -39,7 +39,7 @@ import org.jetbrains.kotlin.lexer.JetTokens
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
public class KotlinSmartEnterHandler: SmartEnterProcessorWithFixers() {
{
init {
addFixers(
KotlinIfConditionFixer(),
KotlinMissingIfBranchFixer(),
@@ -116,7 +116,7 @@ public class KotlinFindClassUsagesHandler(
// todo: Use JavaFindUsagesHelper.getElementNames() when it becomes public in IDEA
var stringsToSearch: Collection<String>
object: JavaFindUsagesHandler(psiClass, JavaFindUsagesHandlerFactory.getInstance(element.getProject())) {
{
init {
stringsToSearch = getStringsToSearch(psiClass)
}
}
@@ -27,9 +27,9 @@ import org.jetbrains.kotlin.asJava.toLightMethods
import com.intellij.util.containers.ContainerUtil
class KotlinOverrideTreeStructure(project: Project, val element: PsiElement) : HierarchyTreeStructure(project, null) {
val javaTreeStructures = element.toLightMethods().map { method -> MethodHierarchyTreeStructure(project, method) };
val javaTreeStructures = element.toLightMethods().map { method -> MethodHierarchyTreeStructure(project, method) }
{
init {
setBaseElement(javaTreeStructures.first().getBaseDescriptor()!!)
}
@@ -45,7 +45,7 @@ fun updateHighlightingResult(file: JetFile, hasErrors: Boolean) {
public class ErrorDuringFileAnalyzeNotificationProvider(val project: Project) : EditorNotifications.Provider<EditorNotificationPanel>() {
private class HighlightingErrorNotificationPanel : EditorNotificationPanel() {
{
init {
setText("Kotlin internal error occurred in this file. Highlighting may be inadequate.")
myLabel.setIcon(AllIcons.General.Error)
createActionLabel("Open Event Log", ActivateToolWindowAction.getActionIdForToolWindow(EventLog.LOG_TOOL_WINDOW_ID))
@@ -55,7 +55,7 @@ public class KotlinImportOptimizer() : ImportOptimizer {
private val codeStyleSettings = JetCodeStyleSettings.getInstance(file.getProject())
private val aliasImports: Map<Name, FqName>
;{
init {
val imports = file.getImportDirectives()
val aliasImports = HashMap<Name, FqName>()
for (import in imports) {
@@ -43,7 +43,7 @@ import com.intellij.codeInsight.lookup.LookupElementBuilder
import com.intellij.patterns.StandardPatterns
class KDocCompletionContributor(): CompletionContributor() {
{
init {
extend(CompletionType.BASIC, psiElement().inside(javaClass<KDocName>()),
KDocNameCompletionProvider)
@@ -90,7 +90,7 @@ class TypeCandidate(val theType: JetType, scope: JetScope? = null) {
}
}
{
init {
val typeParametersInType = theType.getTypeParameters()
if (scope == null) {
typeParameters = typeParametersInType.copyToArray()
@@ -133,9 +133,9 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
val currentFileContext: BindingContext
val currentFileModule: ModuleDescriptor
private val typeCandidates = HashMap<TypeInfo, List<TypeCandidate>>();
private val typeCandidates = HashMap<TypeInfo, List<TypeCandidate>>()
{
init {
val result = config.currentFile.analyzeFullyAndGetResult()
currentFileContext = result.bindingContext
currentFileModule = result.moduleDescriptor
@@ -217,7 +217,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) {
val substitutions: List<JetTypeSubstitution>
var released: Boolean = false
{
init {
// gather relevant information
val placement = placement
@@ -44,7 +44,7 @@ import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
private class ParameterNameExpression(
private val names: Array<String>,
private val parameterTypeToNamesMap: Map<String, Array<String>>) : Expression() {
{
init {
assert(names all { it.isNotEmpty() })
}
@@ -46,7 +46,7 @@ public class JetChangeSignatureData(
private val parameters: List<JetParameterInfo>
override val receiver: JetParameterInfo?
;{
init {
$receiver = createReceiverInfoIfNeeded()
val valueParameters = when {
@@ -21,7 +21,7 @@ import com.intellij.psi.*
import org.jetbrains.kotlin.psi.*
public abstract class AbstractIntroduceAction : BasePlatformRefactoringAction() {
{
init {
setInjectedContext(true)
}
@@ -179,7 +179,7 @@ abstract class OutputValueBoxer(val outputValues: List<OutputValue>) {
outputValues: List<OutputValue>,
val module: ModuleDescriptor
) : OutputValueBoxer(outputValues) {
{
init {
assert(outputValues.size() <= 3, "At most 3 output values are supported")
}
@@ -45,7 +45,7 @@ public class KotlinInplacePropertyIntroducer(
): KotlinInplaceVariableIntroducer(
property, editor, project, title, JetExpression.EMPTY_ARRAY, null, false, property, false, doNotChangeVar, exprType, false
) {
{
init {
assert(availableTargets.isNotEmpty(), "No targets available: ${JetPsiUtil.getElementTextWithContext(property)}")
}
@@ -37,7 +37,7 @@ public open class DialogWithEditor(
) : DialogWrapper(project, true) {
val editor: Editor = createEditor()
;{
init {
init()
setTitle(title)
}
@@ -30,7 +30,7 @@ import com.intellij.codeInsight.template.TemplateManager
import com.intellij.openapi.command.WriteCommandAction
public class InplaceRenameTest : LightPlatformCodeInsightTestCase() {
{
init {
System.setProperty("idea.platform.prefix", "Idea")
}
@@ -101,7 +101,7 @@ class DeferredElement<TResult : Element>(
private var result: TResult? = null
{
init {
assignNoPrototype()
}
@@ -125,7 +125,7 @@ class PolyadicExpression(val expressions: List<Expression>, val token: String) :
}
class LambdaExpression(val arguments: String?, val block: Block) : Expression() {
{
init {
assignPrototypesFrom(block)
}
@@ -55,7 +55,7 @@ public open class JsFunctionScope(parent: JsScope, description: String) : JsScop
private inner class LabelScope(parent: LabelScope?, val ident: String) : JsScope(parent, "Label scope for $ident", null) {
val labelName: JsName
{
init {
val freshIdent = when {
ident in RESERVED_WORDS -> getFreshIdent(ident)
parent != null -> parent.getFreshIdent(ident)
@@ -70,9 +70,9 @@ public class FunctionReader(private val context: TranslationContext) {
* Maps moduleName to kotlin object variable.
* The default variable is Kotlin, but it can be renamed by minifier.
*/
private val moduleKotlinVariable = hashMapOf<String, String>();
private val moduleKotlinVariable = hashMapOf<String, String>()
{
init {
val config = context.getConfig() as LibrarySourcesConfig
val libs = config.getLibraries().map { File(it) }
val files = LibraryUtils.readJsFiles(libs.map { it.getPath() }.toList())
@@ -50,9 +50,9 @@ public class DelegationTranslator(
classDeclaration.getDelegationSpecifiers().filterIsInstance<JetDelegatorByExpressionSpecifier>();
private class Field (val name: String, val generateField: Boolean)
private val fields = HashMap<JetDelegatorByExpressionSpecifier, Field>();
private val fields = HashMap<JetDelegatorByExpressionSpecifier, Field>()
{
init {
for (specifier in delegationBySpecifiers) {
val expression = specifier.getDelegateExpression() ?:
throw IllegalArgumentException("delegate expression should not be null: ${specifier.getText()}")
@@ -70,7 +70,7 @@ public object NumberAndCharConversionFIF : CompositeFIF() {
}
}
{
init {
add(USE_AS_IS!!, ConversionUnaryIntrinsic(ID))
for((stringPattern, intrinsic) in convertOperations) {
add(pattern(stringPattern), intrinsic)
@@ -186,7 +186,7 @@ class KModel(val context: BindingContext, val config: KDocConfig, val sourceDirs
val sourcesInfo: List<SourceInfo>
;{
init {
val normalizedSourceDirs: List<String> =
sourceDirs.map { file -> file.getCanonicalPath() }
@@ -214,7 +214,7 @@ class KModel(val context: BindingContext, val config: KDocConfig, val sourceDirs
fun sourceInfoByFile(file: JetFile) = sourceInfoByFile.get(file)!!
;{
init {
/** Loads the model from the given set of source files */
val allPackageFragments = HashSet<PackageFragmentDescriptor>()
for (source in sources) {