Code Insight: Format generated declarations
#KT-11176 Fixed (cherry picked from commit 3641ad6)
This commit is contained in:
@@ -123,6 +123,7 @@ These artifacts include extensions for the types available in the latter JDKs, s
|
|||||||
|
|
||||||
###### Issues fixed
|
###### Issues fixed
|
||||||
|
|
||||||
|
- [`KT-11176`](https://youtrack.jetbrains.com/issue/KT-11176) Add a space before '{' in functions generated "Generate hashCode/equals/toString"
|
||||||
- [`KT-12294`](https://youtrack.jetbrains.com/issue/KT-12294) Introduce Property: Fix extraction of expressions referring to primary constructor parameters
|
- [`KT-12294`](https://youtrack.jetbrains.com/issue/KT-12294) Introduce Property: Fix extraction of expressions referring to primary constructor parameters
|
||||||
- [`KT-12413`](https://youtrack.jetbrains.com/issue/KT-12413) Change Signature: Fix bogus warning about unresolved type parameters/invalid functional type replacement
|
- [`KT-12413`](https://youtrack.jetbrains.com/issue/KT-12413) Change Signature: Fix bogus warning about unresolved type parameters/invalid functional type replacement
|
||||||
- [`KT-12084`](https://youtrack.jetbrains.com/issue/KT-12084) Introduce Property: Do not skip outer classes if extractable expression is contained in object literal
|
- [`KT-12084`](https://youtrack.jetbrains.com/issue/KT-12084) Introduce Property: Do not skip outer classes if extractable expression is contained in object literal
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import com.intellij.psi.PsiDocumentManager
|
|||||||
import com.intellij.psi.PsiElement
|
import com.intellij.psi.PsiElement
|
||||||
import com.intellij.psi.PsiWhiteSpace
|
import com.intellij.psi.PsiWhiteSpace
|
||||||
import com.intellij.psi.SmartPointerManager
|
import com.intellij.psi.SmartPointerManager
|
||||||
|
import com.intellij.psi.codeStyle.CodeStyleManager
|
||||||
import com.intellij.psi.util.PsiTreeUtil
|
import com.intellij.psi.util.PsiTreeUtil
|
||||||
import com.intellij.util.SmartList
|
import com.intellij.util.SmartList
|
||||||
import org.jetbrains.kotlin.idea.core.ShortenReferences
|
|
||||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||||
import org.jetbrains.kotlin.lexer.KtTokens
|
import org.jetbrains.kotlin.lexer.KtTokens
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
@@ -174,7 +174,7 @@ fun <T : KtDeclaration> insertMembersAfter(
|
|||||||
if (otherMembers.isNotEmpty()) {
|
if (otherMembers.isNotEmpty()) {
|
||||||
val body = classOrObject.getOrCreateBody()
|
val body = classOrObject.getOrCreateBody()
|
||||||
|
|
||||||
var afterAnchor = anchor ?: findInsertAfterAnchor(editor, body) ?: return@runWriteAction emptyList()
|
var afterAnchor = anchor ?: findInsertAfterAnchor(editor, body) ?: return@runWriteAction emptyList<T>()
|
||||||
otherMembers.mapNotNullTo(insertedMembers) {
|
otherMembers.mapNotNullTo(insertedMembers) {
|
||||||
if (classOrObject is KtClass && classOrObject.isEnum()) {
|
if (classOrObject is KtClass && classOrObject.isEnum()) {
|
||||||
val enumEntries = classOrObject.declarations.filterIsInstance<KtEnumEntry>()
|
val enumEntries = classOrObject.declarations.filterIsInstance<KtEnumEntry>()
|
||||||
@@ -204,6 +204,9 @@ fun <T : KtDeclaration> insertMembersAfter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
insertedMembers
|
insertedMembers
|
||||||
|
}.apply {
|
||||||
|
val codeStyleManager = CodeStyleManager.getInstance(classOrObject.project)
|
||||||
|
forEach { codeStyleManager.reformat(it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,13 +45,13 @@ private class Visitor(var range: TextRange) : KtTreeVisitorVoid() {
|
|||||||
|
|
||||||
val nextEntry = declaration.nextSiblingOfSameType()
|
val nextEntry = declaration.nextSiblingOfSameType()
|
||||||
if (nextEntry != null && !declaration.containsToken(KtTokens.COMMA)) {
|
if (nextEntry != null && !declaration.containsToken(KtTokens.COMMA)) {
|
||||||
classBody.addAfter(comma, declaration)
|
declaration.add(comma)
|
||||||
delta += comma.textLength
|
delta += comma.textLength
|
||||||
}
|
}
|
||||||
|
|
||||||
val prevEntry = declaration.prevSiblingOfSameType()
|
val prevEntry = declaration.prevSiblingOfSameType()
|
||||||
if (prevEntry != null && !prevEntry.containsToken(KtTokens.COMMA)) {
|
if (prevEntry != null && !prevEntry.containsToken(KtTokens.COMMA)) {
|
||||||
classBody.addAfter(comma, prevEntry)
|
prevEntry.add(comma)
|
||||||
delta += comma.textLength
|
delta += comma.textLength
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class A(val n: IntArray, val s: Array<String>) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class A(val n: IntArray, val s: Array<String>) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = Arrays.hashCode(n)
|
var result = Arrays.hashCode(n)
|
||||||
result = 31 * result + Arrays.hashCode(s)
|
result = 31 * result + Arrays.hashCode(s)
|
||||||
result = 31 * result + f.hashCode()
|
result = 31 * result + f.hashCode()
|
||||||
|
|||||||
+2
-2
@@ -4,7 +4,7 @@ class Test {
|
|||||||
field = value.toUpperCase()
|
field = value.toUpperCase()
|
||||||
}
|
}
|
||||||
var name: String = ""
|
var name: String = ""
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ class Test {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = serial.hashCode()
|
var result = serial.hashCode()
|
||||||
result = 31 * result + name.hashCode()
|
result = 31 * result + name.hashCode()
|
||||||
return result
|
return result
|
||||||
|
|||||||
+2
-2
@@ -5,13 +5,13 @@ class Test {
|
|||||||
var name: String = ""
|
var name: String = ""
|
||||||
get
|
get
|
||||||
|
|
||||||
override fun equals(other: Any?): Boolean{
|
override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ class A<T>(val n: T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ class A<T>(val n: T) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return n?.hashCode() ?: 0
|
return n?.hashCode() ?: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -4,7 +4,7 @@ class A<T>(val n: T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other !is A<*>) return false
|
if (other !is A<*>) return false
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ class A<T>(val n: T) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return n?.hashCode() ?: 0
|
return n?.hashCode() ?: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -5,7 +5,7 @@ class A(val n: Int, val s: String) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ class A(val n: Int, val s: String) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = n
|
var result = n
|
||||||
result = 31 * result + s.hashCode()
|
result = 31 * result + s.hashCode()
|
||||||
result = 31 * result + f.hashCode()
|
result = 31 * result + f.hashCode()
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@ class A(val n: Int?, val s: String) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ class A(val n: Int?, val s: String) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = n ?: 0
|
var result = n ?: 0
|
||||||
result = 31 * result + s.hashCode()
|
result = 31 * result + s.hashCode()
|
||||||
result = 31 * result + (f?.hashCode() ?: 0)
|
result = 31 * result + (f?.hashCode() ?: 0)
|
||||||
|
|||||||
+2
-2
@@ -10,7 +10,7 @@ class A(val n: Int, val s: String) : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
if (!super.equals(other)) return false
|
if (!super.equals(other)) return false
|
||||||
@@ -24,7 +24,7 @@ class A(val n: Int, val s: String) : X() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = super.hashCode()
|
var result = super.hashCode()
|
||||||
result = 31 * result + n
|
result = 31 * result + n
|
||||||
result = 31 * result + s.hashCode()
|
result = 31 * result + s.hashCode()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class A(val result: Int, val s: String) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -15,7 +15,7 @@ class A(val result: Int, val s: String) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result1 = result
|
var result1 = result
|
||||||
result1 = 31 * result1 + s.hashCode()
|
result1 = 31 * result1 + s.hashCode()
|
||||||
return result1
|
return result1
|
||||||
|
|||||||
+2
-2
@@ -4,13 +4,13 @@ class A {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -9,14 +9,14 @@ class A : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
if (!super.equals(other)) return false
|
if (!super.equals(other)) return false
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return super.hashCode()
|
return super.hashCode()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -7,7 +7,7 @@ class A(val n: IntArray?, val s: Array<String>?) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class A(val n: IntArray?, val s: Array<String>?) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = n?.let { Arrays.hashCode(it) } ?: 0
|
var result = n?.let { Arrays.hashCode(it) } ?: 0
|
||||||
result = 31 * result + (s?.let { Arrays.hashCode(it) } ?: 0)
|
result = 31 * result + (s?.let { Arrays.hashCode(it) } ?: 0)
|
||||||
result = 31 * result + f.hashCode()
|
result = 31 * result + f.hashCode()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ class A(val n: Int) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ class A(val n: Int) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -3,7 +3,7 @@ class A(val n: Int?) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
|
|
||||||
@@ -14,7 +14,7 @@ class A(val n: Int?) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return n ?: 0
|
return n ?: 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -4,7 +4,7 @@ class A(val n: Int) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other !is A) return false
|
if (other !is A) return false
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ class A(val n: Int) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
return n
|
return n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -3,7 +3,7 @@ class A(val n: Int) : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
if (!super.equals(other)) return false
|
if (!super.equals(other)) return false
|
||||||
@@ -15,7 +15,7 @@ class A(val n: Int) : X() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = super.hashCode()
|
var result = super.hashCode()
|
||||||
result = 31 * result + n
|
result = 31 * result + n
|
||||||
return result
|
return result
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ class A(val n: Int) : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun equals(other: Any?): Boolean{
|
<caret>override fun equals(other: Any?): Boolean {
|
||||||
if (this === other) return true
|
if (this === other) return true
|
||||||
if (other?.javaClass != javaClass) return false
|
if (other?.javaClass != javaClass) return false
|
||||||
if (!super.equals(other)) return false
|
if (!super.equals(other)) return false
|
||||||
@@ -20,7 +20,7 @@ class A(val n: Int) : X() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int{
|
override fun hashCode(): Int {
|
||||||
var result = super.hashCode()
|
var result = super.hashCode()
|
||||||
result = 31 * result + n
|
result = 31 * result + n
|
||||||
return result
|
return result
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class A(val n: IntArray, val s: Array<String>) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String{
|
override fun toString(): String {
|
||||||
return "A(" +
|
return "A(" +
|
||||||
"n=${Arrays.toString(n)}," +
|
"n=${Arrays.toString(n)}," +
|
||||||
"s=${Arrays.toString(s)}," +
|
"s=${Arrays.toString(s)}," +
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ class Test {
|
|||||||
field = value.toUpperCase()
|
field = value.toUpperCase()
|
||||||
}
|
}
|
||||||
var name: String = ""
|
var name: String = ""
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "Test(" +
|
return "Test(" +
|
||||||
"serial='$serial'," +
|
"serial='$serial'," +
|
||||||
"name='$name'" +
|
"name='$name'" +
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ class A(val n: Int, val s: String) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String{
|
override fun toString(): String {
|
||||||
return "A(" +
|
return "A(" +
|
||||||
"n=$n," +
|
"n=$n," +
|
||||||
"s='$s'," +
|
"s='$s'," +
|
||||||
|
|||||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ class A(val n: Int, val s: String) : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String{
|
override fun toString(): String {
|
||||||
return "A(" +
|
return "A(" +
|
||||||
"n=$n," +
|
"n=$n," +
|
||||||
"s='$s'," +
|
"s='$s'," +
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ class A {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A()"
|
return "A()"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -4,7 +4,7 @@ class A(val n: Int) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String{
|
override fun toString(): String {
|
||||||
return "A(" +
|
return "A(" +
|
||||||
"n=$n" +
|
"n=$n" +
|
||||||
")"
|
")"
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ class A : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A()" +
|
return "A()" +
|
||||||
" ${super.toString()}"
|
" ${super.toString()}"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class A(val n: IntArray, val s: Array<String>) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun toString(): String{
|
override fun toString(): String {
|
||||||
return "A(n=${Arrays.toString(n)}, s=${Arrays.toString(s)}, f=$f)"
|
return "A(n=${Arrays.toString(n)}, s=${Arrays.toString(s)}, f=$f)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -4,7 +4,7 @@ class Test {
|
|||||||
field = value.toUpperCase()
|
field = value.toUpperCase()
|
||||||
}
|
}
|
||||||
var name: String = ""
|
var name: String = ""
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "Test(serial='$serial', name='$name')"
|
return "Test(serial='$serial', name='$name')"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -5,7 +5,7 @@ class Test {
|
|||||||
var name: String = ""
|
var name: String = ""
|
||||||
get
|
get
|
||||||
|
|
||||||
override fun toString(): String{
|
override fun toString(): String {
|
||||||
return "Test()"
|
return "Test()"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ class A(val n: Int, val s: String) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A(n=$n, s='$s', f=$f)"
|
return "A(n=$n, s='$s', f=$f)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vendored
+1
-1
@@ -11,7 +11,7 @@ class A(val n: Int, val s: String) : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A(n=$n, s='$s', f=$f) ${super.toString()}"
|
return "A(n=$n, s='$s', f=$f) ${super.toString()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ class A {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A()"
|
return "A()"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -4,7 +4,7 @@ class A(val n: Int) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A(n=$n)"
|
return "A(n=$n)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -9,7 +9,7 @@ class A : X() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<caret>override fun toString(): String{
|
<caret>override fun toString(): String {
|
||||||
return "A() ${super.toString()}"
|
return "A() ${super.toString()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vendored
-1
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
class A<T>(val n: T) {
|
class A<T>(val n: T) {
|
||||||
operator fun unaryPlus(): A<T> = throw Exception()
|
operator fun unaryPlus(): A<T> = throw Exception()
|
||||||
|
|
||||||
infix operator fun plus(t: T): A<T> {
|
infix operator fun plus(t: T): A<T> {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
class A<T>(val n: T) {
|
class A<T>(val n: T) {
|
||||||
fun plus(i: Int, s: String): A<T> = throw Exception()
|
fun plus(i: Int, s: String): A<T> = throw Exception()
|
||||||
|
|
||||||
infix operator fun plus(t: T): A<T> {
|
infix operator fun plus(t: T): A<T> {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
class A<T>(val n: T) {
|
class A<T>(val n: T) {
|
||||||
fun foo(a: Int): A<T> = throw Exception()
|
fun foo(a: Int): A<T> = throw Exception()
|
||||||
|
|
||||||
fun foo(a: T, s: String): A<T> {
|
fun foo(a: T, s: String): A<T> {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
class A<T>(val n: T) {
|
class A<T>(val n: T) {
|
||||||
fun foo(i: Int, s: String): A<T> = throw Exception()
|
fun foo(i: Int, s: String): A<T> = throw Exception()
|
||||||
|
|
||||||
fun foo(i: T): A<T> {
|
fun foo(i: T): A<T> {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -2,7 +2,6 @@
|
|||||||
class Foo<T> {
|
class Foo<T> {
|
||||||
operator fun component1(): Int { return 0 }
|
operator fun component1(): Int { return 0 }
|
||||||
operator fun component2(): Int { return 0 }
|
operator fun component2(): Int { return 0 }
|
||||||
|
|
||||||
operator fun component3(): Any {
|
operator fun component3(): Any {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -2,7 +2,6 @@
|
|||||||
class Foo<T> {
|
class Foo<T> {
|
||||||
operator fun component1(): Int { return 0 }
|
operator fun component1(): Int { return 0 }
|
||||||
operator fun component2(): Int { return 0 }
|
operator fun component2(): Int { return 0 }
|
||||||
|
|
||||||
operator fun component3(): String {
|
operator fun component3(): String {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -3,7 +3,6 @@ import kotlin.reflect.KProperty
|
|||||||
|
|
||||||
class F {
|
class F {
|
||||||
operator fun setValue(x: X, property: KProperty<*>, i: Int) { }
|
operator fun setValue(x: X, property: KProperty<*>, i: Int) { }
|
||||||
|
|
||||||
operator fun getValue(x: X, property: KProperty<*>): Int {
|
operator fun getValue(x: X, property: KProperty<*>): Int {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -3,7 +3,6 @@ import kotlin.reflect.KProperty
|
|||||||
|
|
||||||
class F {
|
class F {
|
||||||
operator fun getValue(x: X, property: KProperty<*>): Int = 1
|
operator fun getValue(x: X, property: KProperty<*>): Int = 1
|
||||||
|
|
||||||
operator fun setValue(x: X, property: KProperty<*>, i: Int) {
|
operator fun setValue(x: X, property: KProperty<*>, i: Int) {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -1,7 +1,6 @@
|
|||||||
// "Create member function 'next'" "true"
|
// "Create member function 'next'" "true"
|
||||||
class FooIterator<T> {
|
class FooIterator<T> {
|
||||||
operator fun hasNext(): Boolean { return false }
|
operator fun hasNext(): Boolean { return false }
|
||||||
|
|
||||||
operator fun next(): Any {
|
operator fun next(): Any {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,7 +1,6 @@
|
|||||||
// "Create member function 'next'" "true"
|
// "Create member function 'next'" "true"
|
||||||
class FooIterator<T> {
|
class FooIterator<T> {
|
||||||
operator fun hasNext(): Boolean { return false }
|
operator fun hasNext(): Boolean { return false }
|
||||||
|
|
||||||
operator fun next(): Int {
|
operator fun next(): Int {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,7 +1,6 @@
|
|||||||
// "Create member function 'next'" "true"
|
// "Create member function 'next'" "true"
|
||||||
class FooIterator<T> {
|
class FooIterator<T> {
|
||||||
operator fun hasNext(): Boolean { return false }
|
operator fun hasNext(): Boolean { return false }
|
||||||
|
|
||||||
operator fun next(): T {
|
operator fun next(): T {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -1,7 +1,6 @@
|
|||||||
// "Create member function 'set'" "true"
|
// "Create member function 'set'" "true"
|
||||||
class A {
|
class A {
|
||||||
operator fun get(s: String): Int = 1
|
operator fun get(s: String): Int = 1
|
||||||
|
|
||||||
operator fun set(s: String, value: Int) {
|
operator fun set(s: String, value: Int) {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
-1
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
class A<T>(val n: T) {
|
class A<T>(val n: T) {
|
||||||
operator fun minus(n: Int): A<T> = throw Exception()
|
operator fun minus(n: Int): A<T> = throw Exception()
|
||||||
|
|
||||||
operator fun unaryMinus(): A<T> {
|
operator fun unaryMinus(): A<T> {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -3,7 +3,6 @@ open class Base()
|
|||||||
|
|
||||||
class Creation {
|
class Creation {
|
||||||
constructor(f: Int)
|
constructor(f: Int)
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
}
|
}
|
||||||
val v = Creation()
|
val v = Creation()
|
||||||
Vendored
-1
@@ -5,7 +5,6 @@ open class Base(val f: Int)
|
|||||||
|
|
||||||
class Creation: Base {
|
class Creation: Base {
|
||||||
constructor(f: Int): super(f)
|
constructor(f: Int): super(f)
|
||||||
|
|
||||||
constructor() : super(<caret>)
|
constructor() : super(<caret>)
|
||||||
}
|
}
|
||||||
val v = Creation()
|
val v = Creation()
|
||||||
-1
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
class CtorSecondary() {
|
class CtorSecondary() {
|
||||||
constructor(p: Int) : this()
|
constructor(p: Int) : this()
|
||||||
|
|
||||||
constructor<caret>(i: Int, i1: Int)
|
constructor<caret>(i: Int, i1: Int)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user