IntelliJ IDEA未显示成员字段

时间:2017-09-07 03:45:06

标签: java intellij-idea

问题如下图所示,是否有任何选项可以启用显示成员abc

enter image description here

我正在使用IntelliJ IDEA CE 2017.2.1和JDK 9 + 179。

以上是示例代码:

    public class Test {

        @FunctionalInterface
        interface IF {
            String abc = "abc";

            void apply();
        }

        public static void main(String[] args) {
            IF theIF = ()->{};

            System.out.println(theIF.abc); // I can print `abc` value here, but...
            theIF. // DOT here(press ctrl + space) not show member `abc`
        }
    }

1 个答案:

答案 0 :(得分:3)

这是使用实例限定符访问静态成员,最好以IF.abc完成。因此代码完成并不能立即提供,但如果你第二次按下Ctrl + Space,则应该建议。