From 686cfa6fd29b8e096ea04a2b96e2dc08adced512 Mon Sep 17 00:00:00 2001 From: Marcin Moskala Date: Sun, 25 Nov 2018 23:35:33 +0300 Subject: [PATCH] Fix common misspellings --- .../kotlin/codegen/context/MethodContext.java | 2 +- .../jetbrains/kotlin/cfg/ControlFlowInfo.kt | 2 +- .../kotlin/kdoc/lexer/_KDocLexer.java | 3 +- .../org/jetbrains/kotlin/lexer/Kotlin.flex | 2 +- .../org/jetbrains/kotlin/lexer/_JetLexer.java | 9 ++-- .../serialization/ContractSerializer.kt | 2 +- .../nestedTryCatchFinally.instructions | 44 +++++++++---------- .../contracts/nestedTryCatchFinally.kt | 2 +- .../contracts/nestedTryCatchFinally.values | 34 +++++++------- .../contracts/labeledReturns.instructions | 10 ++--- .../cfgWithStdLib/contracts/labeledReturns.kt | 2 +- .../contracts/labeledReturns.values | 20 ++++----- compiler/testData/cli/js/inlineCycle.kt | 2 +- compiler/testData/cli/jvm/inlineCycle.kt | 2 +- .../tests/SyntaxErrorInTestHighlighting.kt | 2 +- .../withCompanion/typeIsLowEnough.kt | 2 +- .../withCompanion/withMembers_before.kt | 2 +- .../enum/InsideSecondaryConstructorCall.kt | 2 +- .../enum/InsideSecondaryConstructorCall.txt | 2 +- .../tests/enum/SecondaryConstructorCall.kt | 2 +- .../tests/enum/SecondaryConstructorCall.txt | 2 +- .../tests/generics/innerClasses/innerTP.kt | 2 +- .../tests/generics/innerClasses/innerTP.txt | 2 +- .../tests/generics/innerClasses/simple.kt | 2 +- .../tests/generics/innerClasses/simple.txt | 2 +- .../tests/generics/innerClasses/simpleIn.kt | 2 +- .../tests/generics/innerClasses/simpleIn.txt | 2 +- .../tests/generics/innerClasses/simpleOut.kt | 2 +- .../tests/generics/innerClasses/simpleOut.txt | 2 +- .../generics/innerClasses/simpleOutUseSite.kt | 2 +- .../innerClasses/simpleOutUseSite.txt | 2 +- ...aInValInitializerWithAnonymousFunctions.kt | 2 +- .../flowInlining/labeledReturns.kt | 2 +- .../flowInlining/nestedTryCatchFinally.kt | 2 +- .../contracts/fromStdlib/fromStandardKt.kt | 2 +- core/builtins/native/kotlin/Coroutines.kt | 2 +- .../generators/mockJDK/GenerateMockJdk.java | 2 +- .../generators/tests/GenerateTests.kt.as31 | 2 +- .../generators/tests/GenerateTests.kt.as32 | 2 +- .../generators/tests/GenerateTests.kt.as33 | 2 +- .../generators/tests/GenerateTests.kt.as34 | 2 +- .../internal/FindImplicitNothingAction.kt | 2 +- .../OnClassDeclarationWithNoPackage.kt | 4 +- .../OnClassDeclarationWithNoPackage.kt.173 | 4 +- .../receiverWithLambda2.kt | 2 +- idea/testData/kdoc/finder/Annotated.kt | 2 +- j2k/src/org/jetbrains/kotlin/j2k/ast/Util.kt | 2 +- .../google/gwt/dev/js/rhino/LineBuffer.java | 2 +- .../google/gwt/dev/js/rhino/TokenStream.java | 4 +- .../com/google/gwt/dev/js/rhino/UintMap.java | 2 +- js/js.translator/qunit/qunit.js | 2 +- .../src/js/jquery.js | 2 +- .../examples/browser-example/src/js/jquery.js | 2 +- .../experimental/jvm/util/jvmClasspathUtil.kt | 2 +- .../kotlin/gradle/plugin/KotlinPlugin.kt | 2 +- .../kapt3/test/AbstractKotlinKapt3Test.kt | 5 ++- .../backend/ir/SerializableIrGenerator.kt | 7 +-- .../checks/SupportAnnotationDetector.java.173 | 2 +- 58 files changed, 115 insertions(+), 123 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/context/MethodContext.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/context/MethodContext.java index 0ed416a9916..9b898469910 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/context/MethodContext.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/context/MethodContext.java @@ -87,7 +87,7 @@ public class MethodContext extends CodegenContext { public StackValue generateReceiver(@NotNull CallableDescriptor descriptor, @NotNull GenerationState state, boolean ignoreNoOuter) { // When generating bytecode of some suspend function, we replace the original descriptor with one that reflects how it should look on JVM. // But when we looking for receiver parameter in resolved call, it still references the initial function, so we unwrap it here - // before comparision. + // before comparison. if (CoroutineCodegenUtilKt.unwrapInitialDescriptorForSuspendFunction(getCallableDescriptorWithReceiver()) == descriptor) { return getReceiverExpression(state.getTypeMapper()); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInfo.kt b/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInfo.kt index 1a0d3dede13..c00c72dea10 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInfo.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowInfo.kt @@ -32,7 +32,7 @@ internal constructor( /** * This overload exists just for sake of optimizations: in some cases we've just retrieved the old value, - * so we don't need to scan through the peristent hashmap again + * so we don't need to scan through the persistent hashmap again */ fun put(key: VariableDescriptor, value: D, oldValue: D?): S { @Suppress("UNCHECKED_CAST") diff --git a/compiler/psi/src/org/jetbrains/kotlin/kdoc/lexer/_KDocLexer.java b/compiler/psi/src/org/jetbrains/kotlin/kdoc/lexer/_KDocLexer.java index 5ea432ee431..8e661ec5a33 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/kdoc/lexer/_KDocLexer.java +++ b/compiler/psi/src/org/jetbrains/kotlin/kdoc/lexer/_KDocLexer.java @@ -6,7 +6,6 @@ import com.intellij.lexer.FlexLexer; import com.intellij.psi.TokenType; import com.intellij.psi.tree.IElementType; import com.intellij.util.text.CharArrayUtil; -import java.lang.Character; import org.jetbrains.kotlin.kdoc.parser.KDocKnownTag; @@ -478,7 +477,7 @@ class _KDocLexer implements FlexLexer { /** - * Reports an error that occured while scanning. + * Reports an error that occurred while scanning. * * In a wellformed scanner (no or only correct usage of * yypushback(int) and a match-all fallback rule) this method diff --git a/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex b/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex index 829fd77bd72..0d89937d755 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex +++ b/compiler/psi/src/org/jetbrains/kotlin/lexer/Kotlin.flex @@ -83,7 +83,7 @@ LETTER = [:letter:]|_ IDENTIFIER_PART=[:digit:]|{LETTER} PLAIN_IDENTIFIER={LETTER} {IDENTIFIER_PART}* // TODO: this one MUST allow everything accepted by the runtime -// TODO: Replace backticks by one backslash in the begining +// TODO: Replace backticks with one backslash at the beginning ESCAPED_IDENTIFIER = `[^`\n]+` IDENTIFIER = {PLAIN_IDENTIFIER}|{ESCAPED_IDENTIFIER} FIELD_IDENTIFIER = \${IDENTIFIER} diff --git a/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java b/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java index f9b3409758a..24056500aaf 100644 --- a/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java +++ b/compiler/psi/src/org/jetbrains/kotlin/lexer/_JetLexer.java @@ -2,13 +2,10 @@ package org.jetbrains.kotlin.lexer; -import java.util.*; -import com.intellij.lexer.*; -import com.intellij.psi.*; +import com.intellij.lexer.FlexLexer; +import com.intellij.psi.TokenType; import com.intellij.psi.tree.IElementType; import com.intellij.util.containers.Stack; -import org.jetbrains.kotlin.lexer.KotlinLexerException; -import org.jetbrains.kotlin.lexer.KtTokens; /** @@ -781,7 +778,7 @@ class _JetLexer implements FlexLexer { /** - * Reports an error that occured while scanning. + * Reports an error that occurred while scanning. * * In a wellformed scanner (no or only correct usage of * yypushback(int) and a match-all fallback rule) this method diff --git a/compiler/serialization/src/org/jetbrains/kotlin/serialization/ContractSerializer.kt b/compiler/serialization/src/org/jetbrains/kotlin/serialization/ContractSerializer.kt index e0151cd08a2..cfa4f8df782 100644 --- a/compiler/serialization/src/org/jetbrains/kotlin/serialization/ContractSerializer.kt +++ b/compiler/serialization/src/org/jetbrains/kotlin/serialization/ContractSerializer.kt @@ -134,7 +134,7 @@ class ContractSerializer { } override fun visitIsNullPredicate(isNullPredicate: IsNullPredicate, data: Unit): ProtoBuf.Expression.Builder { - // get builder with variable embeded into it + // get builder with variable embedded into it val builder = visitVariableReference(isNullPredicate.arg, data) // set flags diff --git a/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.instructions b/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.instructions index 4fba5291736..ecfb1dc25ad 100644 --- a/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.instructions +++ b/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.instructions @@ -111,7 +111,7 @@ fun outerFinallyInitializes() { // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { - // can catch exception thrown by the inner, so x can be not initalized + // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) @@ -123,10 +123,10 @@ fun outerFinallyInitializes() { } --------------------- L0: - 1 INIT: in: {} out: {} USE: in: {} out: {} - 2 mark({ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() }) - v(val x: Int) INIT: in: {} out: {x=D} - mark(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=D} out: {x=D} + 1 INIT: in: {} out: {} USE: in: {} out: {} + 2 mark({ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() }) + v(val x: Int) INIT: in: {} out: {x=D} + mark(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=D} out: {x=D} jmp?(L2) jmp?(L3) 3 mark({ myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() }) @@ -135,7 +135,7 @@ L0: mark(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|) -> L4 [before inlined declaration]: - inlined({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) INIT: in: {x=ID} out: {x=ID} + inlined({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) INIT: in: {x=ID} out: {x=ID} L5 [after inlined declaration]: mark(outerComputation()) call(outerComputation(), outerComputation) -> @@ -144,38 +144,38 @@ L5 [after inlined declaration]: jmp?(L3) jmp(L10) L2 [onException]: - 3 v(e: java.lang.Exception) INIT: in: {x=I?D} out: {x=I?D} - magic[FAKE_INITIALIZER](e: java.lang.Exception) -> INIT: in: {x=I?D} out: {x=I?D} - w(e|) INIT: in: {x=I?D} out: {x=I?D} - 4 mark({ // can catch exception thrown by the inner, so x can be not initalized log() }) INIT: in: {x=I?D} out: {x=I?D} + 3 v(e: java.lang.Exception) INIT: in: {x=I?D} out: {x=I?D} + magic[FAKE_INITIALIZER](e: java.lang.Exception) -> INIT: in: {x=I?D} out: {x=I?D} + w(e|) INIT: in: {x=I?D} out: {x=I?D} + 4 mark({ // can catch exception thrown by the inner, so x can be not initialized log() }) INIT: in: {x=I?D} out: {x=I?D} mark(log()) call(log(), log) -> 3 jmp(L10) L10 [afterCatches]: - 2 jmp(L11) USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ} + 2 jmp(L11) USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ} L3 [onExceptionToFinallyBlock]: L12 [start finally]: 3 mark({ // Possible reassignment (e.g. if everything finished) x = 42 }) - r(42) -> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ} - w(x|) INIT: in: {x=I?D} out: {x=ID} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ} + r(42) -> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ} + w(x|) INIT: in: {x=I?D} out: {x=ID} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ} L13 [finish finally]: - 2 jmp(error) INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {} + 2 jmp(error) INIT: in: {x=ID} out: {x=ID} USE: in: {} out: {} L11 [skipFinallyToErrorBlock]: L14 [copy of L3, onExceptionToFinallyBlock]: - 3 mark({ // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=I?D} out: {x=I?D} - r(42) -> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ} - w(x|) INIT: in: {x=I?D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ} - 2 merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!, ) -> INIT: in: {x=ID} out: {x=ID} - mark(x.inc()) USE: in: {x=READ} out: {x=READ} - r(x) -> USE: in: {} out: {x=READ} + 3 mark({ // Possible reassignment (e.g. if everything finished) x = 42 }) INIT: in: {x=I?D} out: {x=I?D} + r(42) -> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ} + w(x|) INIT: in: {x=I?D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ} + 2 merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!, ) -> INIT: in: {x=ID} out: {x=ID} + mark(x.inc()) USE: in: {x=READ} out: {x=READ} + r(x) -> USE: in: {} out: {x=READ} mark(inc()) call(inc(), inc|) -> L1: - 1 INIT: in: {} out: {} + 1 INIT: in: {} out: {} error: sink: - USE: in: {} out: {} + USE: in: {} out: {} ===================== == inlined anonymous_1 == { diff --git a/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.kt b/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.kt index 0a0922b8342..e86a2b130b0 100644 --- a/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.kt +++ b/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.kt @@ -32,7 +32,7 @@ fun outerFinallyInitializes() { // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { - // can catch exception thrown by the inner, so x can be not initalized + // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) diff --git a/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.values b/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.values index 7ee176e20e7..8172eead53a 100644 --- a/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.values +++ b/compiler/testData/cfgVariablesWithStdLib/contracts/nestedTryCatchFinally.values @@ -59,7 +59,7 @@ fun outerFinallyInitializes() { // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { - // can catch exception thrown by the inner, so x can be not initalized + // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) @@ -70,22 +70,22 @@ fun outerFinallyInitializes() { x.inc() } --------------------- - : {<: Exception} NEW: magic[FAKE_INITIALIZER](e: java.lang.Exception) -> -{ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } : {<: () -> Unit} NEW: r({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) -> -myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } : * NEW: call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|) -> -outerComputation() : Int NEW: call(outerComputation(), outerComputation) -> -x = outerComputation() !: * -{ myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } !: * COPY -log() : * NEW: call(log(), log) -> -{ // can catch exception thrown by the inner, so x can be not initalized log() } : * COPY -42 : Int NEW: r(42) -> -x = 42 !: * -{ // Possible reassignment (e.g. if everything finished) x = 42 } !: * COPY -try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } : * NEW: merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!, ) -> -x : Int NEW: r(x) -> -inc() : * NEW: call(inc(), inc|) -> -x.inc() : * COPY -{ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initalized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() } : * COPY + : {<: Exception} NEW: magic[FAKE_INITIALIZER](e: java.lang.Exception) -> +{ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } : {<: () -> Unit} NEW: r({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) -> +myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } : * NEW: call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|) -> +outerComputation() : Int NEW: call(outerComputation(), outerComputation) -> +x = outerComputation() !: * +{ myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } !: * COPY +log() : * NEW: call(log(), log) -> +{ // can catch exception thrown by the inner, so x can be not initialized log() } : * COPY +42 : Int NEW: r(42) -> +x = 42 !: * +{ // Possible reassignment (e.g. if everything finished) x = 42 } !: * COPY +try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } : * NEW: merge(try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 }|!, ) -> +x : Int NEW: r(x) -> +inc() : * NEW: call(inc(), inc|) -> +x.inc() : * COPY +{ val x: Int try { myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } // Definite reassignment here, cause can get here only if myRun finished x = outerComputation() } catch (e: java.lang.Exception) { // can catch exception thrown by the inner, so x can be not initialized log() } finally { // Possible reassignment (e.g. if everything finished) x = 42 } // Properly initialized x.inc() } : * COPY ===================== == inlined anonymous_1 == { diff --git a/compiler/testData/cfgWithStdLib/contracts/labeledReturns.instructions b/compiler/testData/cfgWithStdLib/contracts/labeledReturns.instructions index ae285d4db56..f7156fd82fa 100644 --- a/compiler/testData/cfgWithStdLib/contracts/labeledReturns.instructions +++ b/compiler/testData/cfgWithStdLib/contracts/labeledReturns.instructions @@ -142,7 +142,7 @@ fun threeLayersReturn(x: Int?): Int? { // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally - // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization + // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { @@ -167,7 +167,7 @@ L0: v(x: Int?) magic[FAKE_INITIALIZER](x: Int?) -> w(x|) - 2 mark({ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() }) + 2 mark({ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() }) v(val y: Int) mark(outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }) mark({ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }) @@ -183,11 +183,11 @@ L3 [after inlined declaration]: call(inc(), inc|) -> ret(*|) L1 L1: - 1 NEXT:[] + 1 NEXT:[] error: - PREV:[] + PREV:[] sink: - PREV:[, ] + PREV:[, ] ===================== == inlined anonymous_2 == { diff --git a/compiler/testData/cfgWithStdLib/contracts/labeledReturns.kt b/compiler/testData/cfgWithStdLib/contracts/labeledReturns.kt index d989ef668ba..b23663ef37b 100644 --- a/compiler/testData/cfgWithStdLib/contracts/labeledReturns.kt +++ b/compiler/testData/cfgWithStdLib/contracts/labeledReturns.kt @@ -25,7 +25,7 @@ fun threeLayersReturn(x: Int?): Int? { // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally - // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization + // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { diff --git a/compiler/testData/cfgWithStdLib/contracts/labeledReturns.values b/compiler/testData/cfgWithStdLib/contracts/labeledReturns.values index da4bf06c5c8..ede5bc48416 100644 --- a/compiler/testData/cfgWithStdLib/contracts/labeledReturns.values +++ b/compiler/testData/cfgWithStdLib/contracts/labeledReturns.values @@ -72,7 +72,7 @@ fun threeLayersReturn(x: Int?): Int? { // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally - // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization + // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { @@ -92,15 +92,15 @@ fun threeLayersReturn(x: Int?): Int? { return y.inc() } --------------------- - : {<: Int?} NEW: magic[FAKE_INITIALIZER](x: Int?) -> -{ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } : {<: () -> Unit} NEW: r({ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }) -> -outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } : {<: () -> Unit} COPY -myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } : * NEW: call(myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }, myRun|) -> -y : Int NEW: r(y) -> -inc() : {<: Int?} NEW: call(inc(), inc|) -> -y.inc() : {<: Int?} COPY -return y.inc() !: * -{ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() } !: * COPY + : {<: Int?} NEW: magic[FAKE_INITIALIZER](x: Int?) -> +{ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } : {<: () -> Unit} NEW: r({ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }) -> +outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } : {<: () -> Unit} COPY +myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } : * NEW: call(myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 }, myRun|) -> +y : Int NEW: r(y) -> +inc() : {<: Int?} NEW: call(inc(), inc|) -> +y.inc() : {<: Int?} COPY +return y.inc() !: * +{ // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } return y.inc() } !: * COPY ===================== == inlined anonymous_2 == { diff --git a/compiler/testData/cli/js/inlineCycle.kt b/compiler/testData/cli/js/inlineCycle.kt index 5a92ab84ba5..09fc245f430 100644 --- a/compiler/testData/cli/js/inlineCycle.kt +++ b/compiler/testData/cli/js/inlineCycle.kt @@ -1,7 +1,7 @@ inline fun a(l: () -> Unit) { b(l) - //check taht nested not recognized as cycle + //check that nested not recognized as cycle c { c { diff --git a/compiler/testData/cli/jvm/inlineCycle.kt b/compiler/testData/cli/jvm/inlineCycle.kt index 5a92ab84ba5..09fc245f430 100644 --- a/compiler/testData/cli/jvm/inlineCycle.kt +++ b/compiler/testData/cli/jvm/inlineCycle.kt @@ -1,7 +1,7 @@ inline fun a(l: () -> Unit) { b(l) - //check taht nested not recognized as cycle + //check that nested not recognized as cycle c { c { diff --git a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt index 373cfbceda4..6698a262bcb 100644 --- a/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt +++ b/compiler/testData/diagnostics/tests/SyntaxErrorInTestHighlighting.kt @@ -1,4 +1,4 @@ -// dummy test of syntax error highlighing in tests +// dummy test of syntax error highlighting in tests fun get() { 1 + 2 2 3 4 diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/typeIsLowEnough.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/typeIsLowEnough.kt index 39572b1c951..8d655dc40ae 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/typeIsLowEnough.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/typeIsLowEnough.kt @@ -11,7 +11,7 @@ public class C { open fun m() {} } - // Note that Data is resolved succesfully here because we don't step on error-scope + // Note that Data is resolved successfully here because we don't step on error-scope val data: Data = Data() companion object : DerivedAbstract() { diff --git a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/withMembers_before.kt b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/withMembers_before.kt index 6d93190c4a5..846cae59100 100644 --- a/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/withMembers_before.kt +++ b/compiler/testData/diagnostics/tests/cyclicHierarchy/withCompanion/withMembers_before.kt @@ -50,7 +50,7 @@ object WithPropertyInBaseDifferentOrder { class Data public class C { - // Now it is succesfully resolved (vs. ErrorType like in the previous case) + // Now it is successfully resolved (vs. ErrorType like in the previous case) val data: Data = Data() open class Base() { diff --git a/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.kt b/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.kt index 52ff43276a6..642a321bd6e 100644 --- a/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.kt +++ b/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.kt @@ -3,7 +3,7 @@ enum class A(val c: Int) { ONE(1), TWO(2), THREE(3), - FOURTY_TWO(); + FORTY_TWO(); var last: A? = null diff --git a/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.txt b/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.txt index 06d80f5b40c..55100dbd899 100644 --- a/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.txt +++ b/compiler/testData/diagnostics/tests/enum/InsideSecondaryConstructorCall.txt @@ -7,7 +7,7 @@ public final enum class A : kotlin.Enum { enum entry THREE - enum entry FOURTY_TWO + enum entry FORTY_TWO private constructor A() private constructor A(/*0*/ c: kotlin.Int) diff --git a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt index 04a111c1625..303a241d6a0 100644 --- a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt +++ b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.kt @@ -3,7 +3,7 @@ enum class A(val c: Int) { ONE(1), TWO(2), THREE(3), - FOURTY_TWO(); + FORTY_TWO(); constructor(): this(42) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.txt b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.txt index 5abfbf2b566..631fc48bd93 100644 --- a/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.txt +++ b/compiler/testData/diagnostics/tests/enum/SecondaryConstructorCall.txt @@ -7,7 +7,7 @@ public final enum class A : kotlin.Enum { enum entry THREE - enum entry FOURTY_TWO + enum entry FORTY_TWO private constructor A() private constructor A(/*0*/ c: kotlin.Int) diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt index 8fe1399f96f..a363c97b8fd 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.kt @@ -21,7 +21,7 @@ class Outer { fun factoryString(): Outer.Inner = null!! fun infer(x: T, y: Y): Outer.Inner = null!! -val infered = infer("", 1) +val inferred = infer("", 1) fun main() { val outer = Outer() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.txt b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.txt index 86ce9322f75..b5ea168852e 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.txt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/innerTP.txt @@ -1,6 +1,6 @@ package -public val infered: Outer.Inner +public val inferred: Outer.Inner public fun factoryString(): Outer.Inner public fun infer(/*0*/ x: T, /*1*/ y: Y): Outer.Inner public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simple.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simple.kt index a6916b61b93..27496e385f4 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simple.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simple.kt @@ -15,7 +15,7 @@ class Outer { fun factoryString(): Outer.Inner = null!! fun infer(x: T): Outer.Inner = null!! -val infered = infer("") +val inferred = infer("") fun main() { val outer = Outer() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simple.txt b/compiler/testData/diagnostics/tests/generics/innerClasses/simple.txt index da3ede99eed..013c5ba0912 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simple.txt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simple.txt @@ -1,6 +1,6 @@ package -public val infered: Outer.Inner +public val inferred: Outer.Inner public fun factoryString(): Outer.Inner public fun infer(/*0*/ x: T): Outer.Inner public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.kt index 65e4b2bb9a9..314d98ec844 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.kt @@ -15,7 +15,7 @@ class Outer { fun factoryString(): Outer.Inner = null!! fun infer(x: T): Outer.Inner = null!! -val infered = infer("") +val inferred = infer("") fun main() { val outer = Outer() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.txt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.txt index b09a63fde23..95d309b0094 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.txt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleIn.txt @@ -1,6 +1,6 @@ package -public val infered: Outer.Inner +public val inferred: Outer.Inner public fun factoryString(): Outer.Inner public fun infer(/*0*/ x: T): Outer.Inner public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt index e7278ef8e55..e155df657c2 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.kt @@ -16,7 +16,7 @@ class Outer { fun factoryString(): Outer.Inner = null!! fun infer(x: T): Outer.Inner = null!! -val infered = infer("") +val inferred = infer("") fun main() { val outer = Outer() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.txt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.txt index a78a60887df..dca6abc971e 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.txt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOut.txt @@ -1,6 +1,6 @@ package -public val infered: Outer.Inner +public val inferred: Outer.Inner public fun factoryString(): Outer.Inner public fun infer(/*0*/ x: T): Outer.Inner public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt index 4de5d3edb9b..11897eb8fcc 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.kt @@ -16,7 +16,7 @@ class Outer { fun factoryString(): Outer.Inner = null!! fun infer(x: T): Outer.Inner = null!! -val infered = infer("") +val inferred = infer("") fun main() { val outer: Outer = Outer() diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.txt b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.txt index da3ede99eed..013c5ba0912 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.txt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/simpleOutUseSite.txt @@ -1,6 +1,6 @@ package -public val infered: Outer.Inner +public val inferred: Outer.Inner public fun factoryString(): Outer.Inner public fun infer(/*0*/ x: T): Outer.Inner public fun main(): kotlin.Unit diff --git a/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt b/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt index 7cea82da7a0..d9d93d2f604 100644 --- a/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt +++ b/compiler/testData/diagnostics/tests/inference/lambdaInValInitializerWithAnonymousFunctions.kt @@ -4,6 +4,6 @@ val test1f: suspend () -> Unit = fun () {} val test2f: suspend Any.() -> Unit = fun Any.() {} // This is a bug in the old inference and should be fixed in new inference -// see "Fix anonymous function literals handling in type checker" for more deatils +// see "Fix anonymous function literals handling in type checker" for more details val test3f: suspend Any.(Int) -> Int = fun (k: Int) = k + 1 val test4f: SuspendFn = fun Any.() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.kt index 8c8e497225e..80b25ca56e3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/labeledReturns.kt @@ -26,7 +26,7 @@ fun threeLevelsReturnNoInitialization(x: Int?): Int? { // Inner always jumps to outer // And middle always calls inner // So, in fact, middle never finished normally - // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initalization + // Hence 'y = 54' in middle is unreachable, and middle doesn't performs definite initialization // Hence, outer doesn't performs definite initialization val y: Int myRun outer@ { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.kt index 48ec5e854ff..4d4f0a72ce5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/controlflow/flowInlining/nestedTryCatchFinally.kt @@ -35,7 +35,7 @@ fun outerFinallyInitializes() { // Not reported because of repeating diagnostic x = outerComputation() } catch (e: java.lang.Exception) { - // can catch exception thrown by the inner, so x can be not initalized + // can catch exception thrown by the inner, so x can be not initialized x.inc() log() } finally { diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.kt index b102d8b9033..1a67b8d4cd2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/fromStdlib/fromStandardKt.kt @@ -85,7 +85,7 @@ fun testTakeUnless(x: Int?) { fun testRepeatOnVal(x: Int) { val y: Int repeat(x) { - // reassignment instead of captured val initalization + // reassignment instead of captured val initialization y = 42 } println(y) diff --git a/core/builtins/native/kotlin/Coroutines.kt b/core/builtins/native/kotlin/Coroutines.kt index 9d78a4d85ba..73b40f68468 100644 --- a/core/builtins/native/kotlin/Coroutines.kt +++ b/core/builtins/native/kotlin/Coroutines.kt @@ -6,7 +6,7 @@ package kotlin.coroutines /** - * This is neccesary to force generation of coroutines.kotlin_builtins file, thus providing builtin package fragment for kotlin.coroutines + * This is necessary to force generation of coroutines.kotlin_builtins file, thus providing builtin package fragment for kotlin.coroutines * package. This way we can use kotlin.coroutines.SuspendFunction{N} interfaces in code. */ private fun hackToForceKotlinBuiltinsForKotlinCoroutinesPackage() {} diff --git a/generators/tests/org/jetbrains/kotlin/generators/mockJDK/GenerateMockJdk.java b/generators/tests/org/jetbrains/kotlin/generators/mockJDK/GenerateMockJdk.java index 57239f67e3c..d397c6f602d 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/mockJDK/GenerateMockJdk.java +++ b/generators/tests/org/jetbrains/kotlin/generators/mockJDK/GenerateMockJdk.java @@ -296,7 +296,7 @@ public class GenerateMockJdk { List sourceList = Collections.list(sourceJar.entries()); for (JarEntry entry : sourceList) { - // For Map$Entry.class we want to check Map.class presense + // For Map$Entry.class we want to check Map.class presence String topLevelClassFile = entry.getName().replaceAll("\\$.+\\.class$", ".class"); if (entryNamesToInclude.contains(topLevelClassFile) && foundEntries.add(entry.getName())) { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 index 4d8594ed9dc..fe3ae2f1c24 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 @@ -790,7 +790,7 @@ fun main(args: Array) { } /* - // Maven and Gradle are not relevent for AS branch + // Maven and Gradle are not relevant for AS branch testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 index 4d8594ed9dc..fe3ae2f1c24 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 @@ -790,7 +790,7 @@ fun main(args: Array) { } /* - // Maven and Gradle are not relevent for AS branch + // Maven and Gradle are not relevant for AS branch testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 index 38b7d7a3c78..d230856b65b 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 @@ -782,7 +782,7 @@ fun main(args: Array) { } /* - // Maven and Gradle are not relevent for AS branch + // Maven and Gradle are not relevant for AS branch testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 index 38b7d7a3c78..d230856b65b 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 @@ -782,7 +782,7 @@ fun main(args: Array) { } /* - // Maven and Gradle are not relevent for AS branch + // Maven and Gradle are not relevant for AS branch testGroup("idea/idea-maven/test", "idea/idea-maven/testData") { testClass { diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/internal/FindImplicitNothingAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/internal/FindImplicitNothingAction.kt index f3dbee6f0ed..b086b1ca25f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/internal/FindImplicitNothingAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/actions/internal/FindImplicitNothingAction.kt @@ -66,7 +66,7 @@ class FindImplicitNothingAction : AnAction() { val progressIndicator = ProgressManager.getInstance().progressIndicatorNullable val found = ArrayList() for ((i, file) in files.withIndex()) { - progressIndicator?.text = "Scanning files: $i of ${files.size} file. ${found.size} occurences found" + progressIndicator?.text = "Scanning files: $i of ${files.size} file. ${found.size} occurrences found" progressIndicator?.text2 = file.virtualFile.path val resolutionFacade = file.getResolutionFacade() diff --git a/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt b/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt index e733e0260ba..ed9d8b378e3 100644 --- a/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt +++ b/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt @@ -1,6 +1,6 @@ /** - * Usefull comment + * Useful comment */ class Some -//INFO:
OnClassDeclarationWithNoPackage.kt
public final class Some

Usefull comment

+//INFO:
OnClassDeclarationWithNoPackage.kt
public final class Some

Useful comment

diff --git a/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt.173 b/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt.173 index a2dd4bad33f..62c5d412472 100644 --- a/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt.173 +++ b/idea/testData/editor/quickDoc/OnClassDeclarationWithNoPackage.kt.173 @@ -1,6 +1,6 @@ /** - * Usefull comment + * Useful comment */ class Some -//INFO:
public final class Some defined in root package in file OnClassDeclarationWithNoPackage.kt

Usefull comment

+//INFO:
public final class Some defined in root package in file OnClassDeclarationWithNoPackage.kt

Useful comment

diff --git a/idea/testData/intentions/replaceSingleLineLetIntention/receiverWithLambda2.kt b/idea/testData/intentions/replaceSingleLineLetIntention/receiverWithLambda2.kt index 6416ef63873..a081fea06e5 100644 --- a/idea/testData/intentions/replaceSingleLineLetIntention/receiverWithLambda2.kt +++ b/idea/testData/intentions/replaceSingleLineLetIntention/receiverWithLambda2.kt @@ -1,6 +1,6 @@ // WITH_RUNTIME // IS_APPLICABLE: false -// This should be reported. However, in order to avoid too complecate logic, the intention ignore this case. +// This should be reported. However, in order to avoid too complicate logic, the intention ignore this case. import java.util.* diff --git a/idea/testData/kdoc/finder/Annotated.kt b/idea/testData/kdoc/finder/Annotated.kt index ebad6933a3b..9cc9d1394ac 100644 --- a/idea/testData/kdoc/finder/Annotated.kt +++ b/idea/testData/kdoc/finder/Annotated.kt @@ -1,5 +1,5 @@ class Foo() { - @Supress("unused") + @Suppress("unused") /** Doc for method xyzzy */ fun xyzzy(): Int = 0 } \ No newline at end of file diff --git a/j2k/src/org/jetbrains/kotlin/j2k/ast/Util.kt b/j2k/src/org/jetbrains/kotlin/j2k/ast/Util.kt index 6477a219f61..594dddd78d8 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/ast/Util.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/ast/Util.kt @@ -22,7 +22,7 @@ fun CodeBuilder.appendWithPrefix(element: Element, prefix: String): CodeBuilder fun CodeBuilder.appendWithSuffix(element: Element, suffix: String): CodeBuilder = if (!element.isEmpty) this append element append suffix else this fun CodeBuilder.appendOperand(expression: Expression, operand: Expression, parenthesisForSamePrecedence: Boolean = false): CodeBuilder { - val parentPrecedence = expression.precedence() ?: throw IllegalArgumentException("Unknown precendence for $expression") + val parentPrecedence = expression.precedence() ?: throw IllegalArgumentException("Unknown precedence for $expression") val operandPrecedence = operand.precedence() val needParenthesis = operandPrecedence != null && (parentPrecedence < operandPrecedence || parentPrecedence == operandPrecedence && parenthesisForSamePrecedence) diff --git a/js/js.parser/src/com/google/gwt/dev/js/rhino/LineBuffer.java b/js/js.parser/src/com/google/gwt/dev/js/rhino/LineBuffer.java index 5769eebf34e..6225478bb5e 100644 --- a/js/js.parser/src/com/google/gwt/dev/js/rhino/LineBuffer.java +++ b/js/js.parser/src/com/google/gwt/dev/js/rhino/LineBuffer.java @@ -284,7 +284,7 @@ final class LineBuffer { // If the last character of the previous fill was a carriage return, // then ignore a newline. - // There's another bizzare special case here. If lastWasCR is + // There's another bizarre special case here. If lastWasCR is // true, and we see a newline, and the buffer length is // 1... then we probably just read the last character of the // file, and returning after advancing offset is not the right diff --git a/js/js.parser/src/com/google/gwt/dev/js/rhino/TokenStream.java b/js/js.parser/src/com/google/gwt/dev/js/rhino/TokenStream.java index 4d74230ed71..017f05b0b20 100644 --- a/js/js.parser/src/com/google/gwt/dev/js/rhino/TokenStream.java +++ b/js/js.parser/src/com/google/gwt/dev/js/rhino/TokenStream.java @@ -1487,8 +1487,8 @@ public class TokenStream { private int op; public boolean treatKeywordAsIdentifier; - // Set this to an inital non-null value so that the Parser has - // something to retrieve even if an error has occured and no + // Set this to an initial non-null value so that the Parser has + // something to retrieve even if an error has occurred and no // string is found. Fosters one class of error, but saves lots of // code. private String string = ""; diff --git a/js/js.parser/src/com/google/gwt/dev/js/rhino/UintMap.java b/js/js.parser/src/com/google/gwt/dev/js/rhino/UintMap.java index 847b7958080..29646921590 100644 --- a/js/js.parser/src/com/google/gwt/dev/js/rhino/UintMap.java +++ b/js/js.parser/src/com/google/gwt/dev/js/rhino/UintMap.java @@ -452,6 +452,6 @@ class UintMap implements Serializable { // values associated with keys private transient int ivaluesShift; -// If true, enables consitency checks +// If true, enables consistency checks private static final boolean check = false; } diff --git a/js/js.translator/qunit/qunit.js b/js/js.translator/qunit/qunit.js index 3b78401fafa..8ab0f3100ae 100644 --- a/js/js.translator/qunit/qunit.js +++ b/js/js.translator/qunit/qunit.js @@ -341,7 +341,7 @@ QUnit = { test.queue(); }, - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. + // Specify the number of expected assertions to guarantee that failed test (no assertions are run at all) don't slip through. expect: function( asserts ) { config.current.expected = asserts; }, diff --git a/libraries/examples/browser-example-with-library/src/js/jquery.js b/libraries/examples/browser-example-with-library/src/js/jquery.js index f3201aacb6f..09448eafcf9 100644 --- a/libraries/examples/browser-example-with-library/src/js/jquery.js +++ b/libraries/examples/browser-example-with-library/src/js/jquery.js @@ -7878,7 +7878,7 @@ if ( jQuery.support.ajax ) { xml; // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured + // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { diff --git a/libraries/examples/browser-example/src/js/jquery.js b/libraries/examples/browser-example/src/js/jquery.js index f3201aacb6f..09448eafcf9 100644 --- a/libraries/examples/browser-example/src/js/jquery.js +++ b/libraries/examples/browser-example/src/js/jquery.js @@ -7878,7 +7878,7 @@ if ( jQuery.support.ajax ) { xml; // Firefox throws exceptions when accessing properties - // of an xhr when a network error occured + // of an xhr when a network error occurred // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { diff --git a/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt b/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt index e62c13b9f42..dfb167a3b8c 100644 --- a/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt +++ b/libraries/scripting/jvm/src/kotlin/script/experimental/jvm/util/jvmClasspathUtil.kt @@ -173,7 +173,7 @@ object KotlinJars { ?: classpathFromClassloader(Thread.currentThread().contextClassLoader)?.takeIf { it.isNotEmpty() } ?: classpathFromClasspathProperty() )?.filter { f -> kotlinBaseJars.any { f.matchMaybeVersionedFile(it) } }?.takeIf { it.isNotEmpty() } - // if autodetected, additionaly check for presense of the compiler jars + // if autodetected, additionally check for presence of the compiler jars if (classpath == null || (explicitCompilerClasspath == null && classpath.none { f -> kotlinCompilerJars.any { f.matchMaybeVersionedFile(it) } })) { throw FileNotFoundException("Cannot find kotlin compiler jar, set kotlin.compiler.classpath property to proper location") } diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt index 6c052b5c3b9..b8e1c02a842 100755 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinPlugin.kt @@ -816,7 +816,7 @@ internal fun configureJavaTask(kotlinTask: KotlinCompile, javaTask: AbstractComp * It's important to modify javaTask.classpath only in doFirst, * because Android plugin uses ConventionMapping to modify it too (see JavaCompileConfigAction.execute), * and setting classpath explicitly prevents usage of Android mappings. - * Also classpath setted by Android can be modified after excecution of some tasks (see VarianConfiguration.getCompileClasspath) + * Also classpath set by Android can be modified after execution of some tasks (see VarianConfiguration.getCompileClasspath) * ex. it adds some support libraries jars after execution of prepareComAndroidSupportSupportV42311Library task, * so it's only safe to modify javaTask.classpath right before its usage */ diff --git a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3Test.kt b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3Test.kt index 70a868fd933..64e4ad8200d 100644 --- a/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3Test.kt +++ b/plugins/kapt3/kapt3-compiler/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3Test.kt @@ -35,13 +35,14 @@ import org.jetbrains.kotlin.cli.jvm.config.JvmClasspathRoot import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.extensions.StorageComponentContainerContributor import org.jetbrains.kotlin.kapt.base.test.JavaKaptContextTest -import org.jetbrains.kotlin.kapt3.* import org.jetbrains.kotlin.kapt3.Kapt3ComponentRegistrar.KaptComponentContributor +import org.jetbrains.kotlin.kapt3.KaptContextForStubGeneration import org.jetbrains.kotlin.kapt3.base.KaptContext import org.jetbrains.kotlin.kapt3.base.doAnnotationProcessing import org.jetbrains.kotlin.kapt3.base.javac.KaptJavaLog import org.jetbrains.kotlin.kapt3.base.parseJavaFiles import org.jetbrains.kotlin.kapt3.javac.KaptJavaFileObject +import org.jetbrains.kotlin.kapt3.prettyPrint import org.jetbrains.kotlin.kapt3.stubs.ClassFileToSourceStubConverter import org.jetbrains.kotlin.kapt3.util.MessageCollectorBackedKaptLogger import org.jetbrains.kotlin.psi.KtFile @@ -204,7 +205,7 @@ abstract class AbstractKotlinKapt3Test : CodegenTestCase() { val actualFile = File(tree.sourceFile.toUri()) // By default, JavaFileObject.getName() returns the absolute path to the file. - // In our test, such a path will be temporary, so the comparision against it will lead to flaky tests. + // In our test, such a path will be temporary, so the comparison against it will lead to flaky tests. tree.sourcefile = KaptJavaFileObject(tree, tree.defs.firstIsInstance(), actualFile) } diff --git a/plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/ir/SerializableIrGenerator.kt b/plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/ir/SerializableIrGenerator.kt index 9412c7e5761..475730cd392 100644 --- a/plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/ir/SerializableIrGenerator.kt +++ b/plugins/kotlin-serialization/kotlin-serialization-compiler/src/org/jetbrains/kotlinx/serialization/compiler/backend/ir/SerializableIrGenerator.kt @@ -5,18 +5,13 @@ import org.jetbrains.kotlin.backend.common.lower.irThrow import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.FunctionDescriptor -import org.jetbrains.kotlin.descriptors.ParameterDescriptor import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer import org.jetbrains.kotlin.ir.declarations.IrClass -import org.jetbrains.kotlin.ir.declarations.IrField import org.jetbrains.kotlin.ir.declarations.IrProperty import org.jetbrains.kotlin.ir.expressions.IrExpression -import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin -import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl import org.jetbrains.kotlin.ir.util.SymbolTable import org.jetbrains.kotlin.ir.util.TypeTranslator -import org.jetbrains.kotlin.ir.util.constructors import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassOrAny import org.jetbrains.kotlin.resolve.descriptorUtil.module @@ -76,7 +71,7 @@ class SerializableIrGenerator( +irIfThenElse(compilerContext.irBuiltIns.unitType, propNotSeenTest, ifNotSeenExpr, assignParamExpr) } - // remaining initalizers of variables + // remaining initializers of variables val serialDescs = properties.serializableProperties.map { it.descriptor }.toSet() irClass.declarations.asSequence() .filterIsInstance() diff --git a/plugins/lint/lint-checks/src/com/android/tools/klint/checks/SupportAnnotationDetector.java.173 b/plugins/lint/lint-checks/src/com/android/tools/klint/checks/SupportAnnotationDetector.java.173 index fd196574ad2..2fd297aeba6 100644 --- a/plugins/lint/lint-checks/src/com/android/tools/klint/checks/SupportAnnotationDetector.java.173 +++ b/plugins/lint/lint-checks/src/com/android/tools/klint/checks/SupportAnnotationDetector.java.173 @@ -556,7 +556,7 @@ public class SupportAnnotationDetector extends Detector implements Detector.Uast /** * Visitor which looks through a method, up to a given call (the one requiring a - * permission) and checks whether it's preceeded by a call to checkPermission or + * permission) and checks whether it's preceded by a call to checkPermission or * checkCallingPermission or enforcePermission etc. *

* Currently it only looks for the presence of this check; it does not perform