473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ICE in explicit override of interface property getter

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<Sched uledTask^>^
Node
{
System::Collections::Generic::LinkedListNode<Sched uledTask^>^ get();
}
};

public:
ref class ScheduledTask sealed : ITask
{
initonly System::Collections::Generic::LinkedListNode<Sched uledTask^>^
me;

property System::Collections::Generic::LinkedListNode<Sched uledTask^>^
Node
{
virtual System::Collections::Generic::LinkedListNode<Sched uledTask^>^
get() sealed = ITask::Node::get
{
return me;
}
}

public:
ScheduledTask()
{
me = gcnew
System::Collections::Generic::LinkedListNode<Sched uledTask^>(this);
}
};
};
Nov 16 '06 #1
5 1267
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/feedbac...spx?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/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 17 '06 #2

""Gary Chang[MSFT]"" <v-******@online.microsoft.comwrote in message
news:lz**************@TK2MSFTNGXA01.phx.gbl...
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/feedbac...spx?SiteID=210
Please validate:
https://connect.microsoft.com/Visual...dbackID=239629
>
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/subscripti...ult.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/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 20 '06 #3
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/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '06 #4

""Gary Chang[MSFT]"" <v-******@online.microsoft.comwrote in message
news:i4**************@TK2MSFTNGXA01.phx.gbl...
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.

>
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.
>
Thanks!

Best regards,

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

Nov 21 '06 #5
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/subscripti...ult.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 22 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Eric Johannsen | last post by:
I have a simple object that inherits from CollectionBase and overrides the Count property: namespace MyTest { public class CollTest : System.Collections.CollectionBase { public override int...
4
by: Jimbo | last post by:
I am sort of new to C#. Currently have a private property called "_name" in a class. I have written a public getter and setter routine for it called "Name". Currently, the getter for the...
0
by: Henrik de Jong | last post by:
Some additional information: I've got an business-object wich has a property Value wich will retreive the value of a databasefield. To bind this object to an datagrid this object should...
4
by: amaca | last post by:
This does what I expect (as it should, it's from Hoffman and Kruger's C# Unleashed): public interface ISpeak { void Speak(); } public abstract class Animal : ISpeak {
2
by: fred | last post by:
Hi, Why should I do a cast (IOfferSetter) in the constructor of the Test class? Thanks. Fred public interface IOfferSetter { object Offer { set;} } public class OfferCtx {
14
by: Noone | last post by:
Hello all, Ok, I want to create a program that will load plugins (dll's) from a plugin folder. I can create the forms and put them into a dll but I cannot actually add them dynamically at run...
2
by: =?Utf-8?B?d2R1ZGVr?= | last post by:
I know that I can't declare a method in an interface as virtual and override it, when I am using an explicit interface, but I am wondering if anyone else has come across this problem and how they...
7
by: christian2.schmidt | last post by:
Hi, I'm trying to wrap an IList-instance in a native template class with a "vector"-like interface. cliext::vector seems not suited, as it copies the list - correct me if I'm wrong. template...
2
by: puzzlecracker | last post by:
I don't see the purpose of explicit interface implementation other than to hide its signature in the class that implements it, and, instead, write your own, perhaps with a different signature,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.