Comments (7)
Looks like it's might be due to the shimsham class using a dictionary to store the method infos. If the key is just the method name, I'm suspecting it might be dropping any overloads, leaving room for just one.
from peanutbutter.
fascinating! I wasn't aware anyone else was actually using this!
any ideas for a fix? PRs are appreciated (:
from peanutbutter.
I'd probably start by modifying the lookup to use a key of tuple: (string: Type[]) so that the correct overload can be selected (or to be an IDictionary<string, MethodInfo> and select the correct one lazily - this might be slower if it's hot code, but probably provides the most flexibility
you're certainly using this beyond the original scope, but that's pretty cool (:
from peanutbutter.
I must admit that I rarely use this for method ducking - but I use this a lot for property ducking, especially off to dictionaries and NameValueCollections, so I'm quite pleased that someone else is (a) finding it useful and (b) pushing boundaries
from peanutbutter.
@aracicot-fusebill please check out package 3.0.10 - I've implemented overloads and also improved the fuzzy ducker for the case where the interface method and the ducked type have the same parameters, just in different orders, based on type - this won't re-order according to name, ie if we have:
// concrete type
public class Worker
{
public void DoWork(string str, int a)
{
}
}
// ducked interface
public interface IMyWorker
{
void DoWork(int a, string foo)
{
}
}
then we can do worker.FuzzyDuckAs<IMyWorker>()
and expect DoWork
to work appropriately, but if we have
public class Stringy
{
public void DoWork(string first, string second)
{
}
}
// ducked interface
public interface IMyStringy
{
void DoWork(string second, string first);
}
then we can DuckAs<IMyWorker>()
but the order of parameters will not be switched in the call
from peanutbutter.
@aracicot-fusebill have you had a chance to check out the latest package & see if it does what you're expecting?
from peanutbutter.
@aracicot-fusebill closing as I believe I've sorted this out; please re-open if need be.
from peanutbutter.
Related Issues (20)
- Servicepath can not be set // any documentation? HOT 3
- Feature: maintain order of sections and settings within file
- Quotes HOT 2
- CORS policy HOT 3
- semi-colon ini text value causes truncation HOT 21
- IniFile should not use ordinal Dictionary HOT 4
- ini Remove method leaves the key behind HOT 3
- Per-project documentation
- Switch build, pack & push to use `dotnet` HOT 1
- Project restructuring to simplify dev, especially multi-platform dev
- semi-colon ini text value causes truncation (2022) HOT 9
- SetValue return value HOT 1
- How to set encoding? HOT 1
- PeanutButter.INI: CommentDelimiter not respected when saving HOT 2
- PeanutButter.INI exception HOT 6
- [PeanutButter.INI] How can I add an empty line at the last line? HOT 6
- Update PeanutButter.EasyArgs to be AOT-friendly
- [PeanutButter.INI] - Not possible to persist ini file if there is a SectionSeparator and no section HOT 2
- PeanutButter.INI request for new Load overload HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peanutbutter.