Skip to content
This repository was archived by the owner on Jan 3, 2025. It is now read-only.

Latest boo improvements including fix to case 459750 #10

Merged
merged 44 commits into from
Jul 24, 2012
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
b73bb4a
avoid ArithmeticOverflowException (that will occur after fixing handl…
bamboo Mar 12, 2012
c04067f
When multiple properties are found with the same name, attempt to res…
aaronlerch Mar 28, 2012
09d679b
Fix incorrect namespace.
aaronlerch Mar 28, 2012
c8d1829
Merge pull request #21 from aaronlerch/master
bamboo Mar 30, 2012
41e1d15
ensure the right overload is being called
bamboo Mar 30, 2012
2476bfb
migrate project files to VS2010
bamboo Mar 31, 2012
5ec4479
test case for macro produced type used as a generic argument
bamboo Mar 31, 2012
ad5dbf4
docstrings for blockless macro
bamboo Mar 31, 2012
4a2ebae
ParameterDeclaration.Lift(ReferenceExpression | TryCastExpression)
bamboo Apr 1, 2012
4f8045f
GenericParameterDeclaration.Lift(ReferenceExpression | SimpleTypeRefe…
bamboo Apr 3, 2012
d869aea
[booish] fix how external generic types are described
bamboo Apr 8, 2012
393127f
[booish] show descriptions for namespaces and others
bamboo Apr 8, 2012
85c08a0
[booish] allow setting values
bamboo Apr 8, 2012
c4d32e9
introduce EnvironmentBoundValue for threading original environment wi…
bamboo Apr 8, 2012
3fbd680
[booish] fix completion by accessing entities in the correct environment
bamboo Apr 8, 2012
c2cef14
[booish] display IEnumerable[of T] as T*
bamboo Apr 8, 2012
8981b6c
[booish] fix autocomplete behavior
bamboo Apr 8, 2012
2adc9c9
fix test exception handler
bamboo Apr 12, 2012
455022a
don't depend on Tuple (and .net 4) just yet
bamboo Apr 12, 2012
5cd5382
remove unused code
bamboo Apr 12, 2012
32507dc
transient is now an attribute
bamboo Apr 12, 2012
f373173
prefer quasiquotes over ast api
bamboo Apr 12, 2012
fb68b45
Boo.Lang.List.AddRange
bamboo Apr 12, 2012
a21a046
code gardening
bamboo Apr 12, 2012
853b753
embrace System.Func
bamboo Apr 12, 2012
29d60e3
remove method already supported by System.Linq
bamboo Apr 12, 2012
480e518
code gardening
bamboo Apr 12, 2012
5c97526
template gardening
bamboo Apr 12, 2012
e2785d2
Extend => AddRange
bamboo Apr 12, 2012
85195cc
code gardening
bamboo Apr 12, 2012
1cacd1e
update tests to new syntax
bamboo May 4, 2012
bcd95c1
code gardening
bamboo May 4, 2012
5d92426
introducing AstNodePredicates for extension method predicates on ast …
bamboo May 4, 2012
8623f85
extract RuntimeMethodCache out of ProcessMethodBodies
bamboo May 4, 2012
03dbd48
code gardening (move entity predicates to EntityExtensions)
bamboo May 4, 2012
3862e61
SecurityPermissionAttribute is no more
bamboo May 4, 2012
75796ae
check array indices as a separate step (so it also runs for unityscri…
bamboo May 4, 2012
e514377
fix project references
bamboo May 4, 2012
8391756
workaround mono limitation
bamboo May 4, 2012
f9b300c
unnecessary comment removed
bamboo May 5, 2012
d2ee05b
Merge branch 'master' of github.com:bamboo/boo into upstream
bamboo May 7, 2012
386d556
don't embrace System.Func on Boo.Lang just yet
bamboo May 7, 2012
f2eb1a0
minor test cleanup
bamboo May 7, 2012
c5d9aa6
Merge branch 'master' of github.com:bamboo/boo into upstream
bamboo May 7, 2012
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/Boo.Lang/Runtime/DynamicDispatching/SliceDispatcherFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Boo.Lang.Runtime.DynamicDispatching
Expand Down Expand Up @@ -115,8 +116,20 @@ private MemberInfo[] ResolveMember()
public Dispatcher CreateSetter()
{
MemberInfo[] candidates = ResolveMember();
if (candidates.Length > 1) throw new AmbiguousMatchException(Builtins.join(candidates, ", "));
return CreateSetter(candidates[0]);
if (candidates.Length == 1) return CreateSetter(candidates[0]);
return EmitMethodDispatcher(Setters(candidates));
}

private IEnumerable<MethodInfo> Setters(MemberInfo[] candidates)
{
foreach (MemberInfo info in candidates)
{
PropertyInfo p = info as PropertyInfo;
if (null == p) continue;
MethodInfo setter = p.GetSetMethod(true);
if (null == setter) continue;
yield return setter;
}
}

private Dispatcher CreateSetter(MemberInfo member)
Expand Down
24 changes: 24 additions & 0 deletions tests/testcases/regression/duck-default-setter-overload.boo
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[System.Reflection.DefaultMember("Item")]
class Container:
private _value as object

Item(index as object):
get:
return _value
set:
_value = value

Item(index as string):
get:
return _value
set:
_value = value


d = Container() as duck

str = "index"
obj = Object()

d[str] = "the string indexer value"
d[obj] = "the object indexer value"