Home » Category » DotNet Visual C

DotNet Visual C: ICE in explicit override of interface property getter

206| Thu, 03 Jan 2008 18:02:00 GMT| benvoigt| Comments (5)
Getting a C1001 internal error off the following code:
I've found an alternate means of making the Node property accessible in the parent class only using a public interface, private implementation class,
and static_cast to downcast, but now I'm stuck wondering how to prevent any other class from being derived from that interface!
Still thought I'd post this ICE to see if anyone else can validate it.
ref class PrioritizedWorkScheduler
{
public:
ref class ScheduledTask;
private:
interface class ITask
{
property System::Collections::Generic::LinkedListNode<ScheduledTask
Node
{
System::Collections::Generic::LinkedListNode<ScheduledTask get();
}
};
public:
ref class ScheduledTask sealed : ITask
{
initonly System::Collections::Generic::LinkedListNode<ScheduledTask
me;
property System::Collections::Generic::LinkedListNode<ScheduledTask
Node
{
virtual System::Collections::Generic::LinkedListNode<ScheduledTask
get() sealed = ITask::Node::get
{
return me;
}
}
public:
ScheduledTask()
{
me = gcnew
System::Collections::Generic::LinkedListNode<ScheduledTask^>(this);
}
};
};

Keywords & Tags: ice, explicit, override, interface, property, getter, dotnet, visual, .net

URL: http://dotnet.itags.org/visual-c/71193/
 
«« Prev - Next »» 5 helpful answers below.
Hi Ben,

I have already repro this problem in our local machine and forward it to
our product team for review. I will update when I get the result.

Thanks for reporting this issue to us and I suggest you can also submit it
in our feedback center, our development team may communicate with you
directly on
the issue there:

http://connect.microsoft.com/feedba...aspx?SiteID=210
Have a nice weekend!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

garychangmsft | Thu, 03 Jan 2008 18:03:00 GMT |

""Gary Chang[MSFT]"" <v-garych...online.microsoft.comwrote in message
news:lz8LI2hCHHA.1984...TK2MSFTNGXA01.phx.gbl...
Quote:
Originally Posted by
Hi Ben,
>
I have already repro this problem in our local machine and forward it to
our product team for review. I will update when I get the result.
>
Thanks for reporting this issue to us and I suggest you can also submit it
in our feedback center, our development team may communicate with you
directly on
the issue there:
>
http://connect.microsoft.com/feedba...aspx?SiteID=210

Please validate:
https://connect.microsoft.com/Visua...edbackID=239629
Quote:
Originally Posted by
>
Have a nice weekend!
>
Best regards,
>
Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
>
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscript...rt/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>

benvoigt | Thu, 03 Jan 2008 18:04:00 GMT |

Hi Ben,

I also got the confiormation from the corresponding product team-- this is
a compiler bug, even in current builds. There isn't much workaround that
we can find without changing the hierarchy of the interface and class.

Do you need the interface ITask and ScheduledTask being nested in
PrioritizedWorkScheduler?

If you wants ITask to be only visible to ScheduledTask, we suggest you
could make ITask a private in an assembly and ScheduledTask be a public
explicit implementation in that same assembly.

By the way, thanks for submit that bug report in our feedback center, our
product team engineer would take care of it.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

garychangmsft | Thu, 03 Jan 2008 18:05:00 GMT |

Thanks for the response, Ben.

By the way, I suggest you monitor the issue you submit in the feedback
center, our product team engineer also would follow up there.

Good Luck!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

garychangmsft | Thu, 03 Jan 2008 18:07:00 GMT |

""Gary Chang[MSFT]"" <v-garych...online.microsoft.comwrote in message
news:i4x8EYRDHHA.1976...TK2MSFTNGXA01.phx.gbl...
Quote:
Originally Posted by
Hi Ben,
>
I also got the confiormation from the corresponding product team-- this is
a compiler bug, even in current builds. There isn't much workaround that
we can find without changing the hierarchy of the interface and class.
>
Do you need the interface ITask and ScheduledTask being nested in
PrioritizedWorkScheduler?
>
If you wants ITask to be only visible to ScheduledTask, we suggest you
could make ITask a private in an assembly and ScheduledTask be a public
explicit implementation in that same assembly.

The idea was that ITask members would be only visible to
PrioritizedWorkScheduler, and an opaque handle to the clients... so I did
the C opaque handle thing (I've also taken the class native -- mixing
managed and native code is just awesome, and I can use pragma unmanaged to
guarantee certain functions can't be interrupted by garbage collection):

class PrioritizedWorkScheduler

{

public:

struct ScheduledTaskImpl;

typedef ScheduledTaskImpl* ScheduledTask;

typedef std::list<ScheduledTaskTaskList;

typedef TaskList::iterator TaskNode;

};

Downside is that now there can be no publicly available members in
ScheduledTaskImpl. But if I need that, I can make a public interface, and
change ScheduledTask from a raw pointer typedef to a pointer wrapper class
with operator->() cast to the interface.

Quote:
Originally Posted by
>
By the way, thanks for submit that bug report in our feedback center, our
product team engineer would take care of it.

I think C# forbids what I was trying to do, it would generate an error
message "base class is less visible than derived class"... not sure if I've
seen that error generated for an interface or only base classes though.
Quote:
Originally Posted by
>
Thanks!
>
Best regards,
>
Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscript...ault.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
>

benvoigt | Thu, 03 Jan 2008 18:07:00 GMT |

DotNet Visual C Hot Answers

DotNet Visual C New questions

DotNet Visual C Related Categories