DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    J W Cooper Guest

    illegally exposing your Friend type

    In Beta-2, I find that a function that returns an interface type gets
    flagged as an error.

    For example, I have an

    Interface MultiChoice 'with 3 methods
    Function getSelected() as ArrayList
    Sub Clear()
    Function getWindow() as Panel
    End Interface

    If I create a function

    Public Function getBuilder (any arg or none) as MultiChoice
    End Function

    I get the error

    getBuilder illegally exposes a Friend type outside the Public class
    'wBuilder'

    where "wBuilder" is the name of the class containing the function.

    I don;t get it. I don't see any Friends being invoked anywhere. Is this
    a bug?
    It doesn't seem right to me, and of course it USED to work.

    If I change that return type to Object, the program works fine, but
    without any type checking, of course.



  2. #2
    Bill McCarthy Guest

    Re: illegally exposing your Friend type

    Hi J W,

    try declaring the Interface as Public, eg:

    Public Interface MultiChoice
    .....

    "J W Cooper" <ctswim@ctswim.org> wrote in message
    news:3B4C4C6E.D7360077@ctswim.org...
    > In Beta-2, I find that a function that returns an interface type gets
    > flagged as an error.
    >
    > For example, I have an
    >
    > Interface MultiChoice 'with 3 methods
    > Function getSelected() as ArrayList
    > Sub Clear()
    > Function getWindow() as Panel
    > End Interface
    >
    > If I create a function
    >
    > Public Function getBuilder (any arg or none) as MultiChoice
    > End Function
    >
    > I get the error
    >
    > getBuilder illegally exposes a Friend type outside the Public class
    > 'wBuilder'
    >
    > where "wBuilder" is the name of the class containing the function.
    >
    > I don;t get it. I don't see any Friends being invoked anywhere. Is this
    > a bug?
    > It doesn't seem right to me, and of course it USED to work.
    >
    > If I change that return type to Object, the program works fine, but
    > without any type checking, of course.
    >
    >




  3. #3
    Jim Cooper Guest

    Re: illegally exposing your Friend type

    That was it. Thanks.

    Bill McCarthy wrote:

    >
    > try declaring the Interface as Public, eg:
    >
    > Public Interface MultiChoice
    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links