Fix "infix modifier required" errors in project
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@ public open class MethodAnalyzer<V : Value>(
|
||||
frames[instructions.indexOf(insn)]
|
||||
|
||||
private fun checkAssertions() {
|
||||
if (instructions.toArray() any { it.getOpcode() == Opcodes.JSR || it.getOpcode() == Opcodes.RET })
|
||||
if (instructions.toArray().any { it.getOpcode() == Opcodes.JSR || it.getOpcode() == Opcodes.RET })
|
||||
throw AssertionError("Subroutines are deprecated since Java 6")
|
||||
}
|
||||
|
||||
|
||||
@@ -36,10 +36,10 @@ found top-level declarations to <destination dir> (files such as
|
||||
|
||||
val destDir = File(args[0])
|
||||
|
||||
val srcDirs = args drop(1) map { File(it) }
|
||||
val srcDirs = args.drop(1).map { File(it) }
|
||||
assert(srcDirs.isNotEmpty()) { "At least one source directory should be specified" }
|
||||
|
||||
val missing = srcDirs filterNot { it.exists() }
|
||||
val missing = srcDirs.filterNot { it.exists() }
|
||||
assert(missing.isEmpty()) { "These source directories are missing: $missing" }
|
||||
|
||||
BuiltInsSerializer(dependOnOldBuiltIns = false).serialize(destDir, srcDirs, listOf()) { totalSize, totalFiles ->
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.cli.jvm.repl.ReplFromTerminal
|
||||
import java.io.File
|
||||
|
||||
public class ConsoleReplCommandReader : ReplCommandReader {
|
||||
private val consoleReader = ConsoleReader("kotlin", System.`in`, System.`out`, null) apply {
|
||||
private val consoleReader = ConsoleReader("kotlin", System.`in`, System.`out`, null).apply {
|
||||
isHistoryEnabled = true
|
||||
expandEvents = false
|
||||
history = FileHistory(File(File(System.getProperty("user.home")), ".kotlin_history"))
|
||||
|
||||
@@ -412,7 +412,7 @@ public val KtDeclaration.containingClassOrObject: KtClassOrObject?
|
||||
get() = (parent as? KtClassBody)?.parent as? KtClassOrObject
|
||||
|
||||
public fun KtExpression.getOutermostParenthesizerOrThis(): KtExpression {
|
||||
return (parentsWithSelf zip parents).firstOrNull {
|
||||
return (parentsWithSelf.zip(parents)).firstOrNull {
|
||||
val (element, parent) = it
|
||||
when (parent) {
|
||||
is KtParenthesizedExpression -> false
|
||||
|
||||
@@ -37,7 +37,7 @@ public class KotlinObjectStubImpl(
|
||||
) : KotlinStubBaseImpl<KtObjectDeclaration>(parent, KtStubElementTypes.OBJECT_DECLARATION), KotlinObjectStub {
|
||||
override fun getFqName() = fqName
|
||||
override fun getName() = StringRef.toString(name)
|
||||
override fun getSuperNames() = superNames map { it.toString() }
|
||||
override fun getSuperNames() = superNames.map { it.toString() }
|
||||
override fun isTopLevel() = isTopLevel
|
||||
override fun isCompanion() = isDefault
|
||||
override fun isObjectLiteral() = isObjectLiteral
|
||||
|
||||
@@ -118,7 +118,7 @@ public class QualifiedExpressionResolver(val symbolUsageValidator: SymbolUsageVa
|
||||
while (userType != null) {
|
||||
val referenceExpression = userType.referenceExpression
|
||||
if (referenceExpression != null) {
|
||||
result add QualifierPart(referenceExpression.getReferencedNameAsName(), referenceExpression, userType.typeArgumentList)
|
||||
result.add(QualifierPart(referenceExpression.getReferencedNameAsName(), referenceExpression, userType.typeArgumentList))
|
||||
}
|
||||
else {
|
||||
hasError = true
|
||||
@@ -261,12 +261,12 @@ public class QualifiedExpressionResolver(val symbolUsageValidator: SymbolUsageVa
|
||||
loop@ while (expression != null) {
|
||||
when (expression) {
|
||||
is KtSimpleNameExpression -> {
|
||||
result add QualifierPart(expression.getReferencedNameAsName(), expression)
|
||||
result.add(QualifierPart(expression.getReferencedNameAsName(), expression))
|
||||
break@loop
|
||||
}
|
||||
is KtQualifiedExpression -> {
|
||||
(expression.selectorExpression as? KtSimpleNameExpression)?.let {
|
||||
result add QualifierPart(it.getReferencedNameAsName(), it)
|
||||
result.add(QualifierPart(it.getReferencedNameAsName(), it))
|
||||
}
|
||||
expression = expression.receiverExpression
|
||||
if (expression is KtSafeQualifiedExpression) {
|
||||
|
||||
@@ -192,6 +192,6 @@ class VarianceChecker(private val trace: BindingTrace) {
|
||||
return noError
|
||||
}
|
||||
|
||||
private fun Boolean.and(other: Boolean?) = if (other == null) this else this and other
|
||||
private infix fun Boolean.and(other: Boolean?) = if (other == null) this else this and other
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class CliDeclarationProviderFactoryService(private val sourceFiles: Colle
|
||||
val vFile = it.getVirtualFile().sure { "Source files should be physical files" }
|
||||
filesScope.contains(vFile)
|
||||
}
|
||||
allFiles addAll syntheticFiles
|
||||
allFiles.addAll(syntheticFiles)
|
||||
return FileBasedDeclarationProviderFactory(storageManager, allFiles)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public class ValueParameterResolver(
|
||||
|
||||
val contextForDefaultValue = ExpressionTypingContext.newContext(trace, scopeForDefaultValue, dataFlowInfo, TypeUtils.NO_EXPECTED_TYPE, callChecker)
|
||||
|
||||
for ((descriptor, parameter) in valueParameterDescriptors zip valueParameters) {
|
||||
for ((descriptor, parameter) in valueParameterDescriptors.zip(valueParameters)) {
|
||||
ForceResolveUtil.forceResolveAllContents(descriptor.getAnnotations())
|
||||
resolveDefaultValue(descriptor, parameter, contextForDefaultValue)
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ class FilteredJvmDiagnostics(val jvmDiagnostics: Diagnostics, val otherDiagnosti
|
||||
}
|
||||
}
|
||||
|
||||
private fun ConflictingJvmDeclarationsData.higherThan(other: ConflictingJvmDeclarationsData): Boolean {
|
||||
private infix fun ConflictingJvmDeclarationsData.higherThan(other: ConflictingJvmDeclarationsData): Boolean {
|
||||
return when (other.classOrigin.originKind) {
|
||||
PACKAGE_PART -> this.classOrigin.originKind == PACKAGE_FACADE
|
||||
INTERFACE_DEFAULT_IMPL -> this.classOrigin.originKind != INTERFACE_DEFAULT_IMPL
|
||||
|
||||
@@ -124,7 +124,7 @@ public abstract class AbstractWriteSignatureTest : TestCaseWithTmpdir() {
|
||||
val packageFacadePrefix = classLastName.replace(".class", "\$")
|
||||
classDir.listFiles { dir, lastName ->
|
||||
lastName.startsWith(packageFacadePrefix) && lastName.endsWith(".class")
|
||||
} forEach { packageFacadeFile ->
|
||||
}.forEach { packageFacadeFile ->
|
||||
checkClassFile(checker, packageFacadeFile)
|
||||
}
|
||||
}
|
||||
@@ -152,17 +152,17 @@ public abstract class AbstractWriteSignatureTest : TestCaseWithTmpdir() {
|
||||
|
||||
private inner class Checker : ClassVisitor(Opcodes.ASM5) {
|
||||
override fun visit(version: Int, access: Int, name: String, signature: String?, superName: String?, interfaces: Array<out String>?) {
|
||||
classExpectations forEach { it.check(name, name, signature?:"null") }
|
||||
classExpectations.forEach { it.check(name, name, signature ?: "null") }
|
||||
super.visit(version, access, name, signature, superName, interfaces)
|
||||
}
|
||||
|
||||
override fun visitMethod(access: Int, name: String, desc: String, signature: String?, exceptions: Array<out String>?): MethodVisitor? {
|
||||
methodExpectations forEach { it.check(name, desc, signature?:"null") }
|
||||
methodExpectations.forEach { it.check(name, desc, signature ?: "null") }
|
||||
return super.visitMethod(access, name, desc, signature, exceptions)
|
||||
}
|
||||
|
||||
override fun visitField(access: Int, name: String, desc: String, signature: String?, value: Any?): FieldVisitor? {
|
||||
fieldExpectations forEach { it.check(name, desc, signature?:"null") }
|
||||
fieldExpectations.forEach { it.check(name, desc, signature ?: "null") }
|
||||
return super.visitField(access, name, desc, signature, value)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ public class KotlinJavascriptSerializerTest : TestCaseWithTmpdir() {
|
||||
val configuration = CompilerConfiguration()
|
||||
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE)
|
||||
|
||||
configuration.addKotlinSourceRoots(srcDirs map { it.path })
|
||||
configuration.addKotlinSourceRoots(srcDirs.map { it.path })
|
||||
|
||||
serialize(configuration, metaFile)
|
||||
val module = deserialize(metaFile)
|
||||
|
||||
Reference in New Issue
Block a user