Spurious "method is not visible" when parent class has abstract methods

Issue #1592 resolved
Eric Kintzer created an issue

Forgive me if there’s already an issue that describes this …but I run across it when using the fflib pattern

Given a top level class Foo

public abstract class Foo implements IFoo {
    abstract List<Schema.SObjectField> getSobjectFieldList();
}

and interface IFoo

public interface IFoo {}

and a sub class Bar

public abstract class Bar extends Foo {
    abstract List<Schema.SObjectField> getSObjectFieldList();
}

and a subsubclass FooBar (concrete impl)

public virtual class FooBar extends Bar {
    public List<Schema.SObjectField> getSObjectFieldList() {
        return new List<Schema.SObjectField>{
                Account.Name
        };
    }
}

then IC2 will syntax highlight both Bar and FooBar as shown in images below

The Apex compiler accepts this as valid input and this code executes just fine:

FooBar fb = new FooBar();
System.debug(LoggingLevel.INFO,fb.getSObjectFieldList());

yields:
18:13:37.21 (24128024)|USER_DEBUG|[2]|INFO|(Name)

Comments (3)

  1. Scott Wells repo owner

    Eric, with the changes I just committed for #1609 I'm not seeing any issues with the provided code:

    Issue_1592.png

    The fix for the other issue properly takes private/default visibility into account for override relationships, so I think it should address the problems you were seeing here as well.

    I'm going to plan to resolve this one along with #1609 when I release the next build, but if you do see these issues continue, just reopen and let me know.

  2. Log in to comment