More changes triggered by the changeover to .NET 2.0.I also did some C#
3.0 work which means that you can now do this:
using System;
using System.Collections;
using ikvm.extensions;
using java.util;
public class
Program
{
static void Main(string[] args)
{
try
{
var map =
new HashMap {
{ "foo", args.getClass() },
{ "bar", 2.getClass() }
};
foreach (DictionaryEntry de
in map)
Console.WriteLine("{0} = {1}", de.Key, de.Value);
}
catch (System.Exception x)
{
x.printStackTrace();
}
}
}
BTW, to enable defining extension methods without taking a dependency on
System.Core.dll, I've
defined my own copy of System.Runtime.CompilerServices.ExtensionAttribute
in IKVM.Runtime.dll (it's only public during the first compilation pass, so
it does not interfere with the real one in System.Core.dll if your project
references both IKVM.Runtime.dll and System.Core.dll).
Changes:
- Renamed GetEnumerator method in implicit IEnumerable implementation
to work around lame bug in Xml serialization.
- Added support for defining non-virtual instance methods in map.xml.
- Added "Add" method to java.util.AbstractCollection to make some of
the .NET magic work on Java collections.
- Reintroduced baked TypeBuilder scrubbing hack for .NET 2.0 SP1.
- Made core assembly detection more robust.
- Improved ikvmc error handling for -reference option.
- Added support for defining extension methods in the core class
library assembly (without taking a System.Core.dll dependency).
- Added the first two extension methods (Object.getClass() and
Exception.printStackTrace()).
- Optimized codegen for lcmp, fcmp<x>, dcmp<x> and shift opcodes.
- Construct custom attribute annotation proxies directly instead of
going through the trouble to encode/decode them.
- Added support for explicitly implementing an interface method with
the <override /> element in map.xml.
- Added new utility class to enumerate maps.
- Made java.util.AbstractMap enumerable and added Add() method to
support C# 3.0 collection initialization syntax.
WARNING: THIS IS A DEVELOPMENT SNAPSHOT, NOT AN OFFICIAL RELEASE.
Development snapshots are intended for evaluating and keeping track of where the project is going, not for production usage. The binaries have not been extensively tested
and are not strong named.
This version does not currently work with Mono.
Binaries available here:
ikvmbin-0.37.2970.zip