After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655608 - Access control when implementing an interface
Access control when implementing an interface
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Semantic Analyzer
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks: 686542
 
 
Reported: 2011-07-29 21:27 UTC by Raul Gutierrez Segales
Modified: 2018-05-22 14:06 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Raul Gutierrez Segales 2011-07-29 21:27:01 UTC
Right now Vala allows you doing:

public interface EmailDetails : Object
{
  public abstract Set<FieldDetails> email_addresses { get; set; }
}

public class Person,
   EmailDetails
{
  public Set<FieldDetails> email_addresses
    {
      get { return this._email_addresses_ro; }
      private set
        {
           // ....
        }
    }
}

whereas one would expect that the setter should have the same access type as the interface being implemented... 

But things get really confusing because the set of email_addresses in Person *is* actually public, cause the following code works (!!):

Person p = new Person();
p.email_addresses = emails; // <-- shouldn't be allowed!The interface wins.
Comment 1 GNOME Infrastructure Team 2018-05-22 14:06:41 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/218.