Prohibited @Strictfp annotation on classes (it's not supported yet), Fix for KT-11109: Strictfp annotation do nothing when applied to class

#KT-11109 Fixed
This commit is contained in:
Michael Bogdanov
2016-02-25 11:14:23 +03:00
parent 894c11d412
commit 1b94904684
4 changed files with 39 additions and 1 deletions
@@ -0,0 +1,11 @@
<!WRONG_ANNOTATION_TARGET!>@kotlin.jvm.Strictfp<!> class A {
}
<!WRONG_ANNOTATION_TARGET!>@kotlin.jvm.Strictfp<!> object B {
}
<!WRONG_ANNOTATION_TARGET!>@kotlin.jvm.Strictfp<!> interface C {
}
@@ -0,0 +1,21 @@
package
@kotlin.jvm.Strictfp() public final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.jvm.Strictfp() public object B {
private constructor B()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@kotlin.jvm.Strictfp() public interface C {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -193,6 +193,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName);
}
@TestMetadata("strictfpOnClass.kt")
public void testStrictfpOnClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/strictfpOnClass.kt");
doTest(fileName);
}
@TestMetadata("Synchronized.kt")
public void testSynchronized() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/Synchronized.kt");
@@ -41,7 +41,7 @@ annotation class Transient
* of floating point operations performed inside the method needs to be restricted in order to
* achieve better portability.
*/
@Target(FUNCTION, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER, CLASS)
@Target(FUNCTION, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
annotation class Strictfp