illegally exposing your Friend type


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: illegally exposing your Friend type

  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
    >



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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center