在使用Intellij关于异常时,我遇到了一个奇怪的编译错误,这是一个错误吗?

问题描述 投票:1回答:1

当基类具有与派生类具有相同名称和参数的私有方法时,IntelliJ似乎感到困惑。

    static class A {
        private void a() {
        }
    }

    static class B extends A {
        void a() throws InterruptedException {
        }

        void b() {
            try {
                a();
            } catch (InterruptedException e) {
                // can't catch here
                // IntelliJ is not happy
            }
        }
    }
intellij-idea javac
1个回答
1
投票

是的,这种行为是一个错误。它将被修复。

披露:我是IntelliJ IDEA开发人员,负责相应的子系统。

© www.soinside.com 2019 - 2024. All rights reserved.