jessiepathfinder / ikvm

The best IKVM.NET fork ever!
GNU Affero General Public License v3.0
151 stars 24 forks source link

IKVMC - internal compiler error #6

Open rjuergen opened 3 years ago

rjuergen commented 3 years ago

I get an internal compiler error during converting an jar to an dll:

PS C:\SMARD\IKVM> .\ikvm_8.6.5.1_bin_windows\ikvmc.exe .\example-1.0-SNAPSHOT.jar
IKVM.NET Compiler version 8.6.5.1
Copyright (C) 2020 Jessie Lesbian (based on work by Jeroen Frijters and Windward Studios)
http://www.ikvm.net/

note IKVMC0002: Output file is "example-1.0-SNAPSHOT.dll"

*** INTERNAL COMPILER ERROR ***

PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE

ikvmc, Version=8.6.5.1, Culture=neutral, PublicKeyToken=null
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
4.0.30319.42000 64-bit

System.InvalidOperationException: Der Vorgang ist aufgrund des aktuellen Zustands des Objekts ungültig.
   bei IKVM.Internal.Boxer.EmitBox(CodeEmitter ilgen, TypeWrapper tw)
   bei IKVM.Internal.LambdaMetafactory.EmitDispatch(FinishContext context, TypeWrapper[] args, TypeBuilder tb, MethodWrapper interfaceMethod, TypeWrapper[] implParameters, ConstantPoolItemMethodHandle implMethod, ConstantPoolItemMethodType instantiatedMethodType, FieldBuilder[] capturedFields)
   bei IKVM.Internal.LambdaMetafactory.CreateConstructorAndDispatch(FinishContext context, ConstantPoolItemInvokeDynamic cpi, TypeBuilder tb, List`1 methods, TypeWrapper[] implParameters, ConstantPoolItemMethodType samMethodType, ConstantPoolItemMethodHandle implMethod, ConstantPoolItemMethodType instantiatedMethodType, Boolean serializable)
   bei IKVM.Internal.LambdaMetafactory.EmitImpl(FinishContext context, ClassFile classFile, ConstantPoolItemInvokeDynamic cpi, BootstrapMethod bsm, CodeEmitter ilgen)
   bei IKVM.Internal.LambdaMetafactory.Emit(FinishContext context, ClassFile classFile, Int32 constantPoolIndex, ConstantPoolItemInvokeDynamic cpi, CodeEmitter ilgen)
   bei Compiler.Compile(Block block, Int32 startIndex)
   bei Compiler.Compile(FinishContext context, TypeWrapper host, DynamicTypeWrapper clazz, MethodWrapper mw, ClassFile classFile, Method m, CodeEmitter ilGenerator, Boolean& nonleaf)
   bei IKVM.Internal.DynamicTypeWrapper.FinishContext.FinishImpl()
   bei IKVM.Internal.DynamicTypeWrapper.JavaTypeImpl.FinishCore()
   bei IKVM.Internal.DynamicTypeWrapper.JavaTypeImpl.Finish()
   bei IKVM.Internal.AotTypeWrapper.Finish()
   bei IKVM.Internal.DynamicClassLoader.FinishAll()
   bei IKVM.Internal.CompilerClassLoader.Compile(String runtimeAssembly, List`1 optionsList)
   bei IkvmcCompiler.Compile(String[] args)
   bei IkvmcCompiler.Main(String[] args)

Reproducible with following code:

import java.util.Map;
import java.util.function.Supplier;

public interface LayerA {

    int getOuter();

    default Map<Object, Supplier<Object>> createQuery(Map<Object, Supplier<Object>> builder) {
        builder.put("B", getOuter() > -1 ? this::getOuter : () -> null);
        return builder;
    }

}

Or the simple example project: example.zip

Please help me :)

jessiepathfinder commented 3 years ago

Thisn bug is also bothering me. I will fix it ASAP.