Fix common misspellings

This commit is contained in:
Marcin Moskala
2018-11-25 23:35:33 +03:00
committed by Nikolay Krasko
parent 33961acb8d
commit 686cfa6fd2
58 changed files with 115 additions and 123 deletions
@@ -87,7 +87,7 @@ public class MethodContext extends CodegenContext<CallableMemberDescriptor> {
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());
}
@@ -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")
@@ -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
@@ -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}
@@ -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
@@ -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
@@ -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 <START> 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 <START> 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|<v0>) -> <v1>
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) -> <v2>
@@ -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) -> <v4> INIT: in: {x=I?D} out: {x=I?D}
w(e|<v4>) 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) -> <v4> INIT: in: {x=I?D} out: {x=I?D}
w(e|<v4>) 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) -> <v5>
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) -> <v6> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ}
w(x|<v6>) INIT: in: {x=I?D} out: {x=ID} USE: in: {} out: {x=ONLY_WRITTEN_NEVER_READ}
r(42) -> <v6> USE: in: {x=ONLY_WRITTEN_NEVER_READ} out: {x=ONLY_WRITTEN_NEVER_READ}
w(x|<v6>) 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) -> <v6> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v6>) 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 }|!<v3>, <v5>) -> <v8> INIT: in: {x=ID} out: {x=ID}
mark(x.inc()) USE: in: {x=READ} out: {x=READ}
r(x) -> <v9> 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) -> <v6> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v6>) 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 }|!<v3>, <v5>) -> <v8> INIT: in: {x=ID} out: {x=ID}
mark(x.inc()) USE: in: {x=READ} out: {x=READ}
r(x) -> <v9> USE: in: {} out: {x=READ}
mark(inc())
call(inc(), inc|<v9>) -> <v10>
L1:
1 <END> INIT: in: {} out: {}
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
<SINK> USE: in: {} out: {}
=====================
== inlined anonymous_1 ==
{
@@ -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)
@@ -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()
}
---------------------
<v4>: {<: Exception} NEW: magic[FAKE_INITIALIZER](e: java.lang.Exception) -> <v4>
{ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v0>: {<: () -> Unit} NEW: r({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) -> <v0>
myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v1>: * NEW: call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|<v0>) -> <v1>
outerComputation() <v2>: Int NEW: call(outerComputation(), outerComputation) -> <v2>
x = outerComputation() !<v3>: *
{ 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() } !<v3>: * COPY
log() <v5>: * NEW: call(log(), log) -> <v5>
{ // can catch exception thrown by the inner, so x can be not initalized log() } <v5>: * COPY
42 <v6>: Int NEW: r(42) -> <v6>
x = 42 !<v7>: *
{ // Possible reassignment (e.g. if everything finished) x = 42 } !<v7>: * 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 } <v8>: * 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 }|!<v3>, <v5>) -> <v8>
x <v9>: Int NEW: r(x) -> <v9>
inc() <v10>: * NEW: call(inc(), inc|<v9>) -> <v10>
x.inc() <v10>: * 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() } <v10>: * COPY
<v4>: {<: Exception} NEW: magic[FAKE_INITIALIZER](e: java.lang.Exception) -> <v4>
{ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v0>: {<: () -> Unit} NEW: r({ try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }) -> <v0>
myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 } <v1>: * NEW: call(myRun { try { x = innerComputation() } catch (e: java.lang.Exception) { log() } // possible reassignment if innerComputation finished x = 42 }, myRun|<v0>) -> <v1>
outerComputation() <v2>: Int NEW: call(outerComputation(), outerComputation) -> <v2>
x = outerComputation() !<v3>: *
{ 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() } !<v3>: * COPY
log() <v5>: * NEW: call(log(), log) -> <v5>
{ // can catch exception thrown by the inner, so x can be not initialized log() } <v5>: * COPY
42 <v6>: Int NEW: r(42) -> <v6>
x = 42 !<v7>: *
{ // Possible reassignment (e.g. if everything finished) x = 42 } !<v7>: * 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 } <v8>: * 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 }|!<v3>, <v5>) -> <v8>
x <v9>: Int NEW: r(x) -> <v9>
inc() <v10>: * NEW: call(inc(), inc|<v9>) -> <v10>
x.inc() <v10>: * 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() } <v10>: * COPY
=====================
== inlined anonymous_1 ==
{
@@ -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?) -> <v0>
w(x|<v0>)
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|<v3>) -> <v4>
ret(*|<v4>) L1
L1:
1 <END> NEXT:[<SINK>]
1 <END> NEXT:[<SINK>]
error:
<ERROR> PREV:[]
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
<SINK> PREV:[<ERROR>, <END>]
=====================
== inlined anonymous_2 ==
{
@@ -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@ {
@@ -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()
}
---------------------
<v0>: {<: Int?} NEW: magic[FAKE_INITIALIZER](x: Int?) -> <v0>
{ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> 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 }) -> <v1>
outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> 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 } <v2>: * 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|<v1>) -> <v2>
y <v3>: Int NEW: r(y) -> <v3>
inc() <v4>: {<: Int?} NEW: call(inc(), inc|<v3>) -> <v4>
y.inc() <v4>: {<: Int?} COPY
return y.inc() !<v5>: *
{ // 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() } !<v5>: * COPY
<v0>: {<: Int?} NEW: magic[FAKE_INITIALIZER](x: Int?) -> <v0>
{ myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> 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 }) -> <v1>
outer@ { myRun middle@ { x.myLet inner@ { if (it == null) { return@outer Unit } else { return@outer Unit } } } // Possible to report unreachable here y = 54 } <v1>: {<: () -> 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 } <v2>: * 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|<v1>) -> <v2>
y <v3>: Int NEW: r(y) -> <v3>
inc() <v4>: {<: Int?} NEW: call(inc(), inc|<v3>) -> <v4>
y.inc() <v4>: {<: Int?} COPY
return y.inc() !<v5>: *
{ // 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() } !<v5>: * COPY
=====================
== inlined anonymous_2 ==
{
+1 -1
View File
@@ -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 {
+1 -1
View File
@@ -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 {
@@ -1,4 +1,4 @@
// dummy test of syntax error highlighing in tests
// dummy test of syntax error highlighting in tests
fun get() {
1 + 2 <!SYNTAX!>2 3 4<!>
@@ -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 <!CYCLIC_SCOPES_WITH_COMPANION!>object<!> : DerivedAbstract() {
@@ -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 <!CYCLIC_SCOPES_WITH_COMPANION!>Base<!>() {
@@ -3,7 +3,7 @@ enum class A(val c: Int) {
ONE(1),
TWO(2),
THREE(3),
FOURTY_TWO();
FORTY_TWO();
var last: A? = null
@@ -7,7 +7,7 @@ public final enum class A : kotlin.Enum<A> {
enum entry THREE
enum entry FOURTY_TWO
enum entry FORTY_TWO
private constructor A()
private constructor A(/*0*/ c: kotlin.Int)
@@ -3,7 +3,7 @@ enum class A(val c: Int) {
ONE(1),
TWO(2),
THREE(3),
FOURTY_TWO();
FORTY_TWO();
constructor(): this(42)
}
@@ -7,7 +7,7 @@ public final enum class A : kotlin.Enum<A> {
enum entry THREE
enum entry FOURTY_TWO
enum entry FORTY_TWO
private constructor A()
private constructor A(/*0*/ c: kotlin.Int)
@@ -21,7 +21,7 @@ class Outer<E> {
fun factoryString(): Outer<String>.Inner<String> = null!!
fun <T, Y> infer(x: T, y: Y): Outer<T>.Inner<Y> = null!!
val infered = infer("", 1)
val inferred = infer("", 1)
fun main() {
val outer = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner<kotlin.Int>
public val inferred: Outer<kotlin.String>.Inner<kotlin.Int>
public fun factoryString(): Outer<kotlin.String>.Inner<kotlin.String>
public fun </*0*/ T, /*1*/ Y> infer(/*0*/ x: T, /*1*/ y: Y): Outer<T>.Inner<Y>
public fun main(): kotlin.Unit
@@ -15,7 +15,7 @@ class Outer<E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -15,7 +15,7 @@ class Outer<in E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer = Outer<CharSequence>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -16,7 +16,7 @@ class Outer<out E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -16,7 +16,7 @@ class Outer<E> {
fun factoryString(): Outer<String>.Inner = null!!
fun <T> infer(x: T): Outer<T>.Inner = null!!
val infered = infer("")
val inferred = infer("")
fun main() {
val outer: Outer<out String> = Outer<String>()
@@ -1,6 +1,6 @@
package
public val infered: Outer<kotlin.String>.Inner
public val inferred: Outer<kotlin.String>.Inner
public fun factoryString(): Outer<kotlin.String>.Inner
public fun </*0*/ T> infer(/*0*/ x: T): Outer<T>.Inner
public fun main(): kotlin.Unit
@@ -4,6 +4,6 @@ val test1f: suspend () -> Unit = <!TYPE_MISMATCH!>fun () {}<!>
val test2f: suspend Any.() -> Unit = <!TYPE_MISMATCH!>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 = <!TYPE_MISMATCH!>fun (k: Int) = k + 1<!>
val test4f: SuspendFn = <!TYPE_MISMATCH!>fun Any.() {}<!>
@@ -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@ {
@@ -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
<!UNINITIALIZED_VARIABLE!>x<!>.inc()
log()
} finally {
@@ -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
<!VAL_REASSIGNMENT!>y<!> = 42
}
println(<!UNINITIALIZED_VARIABLE!>y<!>)
+1 -1
View File
@@ -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() {}
@@ -296,7 +296,7 @@ public class GenerateMockJdk {
List<JarEntry> 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())) {
@@ -790,7 +790,7 @@ fun main(args: Array<String>) {
}
/*
// 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<AbstractMavenConfigureProjectByChangingFileTest> {
@@ -790,7 +790,7 @@ fun main(args: Array<String>) {
}
/*
// 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<AbstractMavenConfigureProjectByChangingFileTest> {
@@ -782,7 +782,7 @@ fun main(args: Array<String>) {
}
/*
// 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<AbstractMavenConfigureProjectByChangingFileTest> {
@@ -782,7 +782,7 @@ fun main(args: Array<String>) {
}
/*
// 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<AbstractMavenConfigureProjectByChangingFileTest> {
@@ -66,7 +66,7 @@ class FindImplicitNothingAction : AnAction() {
val progressIndicator = ProgressManager.getInstance().progressIndicatorNullable
val found = ArrayList<KtCallExpression>()
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()
@@ -1,6 +1,6 @@
/**
* Usefull comment
* Useful comment
*/
class <caret>Some
//INFO: <div class='definition'><pre><font color="808080"><i>OnClassDeclarationWithNoPackage.kt</i></font><br>public final class <b>Some</b></pre></div><div class='content'><p>Usefull comment</p></div><table class='sections'></table>
//INFO: <div class='definition'><pre><font color="808080"><i>OnClassDeclarationWithNoPackage.kt</i></font><br>public final class <b>Some</b></pre></div><div class='content'><p>Useful comment</p></div><table class='sections'></table>
@@ -1,6 +1,6 @@
/**
* Usefull comment
* Useful comment
*/
class <caret>Some
//INFO: <pre><b>public</b> <b>final</b> <b>class</b> Some <i>defined in</i> root package <i>in file</i> OnClassDeclarationWithNoPackage.kt</pre><p>Usefull comment</p>
//INFO: <pre><b>public</b> <b>final</b> <b>class</b> Some <i>defined in</i> root package <i>in file</i> OnClassDeclarationWithNoPackage.kt</pre><p>Useful comment</p>
@@ -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.*
+1 -1
View File
@@ -1,5 +1,5 @@
class Foo() {
@Supress("unused")
@Suppress("unused")
/** Doc for method xyzzy */
fun xyzzy(): Int = 0
}
+1 -1
View File
@@ -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)
@@ -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
@@ -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 = "";
@@ -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;
}
+1 -1
View File
@@ -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;
},
@@ -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 {
+1 -1
View File
@@ -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 {
@@ -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")
}
@@ -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
*/
@@ -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)
}
@@ -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<IrProperty>()
@@ -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.
* <p>
* Currently it only looks for the presence of this check; it does not perform