Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-03-04 17:54:33 +03:00
parent 186e0b0cba
commit 8884cbe415
2268 changed files with 1175 additions and 19754 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
class Annotation(val x: Int) {
fun baz() {}
fun bar() = x
@@ -1,10 +0,0 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE
class Annotation {
fun setProblemGroup() {}
fun getQuickFixes() = 0
}
fun registerQuickFix(annotation: Annotation) {
annotation.setProblemGroup()
val fixes = annotation.getQuickFixes()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE
class Annotation {
fun setProblemGroup() {}
@@ -1,8 +0,0 @@
@MustBeDocumented
annotation class DocAnn
annotation class NotDocAnn
@DocAnn class My
@NotDocAnn class Your
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@MustBeDocumented
annotation class DocAnn
@@ -1,12 +0,0 @@
@Target(AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class ExprAnn
@Target(AnnotationTarget.FUNCTION)
annotation class FunAnn
fun foo(): Int {
val x = @ExprAnn fun() = 1
val y = @FunAnn fun() = 2
return x() + y()
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@Target(AnnotationTarget.EXPRESSION)
@Retention(AnnotationRetention.SOURCE)
annotation class ExprAnn
@@ -1,20 +0,0 @@
// FILE: DocumentedAnnotations.java
import java.lang.annotation.*;
public class DocumentedAnnotations {
@Documented public @interface DocAnn {};
public @interface NotDocAnn {};
@Documented @Retention(RetentionPolicy.RUNTIME) public @interface RunDocAnn {};
}
// FILE: DocumentedAnnotations.kt
@DocumentedAnnotations.DocAnn class My
@DocumentedAnnotations.NotDocAnn class Your
@DocumentedAnnotations.RunDocAnn class His
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: DocumentedAnnotations.java
import java.lang.annotation.*;
@@ -1,35 +0,0 @@
// FILE: AnnotationRetentions.java
import java.lang.annotation.*;
public class AnnotationRetentions {
public @interface BaseAnnotation {
}
@Retention(RetentionPolicy.SOURCE)
public @interface SourceAnnotation {
}
@Retention(RetentionPolicy.CLASS)
public @interface BinaryAnnotation {
}
@Retention(RetentionPolicy.RUNTIME)
public @interface RuntimeAnnotation {
}
}
// FILE: AnnotationRetentions.kt
@AnnotationRetentions.BaseAnnotation class BaseClass
@AnnotationRetentions.SourceAnnotation class SourceClass
@AnnotationRetentions.BinaryAnnotation class BinaryClass
@AnnotationRetentions.RuntimeAnnotation class RuntimeClass
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// FILE: AnnotationRetentions.java
import java.lang.annotation.*;
@@ -1,8 +0,0 @@
@Target(AnnotationTarget.CLASS)
annotation class Ann
open class My
fun foo(): My {
return (@Ann object: My() {})
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@Target(AnnotationTarget.CLASS)
annotation class Ann
@@ -1,4 +0,0 @@
@Retention(AnnotationRetention.SOURCE)
annotation class sourceann
@sourceann class AnnotatedAtSource
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@Retention(AnnotationRetention.SOURCE)
annotation class sourceann
@@ -1,4 +0,0 @@
@Target(AnnotationTarget.CLASS)
annotation class base
@base data class My(val x: Int)
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@Target(AnnotationTarget.CLASS)
annotation class base
@@ -1,5 +0,0 @@
@file:Suppress("abc")
fun foo(): Int {
@Suppress("xyz") return 1
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
@file:Suppress("abc")
fun foo(): Int {