Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Implement interface and default implementations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2318 Posts

Posted - Dec 03 2020 :  12:35:54 PM  Show Profile  Reply with Quote
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"

feline
Whole Tomato Software

United Kingdom
18724 Posts

Posted - Dec 09 2020 :  08:31:12 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000