Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Implement interface and default implementations

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Dec 03 2020 : 12:35:54 PM
Would be fine if the "Implement interface" feature could detect also default implementations in interfaces and offer to implement them in the class, but not implement by default.
Just to remember: Properties AND methods may have default implementations since C# 8.0

Example:
	internal interface ITest
	{
		public string TestString { get; set; }
		public string TestStringDef { get { return string.Empty; } }

		public bool TestBool()  { return true; }
		public int TestIntDef => 1;

		public void TestMethod();
	}


When I dont have TestBool() or any or the properties implemented, VA still tells me "No methods implemented"
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Dec 09 2020 : 08:31:12 AM
VA does not currently pick up interfaces for implement interface, as you are aware:

case=92161

I have added the C# 8 version to this case, since it is the same basic problem, and noted that the interfaces with a default implementation should not be selected by default. Thank you for the clear example.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000