Internal compiler error 'wanted to cache cached value Nemerle.Builtins.Function.
От: _NN_ www.nemerleweb.com
Дата: 24.10.13 20:49
Оценка:
Сегодня у меня есть более интересная задачка чем написать макрос

Имеем две практически одинаковые сборки.
В одной есть эти строки, в другой нет:
  .method public hidebysig static void  F(class A.ABC _N_wildcard_4482,
                                          class [Nemerle]Nemerle.Builtins.FunctionVoid f) cil managed
  {
    .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
    .custom instance void [Nemerle]Nemerle.Internal.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
    // Code size       11 (0xb)
    .maxstack  1
    IL_0000:  newobj     instance void [mscorlib]System.Exception::.ctor()
    IL_0005:  throw

    IL_0006:  br         IL_0006
  } // end of method ABC::F


При добавлении ссылки на сборку получаем:
  error : Internal compiler error 'wanted to cache cached value Nemerle.Builtins.FunctionVoid`20
C:\Program Files (x86)\Nemerle\Net-4.0\Nemerle.MSBuild.targets(289,5): error : Internal compiler error 'wanted to cache cached value Nemerle.Builtins.FunctionVoid`20['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20]', please report a bug to bugs.nemerle.org. You can try modifying program near this location.
C:\Program Files (x86)\Nemerle\Net-4.0\Nemerle.MSBuild.targets(289,5): error : internal compiler error: assertion failed in file ncc\external\LibraryReferenceManager.n, line 545: wanted to cache cached value Nemerle.Builtins.FunctionVoid`20['p1, 'p2, 'p3, 'p4, 'p5, 'p6, 'p7, 'p8, 'p9, 'p10, 'p11, 'p12, 'p13, 'p14, 'p15, 'p16, 'p17, 'p18, 'p19, 'p20]
       at Nemerle.Compiler.LibraryReferenceManager.CacheTypeInfo(Type t, TypeInfo tc, Node node)
       at Nemerle.Compiler.LibraryReference.ExternalTypeInfo..ctor(LibraryReference lib, Type h, Node ns_node)
       at Nemerle.Compiler.LibraryReference.ConstructTypeInfo(Type reflected_type, Node ns_node)
       at Nemerle.Compiler.NamespaceTree.Node._N__N_lambda__85632__85652.apply(ExternalType e, list`1 acc)
       at Nemerle.Collections.NList.FoldLeft[T,TOut](list`1 l, TOut acc, Function`3 f)
       at Nemerle.Compiler.NamespaceTree.Node.LoadValue(NotLoadedList val)
       at Nemerle.Compiler.NamespaceTree.Node.LookupType(list`1 split, Int32 args_count)
       at Nemerle.Compiler.LibraryReference.TypeInfoOfType(Type framework_type)
       at Nemerle.Compiler.LibraryReference.TypeOfType(Map`2 _tenv, Type framework_type)
       at Nemerle.Compiler.LibraryReference.ExternalMethodInfo..ctor(Map`2 tenv, LibraryReference lib, MethodBase h)
       at Nemerle.Compiler.LibraryReference.ExternalTypeInfo.imember_of_memberinfo(MemberInfo m)
       at Nemerle.Compiler.LibraryReference.ExternalTypeInfo.collect_members()
       at Nemerle.Compiler.LibraryReference.ExternalTypeInfo.LookupMemberImpl(String name)
       at Nemerle.Compiler.LibraryReference.ExternalTypeInfo.decode_extension_methods(LibraryReferenceManager mgr)
       at Nemerle.Compiler.LibraryReference.ExternalTypeInfo..ctor(LibraryReference lib, Type h, Node ns_node)
       at Nemerle.Compiler.LibraryReference.ConstructTypeInfo(Type reflected_type, Node ns_node)
       at Nemerle.Compiler.NamespaceTree.Node.LookupType(list`1 split, Int32 args_count)
       at Nemerle.Compiler.LibraryReferenceManager.LoadExtensions()
       at Nemerle.Compiler.ManagerClass._N_tryEx_28087(_N_closureOf_LoadExternalLibraries_28069 _N_LoadExternalLibraries_cp_28086, FunctionVoid f)
       at Nemerle.Compiler.ManagerClass.LoadExternalLibraries()
       at Nemerle.Compiler.ManagerClass.Run()
       at Nemerle.CommandlineCompiler.MainClass.main_with_catching()


Ниже приведен код сборок.
Если убрать выделенные строки то все работает.

  Dll.il

//  Microsoft (R) .NET Framework IL Disassembler.  Version 4.0.30319.17929
//  Copyright (c) Microsoft Corporation.  All rights reserved.



// Metadata version: v4.0.30319
.assembly extern mscorlib
{
  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         // .z\V.4..
  .ver 4:0:0:0
}
.assembly extern Nemerle
{
  .publickeytoken = (E0 80 A9 C7 24 E2 BF CD )                         // ....$...
  .ver 1:2:0:154
}
.assembly extern NemerleWeb
{
  .ver 1:0:0:0
}
.assembly NemerleWeb.TypedJS
{
  .custom instance void [mscorlib]System.Reflection.AssemblyCultureAttribute::.ctor(string) = ( 01 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyCopyrightAttribute::.ctor(string) = ( 01 00 12 43 6F 70 79 72 69 67 68 74 20 C2 A9 20   // ...Copyright .. 
                                                                                                  20 32 30 31 33 00 00 )                            //  2013..
  .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyFileVersionAttribute::.ctor(string) = ( 01 00 07 31 2E 30 2E 30 2E 30 00 00 )             // ...1.0.0.0..
  .custom instance void [mscorlib]System.Runtime.InteropServices.GuidAttribute::.ctor(string) = ( 01 00 24 34 36 35 37 34 36 35 34 2D 33 64 32 33   // ..$46574654-3d23
                                                                                                  2D 34 36 62 32 2D 39 63 66 37 2D 38 38 61 38 36   // -46b2-9cf7-88a86
                                                                                                  35 65 66 63 33 39 66 00 00 )                      // 5efc39f..
  .custom instance void [mscorlib]System.Runtime.InteropServices.ComVisibleAttribute::.ctor(bool) = ( 01 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyTrademarkAttribute::.ctor(string) = ( 01 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyProductAttribute::.ctor(string) = ( 01 00 10 4E 65 6D 65 72 6C 65 57 65 62 2E 4A 53   // ...NemerleWeb.JS
                                                                                                41 70 69 00 00 )                                  // Api..
  .custom instance void [mscorlib]System.Reflection.AssemblyCompanyAttribute::.ctor(string) = ( 01 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyConfigurationAttribute::.ctor(string) = ( 01 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyDescriptionAttribute::.ctor(string) = ( 01 00 00 00 00 ) 
  .custom instance void [mscorlib]System.Reflection.AssemblyTitleAttribute::.ctor(string) = ( 01 00 12 4E 65 6D 65 72 6C 65 57 65 62 2E 54 79   // ...NemerleWeb.Ty
                                                                                              70 65 64 4A 53 00 00 )                            // pedJS..

  // --- The following custom attribute is added automatically, do not uncomment -------
  //  .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) 

  .hash algorithm 0x00008004
  .ver 1:0:0:0
}
.module NemerleWeb.TypedJS
// MVID: {D71AD809-FA6D-44EF-B12A-BAB0BB2C1C82}
.imagebase 0x00400000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003       // WINDOWS_CUI
.corflags 0x00000001    //  ILONLY
// Image base: 0x02180000


// =============== CLASS MEMBERS DECLARATION ===================

.class public abstract auto ansi sealed beforefieldinit NemerleWeb.TypedJS.JSStringExtensions
       extends [mscorlib]System.Object
{
  .custom instance void [NemerleWeb]NemerleWeb.JSApiAttribute::.ctor() = ( 01 00 00 00 ) 
  .custom instance void [Nemerle]Nemerle.Internal.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
  .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
  .method public hidebysig static string 
          Replace(string str,
                  class NemerleWeb.TypedJS.RegExp reg,
                  string replacement) cil managed
  {
    .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
    .custom instance void [Nemerle]Nemerle.Internal.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
    // Code size       11 (0xb)
    .maxstack  1
    IL_0000:  newobj     instance void [NemerleWeb]NemerleWeb.ClientCodeCalledInServerException::.ctor()
    IL_0005:  throw

    IL_0006:  br         IL_0006
  } // end of method JSStringExtensions::Replace

} // end of class NemerleWeb.TypedJS.JSStringExtensions

.class interface public abstract auto ansi beforefieldinit NemerleWeb.TypedJS.RegExp
{
} // end of class NemerleWeb.TypedJS.RegExp

.class public auto ansi beforefieldinit A.ABC
       extends [mscorlib]System.Object
{
  .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
  .custom instance void [Nemerle]Nemerle.Internal.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
  .method public hidebysig specialname rtspecialname 
          instance void  .ctor() cil managed
  {
    // Code size       7 (0x7)
    .maxstack  2
    IL_0000:  ldarg.0
    IL_0001:  call       instance void [mscorlib]System.Object::.ctor()
    IL_0006:  ret
  } // end of method ABC::.ctor

  .method public hidebysig static void  F(class A.ABC _N_wildcard_4482,
                                          class [Nemerle]Nemerle.Builtins.FunctionVoid f) cil managed
  {
    .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
    .custom instance void [Nemerle]Nemerle.Internal.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) 
    // Code size       11 (0xb)
    .maxstack  1
    IL_0000:  newobj     instance void [mscorlib]System.Exception::.ctor()
    IL_0005:  throw

    IL_0006:  br         IL_0006
  } // end of method ABC::F

} // end of class A.ABC


// =============================================================

// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file NemerleWeb.TypedJS.dll.res


Пригалается бинарник с исходником: bug.zip
Буду очень благодарен за помощь.
http://rsdn.nemerleweb.com
http://nemerleweb.com
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.