Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

Commented Unassigned: Overload resolution not working with indexed property [25]

$
0
0
When an class have overloaded indexed property,
overload resolution with the property does not work.

class definition (C#)
```
public class MyDictionary
{
public Object this[Int32 index]
{
get { return this.GetItemByIndex(index); }
}
public String this[String name]
{
get { return this.GetItemByName(name); }
}
// ...
}
```

Code execution
```
var engine = new V8ScriptEngine();
var dic = new MyDictionary();
engine.AddHostObject("dic", dic);

engine.Execute("dic.Item.get(0);"); // works
engine.Execute("dic.Item.get('name');"); // throws ScriptEngineException
```
Comments: We can't reproduce the issue with ClearScript 5.3.8 and up, and AtsushiSuzuki hasn't sent an update in 10 days. Marking as resolved.

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>