#1667 protected modifier provides internal access

Yuri Strot Fri 7 Oct 2011

In Java protected modifier means method/field can be accessed within its own package and by a subclass. In Fantom protected modifier restrict permissions to subclasses only. I think it makes sense but sometimes I want to use Java-like protected modifier. However I can't combine these modifiers, so I need to use something like this:

abstract protected Void overrideMe()

internal Void callMeInternaly() { overrideMe() }

Is it make sense to allow protected + internal instead?

abstract protected internal Void useMe()

brian Fri 7 Oct 2011

Actually I didn't know protected worked that way in Java. I would say we just make protected give internal access - its simpler than allowing multiple permission flags. Any disagreements with that proposal?

Yuri Strot Fri 7 Oct 2011

Works well for me.

andy Fri 7 Oct 2011

In Java protected modifier means method/field can be accessed within its own package

Actually didn't know that either - would have been quite useful back in my Java days.

Akcelisto Fri 7 Oct 2011

make protected give internal access

+1

brian Sat 8 Oct 2011

Renamed from No protected + internal modifier to protected modifier provides internal access

brian Sat 8 Oct 2011

Promoted to ticket #1667 and assigned to brian

brian Sat 8 Oct 2011

Ticket resolved in 1.0.61

Login or Signup to reply.