LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
avogadro5

Change class <-> interface

Status: New

I should be able to modify a class with no private data to be an interface and vice versa. This post indicates it's not readily possible currently. But, the documentation for interfaces is sprinkled with statements that they should be for the most part interchangeable with classes.

2 Comments
avogadro5
Member

After trying some hacks to accomplish this I see why it's not part of the IDE -- any class that multiple inherits from an interface breaks if it becomes a class (which makes sense) with no apparent way to fix the break (which doesn't make sense -- there should be a UI to remove extra parents). I had to edit the class XML for the child to remove reference to the new class that was an interface.

_carl
Member

I've found myself wanting this on a number of occasions too -- and have crashed LabVIEW more than once in the process of converting a class to an interface or vice versa.  Would be great if there was a simple right-click option to do this that handled making all of the appropriate updates (while gracefully [without crashing] breaking inheritancy trees).