[英]Kotlin: Unresolved reference on custom class instance
我有一个名为HttpsAuthenticator的 Kotlin 类。 该类所在的文件也具有相同的名称。 HttpsAuthenticator有一个名为 XYZ 的内部类。 这是代码:
HttpsAuthenticator
public class HttpsAuthenticator { public class XYZ{ } }
在另一个类中,当我实例化这两个类中的每一个时, HttpsAuthenticator()失败并显示错误Unresolved reference 。 有什么不同。 如何实例化HttpsAuthenticator ? 我对 Kotlin 完全陌生,所以我一定缺少一些我认为的基本知识?
HttpsAuthenticator()
Unresolved reference
最终修复它只是添加import HttpsAuthenticator
import HttpsAuthenticator
为什么在此之前 XYZ 是可见的,目前我无法理解。 我相信有人会对此做出解释。
[英]Kotlin: Unresolved Reference for variable from instantiated class
[英]Unresolved reference to function in custom class
[英]kotlin Unresolved reference: Class of the other library module
[英]Unresolved reference: Coin in kotlin
[英]Kotlin : error: unresolved reference for a method inside a sealed class
[英]Unresolved attribute reference '__' for class '__'
[英]unresolved reference error for callable in another Kotlin file
[英]Unable to reference sub class in Kotlin
[英]reference instance attribute in child class
[英]c# class reference as opposed to instance reference
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.