Permalink
Browse files

Treat interfaces roleishly, allowing $obj.CLR::System::IDisposable::D…

…ispose to work (fixes #56)
  • Loading branch information...
sorear committed Jan 29, 2012
1 parent f072aab commit 92251b189d24b2ea993dba02b118def8f8ac090d
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/NieczaCLR.cs
View
@@ -663,6 +663,13 @@ public class CLRWrapperProvider {
Array.Copy(pm.mo.mro, 0, mro, 1, pm.mo.mro.Length);
mro[0] = m;
m.FillClass(new string[] { }, new STable[] { }, new STable[] { pm }, mro);
+ foreach (Type ity in t.GetInterfaces())
+ m.mo.role_typecheck_list.Add(GetWrapper(ity));
+ if (t.IsInterface) {
+ m.mo.type = P6how.ROLE;
+ m.mo.rtype = "role";
+ m.mo.role_typecheck_list.Add(m);
+ }
HashSet<string> needNewWrapper = new HashSet<string>();
needNewWrapper.Add("new"); // don't inherit constructors

0 comments on commit 92251b1

Please sign in to comment.