Exposed visibility deprecation warnings made errors + relevant test fixes
This commit is contained in:
@@ -73,13 +73,13 @@ public interface Errors {
|
|||||||
DiagnosticFactory3<PsiElement, DeclarationDescriptor, Visibility, DeclarationDescriptor> INVISIBLE_MEMBER = DiagnosticFactory3.create(ERROR, CALL_ELEMENT);
|
DiagnosticFactory3<PsiElement, DeclarationDescriptor, Visibility, DeclarationDescriptor> INVISIBLE_MEMBER = DiagnosticFactory3.create(ERROR, CALL_ELEMENT);
|
||||||
|
|
||||||
// Exposed visibility group
|
// Exposed visibility group
|
||||||
DiagnosticFactory2<KtProperty, EffectiveVisibility, EffectiveVisibility> EXPOSED_PROPERTY_TYPE = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<KtProperty, EffectiveVisibility, EffectiveVisibility> EXPOSED_PROPERTY_TYPE = DiagnosticFactory2.create(ERROR);
|
||||||
DiagnosticFactory2<PsiElement, EffectiveVisibility, EffectiveVisibility> EXPOSED_FUNCTION_RETURN_TYPE = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<PsiElement, EffectiveVisibility, EffectiveVisibility> EXPOSED_FUNCTION_RETURN_TYPE = DiagnosticFactory2.create(ERROR);
|
||||||
DiagnosticFactory2<KtParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_PARAMETER_TYPE = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<KtParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_PARAMETER_TYPE = DiagnosticFactory2.create(ERROR);
|
||||||
DiagnosticFactory2<KtTypeReference, EffectiveVisibility, EffectiveVisibility> EXPOSED_RECEIVER_TYPE = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<KtTypeReference, EffectiveVisibility, EffectiveVisibility> EXPOSED_RECEIVER_TYPE = DiagnosticFactory2.create(ERROR);
|
||||||
DiagnosticFactory2<KtTypeParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_TYPE_PARAMETER_BOUND = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<KtTypeParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_TYPE_PARAMETER_BOUND = DiagnosticFactory2.create(ERROR);
|
||||||
DiagnosticFactory2<KtDelegationSpecifier, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_CLASS = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<KtDelegationSpecifier, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_CLASS = DiagnosticFactory2.create(ERROR);
|
||||||
DiagnosticFactory2<KtDelegationSpecifier, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_INTERFACE = DiagnosticFactory2.create(WARNING);
|
DiagnosticFactory2<KtDelegationSpecifier, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_INTERFACE = DiagnosticFactory2.create(ERROR);
|
||||||
|
|
||||||
DiagnosticFactory1<KtElement, Collection<ClassDescriptor>> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING);
|
DiagnosticFactory1<KtElement, Collection<ClassDescriptor>> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING);
|
||||||
|
|
||||||
|
|||||||
+7
-7
@@ -112,13 +112,13 @@ public class DefaultErrorMessages {
|
|||||||
MAP.put(INVISIBLE_REFERENCE, "Cannot access ''{0}'': it is ''{1}'' in {2}", NAME, TO_STRING, NAME_OF_PARENT_OR_FILE);
|
MAP.put(INVISIBLE_REFERENCE, "Cannot access ''{0}'': it is ''{1}'' in {2}", NAME, TO_STRING, NAME_OF_PARENT_OR_FILE);
|
||||||
MAP.put(INVISIBLE_MEMBER, "Cannot access ''{0}'': it is ''{1}'' in {2}", NAME, TO_STRING, NAME_OF_PARENT_OR_FILE);
|
MAP.put(INVISIBLE_MEMBER, "Cannot access ''{0}'': it is ''{1}'' in {2}", NAME, TO_STRING, NAME_OF_PARENT_OR_FILE);
|
||||||
|
|
||||||
MAP.put(EXPOSED_PROPERTY_TYPE, "Deprecated: property effective visibility ''{0}'' should be the same or less permissive than its type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_PROPERTY_TYPE, "Property effective visibility ''{0}'' should be the same or less permissive than its type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
MAP.put(EXPOSED_FUNCTION_RETURN_TYPE, "Deprecated: function effective visibility ''{0}'' should be the same or less permissive than its return type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_FUNCTION_RETURN_TYPE, "Function effective visibility ''{0}'' should be the same or less permissive than its return type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
MAP.put(EXPOSED_PARAMETER_TYPE, "Deprecated: function effective visibility ''{0}'' should be the same or less permissive than its parameter type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_PARAMETER_TYPE, "Function effective visibility ''{0}'' should be the same or less permissive than its parameter type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
MAP.put(EXPOSED_RECEIVER_TYPE, "Deprecated: member effective visibility ''{0}'' should be the same or less permissive than its receiver type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_RECEIVER_TYPE, "Member effective visibility ''{0}'' should be the same or less permissive than its receiver type effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
MAP.put(EXPOSED_TYPE_PARAMETER_BOUND, "Deprecated: generic effective visibility ''{0}'' should be the same or less permissive than its type parameter bound effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_TYPE_PARAMETER_BOUND, "Generic effective visibility ''{0}'' should be the same or less permissive than its type parameter bound effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
MAP.put(EXPOSED_SUPER_CLASS, "Deprecated: subclass effective visibility ''{0}'' should be the same or less permissive than its superclass effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_SUPER_CLASS, "Subclass effective visibility ''{0}'' should be the same or less permissive than its superclass effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
MAP.put(EXPOSED_SUPER_INTERFACE, "Deprecated: sub-interface effective visibility ''{0}'' should be the same or less permissive than its super-interface effective visibility ''{1}''", TO_STRING, TO_STRING);
|
MAP.put(EXPOSED_SUPER_INTERFACE, "Sub-interface effective visibility ''{0}'' should be the same or less permissive than its super-interface effective visibility ''{1}''", TO_STRING, TO_STRING);
|
||||||
|
|
||||||
MAP.put(REDECLARATION, "Redeclaration: {0}", STRING);
|
MAP.put(REDECLARATION, "Redeclaration: {0}", STRING);
|
||||||
MAP.put(NAME_SHADOWING, "Name shadowed: {0}", STRING);
|
MAP.put(NAME_SHADOWING, "Name shadowed: {0}", STRING);
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
class Foo(private val s: String) {
|
class Foo(private val s: String) {
|
||||||
private inner class Inner {
|
inner class Inner {
|
||||||
private val x = {
|
private val x = {
|
||||||
this@Foo.s
|
this@Foo.s
|
||||||
}()
|
}()
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ internal class B : A {
|
|||||||
override fun foo() = "OK"
|
override fun foo() = "OK"
|
||||||
}
|
}
|
||||||
|
|
||||||
val global = B()
|
internal val global = B()
|
||||||
|
|
||||||
internal class C(x: Int) : A by global {
|
internal class C(x: Int) : A by global {
|
||||||
constructor(): this(1)
|
constructor(): this(1)
|
||||||
|
|||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
interface B : A {
|
internal interface B : A {
|
||||||
fun bar() = 1
|
fun bar() = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
interface C : B
|
internal interface C : B
|
||||||
|
|
||||||
class D : C {
|
internal class D : C {
|
||||||
override fun foo() {}
|
override fun foo() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
class fieldAccessViaSubclass {
|
public class fieldAccessViaSubclass {
|
||||||
public String fieldO;
|
public String fieldO;
|
||||||
|
|
||||||
public static String fieldK;
|
public static String fieldK;
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
fun getInterface(): GenericInterface<String> {
|
internal fun getInterface(): GenericInterface<String> {
|
||||||
return GenericInterface { d, i, j, s ->
|
return GenericInterface { d, i, j, s ->
|
||||||
"OK"
|
"OK"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class KotlinSubclass: JavaClass() {
|
internal class KotlinSubclass: JavaClass() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class KotlinClass : JavaClass<String>() {
|
internal class KotlinClass : JavaClass<String>() {
|
||||||
fun doIt(): String {
|
fun doIt(): String {
|
||||||
var result = ""
|
var result = ""
|
||||||
execute("") {
|
execute("") {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
class KotlinClass(): JavaClass(null) {
|
internal class KotlinClass(): JavaClass(null) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
var status: String = "fail" // global property to avoid issues with accessing closure from local class (KT-4174)
|
var status: String = "fail" // global property to avoid issues with accessing closure from local class (KT-4174)
|
||||||
|
|
||||||
class KotlinClass(): JavaClass({status="OK"}) {
|
internal class KotlinClass(): JavaClass({status="OK"}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fun box(): String {
|
fun box(): String {
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ fun box(): String {
|
|||||||
return f(JavaClass())
|
return f(JavaClass())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun f(c: C) = c.ok
|
internal fun f(c: C) = c.ok
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ fun box(): String {
|
|||||||
return JavaClass().doIt()
|
return JavaClass().doIt()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun JavaClass.doIt(): String {
|
internal fun JavaClass.doIt(): String {
|
||||||
x = "OK"
|
x = "OK"
|
||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,3 +1,3 @@
|
|||||||
abstract class Test<F> {
|
public abstract class Test<F> {
|
||||||
protected final F value = null;
|
protected final F value = null;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
interface Simple {
|
public interface Simple {
|
||||||
default String test(String s) {
|
default String test(String s) {
|
||||||
return s + "K";
|
return s + "K";
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
interface Simple {
|
public interface Simple {
|
||||||
default String test(String s) {
|
default String test(String s) {
|
||||||
return s + "K";
|
return s + "K";
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
interface Simple {
|
public interface Simple {
|
||||||
default String test(String s) {
|
default String test(String s) {
|
||||||
return s + "Fail";
|
return s + "Fail";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
fun bar(a: A<String, Int>, b: B<String>, c: C) {
|
internal fun bar(a: A<String, Int>, b: B<String>, c: C) {
|
||||||
val sa: String = a.foo()
|
val sa: String = a.foo()
|
||||||
val sb: String = b.foo()
|
val sb: String = b.foo()
|
||||||
val sc: String = c.foo()
|
val sc: String = c.foo()
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ public object Objects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal open class NestedClass
|
public open class NestedClass
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ PsiJetFileStubImpl[package=]
|
|||||||
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
REFERENCE_EXPRESSION:[referencedName=kotlin]
|
||||||
REFERENCE_EXPRESSION:[referencedName=Unit]
|
REFERENCE_EXPRESSION:[referencedName=Unit]
|
||||||
CLASS:[fqName=Objects.NestedClass, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=NestedClass, superNames=[]]
|
CLASS:[fqName=Objects.NestedClass, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=false, name=NestedClass, superNames=[]]
|
||||||
MODIFIER_LIST:[open internal]
|
MODIFIER_LIST:[open public]
|
||||||
PRIMARY_CONSTRUCTOR:
|
PRIMARY_CONSTRUCTOR:
|
||||||
MODIFIER_LIST:[public]
|
MODIFIER_LIST:[public]
|
||||||
VALUE_PARAMETER_LIST:
|
VALUE_PARAMETER_LIST:
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@
|
|||||||
// ACTION: Convert to block body
|
// ACTION: Convert to block body
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
fun test(): A = <caret>Foo(2, "2")
|
internal fun test(): A = <caret>Foo(2, "2")
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = B.Foo<Int, String>(2, "2")
|
internal fun test() = B.Foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = B.<caret>Foo<Int, String>(2, "2")
|
internal fun test() = B.<caret>Foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = b.Foo<Int, String>(2, "2")
|
internal fun test() = b.Foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = b.<caret>Foo<Int, String>(2, "2")
|
internal fun test() = b.<caret>Foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = b.Foo<String>(2, "2")
|
internal fun test() = b.Foo<String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = b.<caret>Foo<String>(2, "2")
|
internal fun test() = b.<caret>Foo<String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = b.Foo<T, Int, String>(2, "2")
|
internal fun test() = b.Foo<T, Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = b.<caret>Foo<T, Int, String>(2, "2")
|
internal fun test() = b.<caret>Foo<T, Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = B.Foo<String>(2, "2")
|
internal fun test() = B.Foo<String>(2, "2")
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
// "Create class 'Foo'" "true"
|
// "Create class 'Foo'" "true"
|
||||||
// ERROR: Unresolved reference: Foo
|
// ERROR: Unresolved reference: Foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test() = B.<caret>Foo<String>(2, "2")
|
internal fun test() = B.<caret>Foo<String>(2, "2")
|
||||||
}
|
}
|
||||||
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
// ACTION: Convert to block body
|
// ACTION: Convert to block body
|
||||||
// ACTION: Create member property 'A'
|
// ACTION: Create member property 'A'
|
||||||
// ERROR: Unresolved reference: A
|
// ERROR: Unresolved reference: A
|
||||||
fun foo(): J = J.<caret>A
|
internal fun foo(): J = J.<caret>A
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@
|
|||||||
// ACTION: Convert to block body
|
// ACTION: Convert to block body
|
||||||
// ACTION: Create member property 'A'
|
// ACTION: Create member property 'A'
|
||||||
// ERROR: Unresolved reference: A
|
// ERROR: Unresolved reference: A
|
||||||
fun foo(): X = E.<caret>A
|
internal fun foo(): X = E.<caret>A
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
fun test(a: A): Int? {
|
internal fun test(a: A): Int? {
|
||||||
return a.foo<String, Int>(1, "2")
|
return a.foo<String, Int>(1, "2")
|
||||||
}
|
}
|
||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
fun test(a: A): Int? {
|
internal fun test(a: A): Int? {
|
||||||
return a.<caret>foo<String, Int>(1, "2")
|
return a.<caret>foo<String, Int>(1, "2")
|
||||||
}
|
}
|
||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test(): Int {
|
fun test(): Int {
|
||||||
return b.foo<Int, String>(2, "2")
|
return b.foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test(): Int {
|
fun test(): Int {
|
||||||
return b.<caret>foo<Int, String>(2, "2")
|
return b.<caret>foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test(): Int {
|
fun test(): Int {
|
||||||
return b.foo<Int>(2, "2")
|
return b.foo<Int>(2, "2")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test(): Int {
|
fun test(): Int {
|
||||||
return b.<caret>foo<Int>(2, "2")
|
return b.<caret>foo<Int>(2, "2")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test(): Int {
|
fun test(): Int {
|
||||||
return b.foo<Int, String>(2, "2")
|
return b.foo<Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create member function 'foo'" "true"
|
// "Create member function 'foo'" "true"
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
class A<T>(val b: B<T>) {
|
class A<T> internal constructor(val b: B<T>) {
|
||||||
fun test(): Int {
|
fun test(): Int {
|
||||||
return b.<caret>foo<T, Int, String>(2, "2")
|
return b.<caret>foo<T, Int, String>(2, "2")
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// "Create secondary constructor" "true"
|
// "Create secondary constructor" "true"
|
||||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||||
|
|
||||||
class B: J(1) {
|
internal class B: J(1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
// "Create secondary constructor" "true"
|
// "Create secondary constructor" "true"
|
||||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||||
|
|
||||||
class B: J(<caret>1) {
|
internal class B: J(<caret>1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Create secondary constructor" "true"
|
// "Create secondary constructor" "true"
|
||||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||||
|
|
||||||
fun test() = J(1)
|
internal fun test() = J(1)
|
||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Create secondary constructor" "true"
|
// "Create secondary constructor" "true"
|
||||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||||
|
|
||||||
fun test() = J(<caret>1)
|
internal fun test() = J(<caret>1)
|
||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create secondary constructor" "true"
|
// "Create secondary constructor" "true"
|
||||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||||
|
|
||||||
class B: J {
|
internal class B: J {
|
||||||
constructor(): super(1) {
|
constructor(): super(1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
// "Create secondary constructor" "true"
|
// "Create secondary constructor" "true"
|
||||||
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
// ERROR: Too many arguments for public/*package*/ constructor J() defined in J
|
||||||
|
|
||||||
class B: J {
|
internal class B: J {
|
||||||
constructor(): super(<caret>1) {
|
constructor(): super(<caret>1) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Create parameter 's'" "true"
|
// "Create parameter 's'" "true"
|
||||||
// ERROR: Unresolved reference: s
|
// ERROR: Unresolved reference: s
|
||||||
|
|
||||||
fun foo(s: String?) = C(s)
|
internal fun foo(s: String?) = C(s)
|
||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// "Create parameter 's'" "true"
|
// "Create parameter 's'" "true"
|
||||||
// ERROR: Unresolved reference: s
|
// ERROR: Unresolved reference: s
|
||||||
|
|
||||||
fun foo() = C(<caret>s)
|
internal fun foo() = C(<caret>s)
|
||||||
Vendored
+1
-1
@@ -3,6 +3,6 @@
|
|||||||
// ACTION: Create extension property 'foo'
|
// ACTION: Create extension property 'foo'
|
||||||
// ERROR: Unresolved reference: foo
|
// ERROR: Unresolved reference: foo
|
||||||
|
|
||||||
fun test(a: A): String? {
|
internal fun test(a: A): String? {
|
||||||
return a.<caret>foo
|
return a.<caret>foo
|
||||||
}
|
}
|
||||||
+1
-1
@@ -19,7 +19,7 @@ class Frame {
|
|||||||
public void addWindowListener(WindowListener listener){}
|
public void addWindowListener(WindowListener listener){}
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class Client extends Frame {
|
final class Client extends Frame {
|
||||||
Client() {
|
Client() {
|
||||||
WindowAdapter a = new WindowAdapter() {
|
WindowAdapter a = new WindowAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ internal open class Frame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Client internal constructor() : Frame() {
|
internal class Client : Frame() {
|
||||||
init {
|
init {
|
||||||
val a = object : WindowAdapter() {
|
val a = object : WindowAdapter() {
|
||||||
override fun windowClosing() {
|
override fun windowClosing() {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package test;
|
package test;
|
||||||
|
|
||||||
class JavaClass {
|
public class JavaClass {
|
||||||
public int field = 0;
|
public int field = 0;
|
||||||
|
|
||||||
protected int myProperty = 0;
|
protected int myProperty = 0;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
internal open class JavaClass {
|
open class JavaClass {
|
||||||
var field = 0
|
var field = 0
|
||||||
|
|
||||||
var property = 0
|
var property = 0
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package test;
|
package test;
|
||||||
|
|
||||||
class C extends JavaClass {
|
public class C extends JavaClass {
|
||||||
public void foo(JavaClass javaClass) {
|
public void foo(JavaClass javaClass) {
|
||||||
javaClass.field++;
|
javaClass.field++;
|
||||||
--javaClass.field;
|
--javaClass.field;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package test;
|
package test;
|
||||||
|
|
||||||
class C extends JavaClass {
|
public class C extends JavaClass {
|
||||||
public void foo(JavaClass javaClass) {
|
public void foo(JavaClass javaClass) {
|
||||||
javaClass.setField(javaClass.getField() + 1);
|
javaClass.setField(javaClass.getField() + 1);
|
||||||
javaClass.setField(javaClass.getField() - 1);
|
javaClass.setField(javaClass.getField() - 1);
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
class B {
|
public class B {
|
||||||
void foo(AAA a) {
|
void foo(AAA a) {
|
||||||
a.setX(a.getX() + 1);
|
a.setX(a.getX() + 1);
|
||||||
y += "a";
|
y += "a";
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
internal class B {
|
class B {
|
||||||
fun foo(a: AAA) {
|
internal fun foo(a: AAA) {
|
||||||
a.x = a.x + 1
|
a.x = a.x + 1
|
||||||
yy += "a"
|
yy += "a"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
@@ -5,3 +5,6 @@ Cannot access 'InternalClass2': it is 'internal' in 'test' at line 19, column 15
|
|||||||
Cannot access 'InternalClassAnnotation': it is 'internal' in 'test' at line 10, column 2
|
Cannot access 'InternalClassAnnotation': it is 'internal' in 'test' at line 10, column 2
|
||||||
Cannot access 'InternalFileAnnotation': it is 'internal' in 'test' at line 1, column 7
|
Cannot access 'InternalFileAnnotation': it is 'internal' in 'test' at line 1, column 7
|
||||||
Cannot access 'member': it is 'invisible_fake' in 'ClassAA1' at line 27, column 25
|
Cannot access 'member': it is 'invisible_fake' in 'ClassAA1' at line 27, column 25
|
||||||
|
Subclass effective visibility 'public' should be the same or less permissive than its superclass effective visibility 'internal' at line 18, column 36
|
||||||
|
Subclass effective visibility 'public' should be the same or less permissive than its superclass effective visibility 'internal' at line 19, column 15
|
||||||
|
Subclass effective visibility 'public' should be the same or less permissive than its superclass effective visibility 'internal' at line 8, column 36
|
||||||
@@ -4,3 +4,5 @@ Cannot access 'InternalClass1': it is 'internal' in 'test' at line 8, column 36
|
|||||||
Cannot access 'InternalClassAnnotation': it is 'internal' in 'test' at line 10, column 2
|
Cannot access 'InternalClassAnnotation': it is 'internal' in 'test' at line 10, column 2
|
||||||
Cannot access 'InternalTestAnnotation': it is 'internal' in 'test' at line 1, column 7
|
Cannot access 'InternalTestAnnotation': it is 'internal' in 'test' at line 1, column 7
|
||||||
Cannot access 'member': it is 'invisible_fake' in 'ClassAA1' at line 27, column 25
|
Cannot access 'member': it is 'invisible_fake' in 'ClassAA1' at line 27, column 25
|
||||||
|
Subclass effective visibility 'public' should be the same or less permissive than its superclass effective visibility 'internal' at line 18, column 36
|
||||||
|
Subclass effective visibility 'public' should be the same or less permissive than its superclass effective visibility 'internal' at line 8, column 36
|
||||||
Vendored
+1
@@ -22,5 +22,6 @@ Cannot access 'A': it is 'internal' in 'a'
|
|||||||
Cannot access 'FileAnnotation': it is 'internal' in 'a'
|
Cannot access 'FileAnnotation': it is 'internal' in 'a'
|
||||||
Cannot access 'ClassAnnotation': it is 'internal' in 'a'
|
Cannot access 'ClassAnnotation': it is 'internal' in 'a'
|
||||||
Cannot access 'ClassAnnotation': it is 'internal' in 'a'
|
Cannot access 'ClassAnnotation': it is 'internal' in 'a'
|
||||||
|
Function effective visibility 'public' should be the same or less permissive than its parameter type effective visibility 'internal'
|
||||||
Cannot access 'A': it is 'internal' in 'a'
|
Cannot access 'A': it is 'internal' in 'a'
|
||||||
Cannot access 'a': it is 'internal' in 'a'
|
Cannot access 'a': it is 'internal' in 'a'
|
||||||
@@ -24,7 +24,7 @@ public class M {
|
|||||||
public fun applyM<T>(arg: T, func: (T)->T): T = func(arg)
|
public fun applyM<T>(arg: T, func: (T)->T): T = func(arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
private class N {
|
internal class N {
|
||||||
inline
|
inline
|
||||||
public fun applyN<T>(arg: T, func: (T)->T): T = func(arg)
|
public fun applyN<T>(arg: T, func: (T)->T): T = func(arg)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class ListBinarySearchTest {
|
|||||||
|
|
||||||
fun notFound(index: Int) = -(index + 1)
|
fun notFound(index: Int) = -(index + 1)
|
||||||
|
|
||||||
val comparator = compareBy<IncomparableDataItem<Int>?> { it?.value }
|
private val comparator = compareBy<IncomparableDataItem<Int>?> { it?.value }
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun binarySearchByElement() {
|
fun binarySearchByElement() {
|
||||||
|
|||||||
Reference in New Issue
Block a user