Вот такой фрагмент кода
module ListM {
public ShuffleN[T](this collection : IReadOnlyList[T], n : int) : Seq[T] {
def s = HashSet();
def r = Random();
for(mutable i = collection.Count - n; i < collection.Count; i++) {
def k = r.Next(0, i);
def j = if(s.Contains <| k) i else k;
_ = s.Add(j);
yield collection[j];
}
}
}
разваливает компилятор с ошибкой
C:\Program Files (x86)\Nemerle\Net-4.0\Nemerle.MSBuild.targets(289,5):
error : internal compiler error: got ArgumentException (Заданный тип не должен быть определением базового типа.
Имя параметра: type)
в System.Reflection.Emit.TypeBuilder.GetField(Type type, FieldInfo field)
в Nemerle.Compiler.ILEmitter.FrameworkGetField(Type t, FieldInfo m)
в Nemerle.Compiler.ILEmitter.GetFieldInfo(Type _from_type, IField meth)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit_debug_info(DebugInfo di)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit_debug_info(DebugInfo di)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit_debug_info(DebugInfo di)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.emit(TExpr expr)
в Nemerle.Compiler.ILEmitter.Run()
в Nemerle.Compiler.MethodBuilder._N__N_lambda__68652__68759.apply_void()
в Nemerle.Compiler.TypeBuilder.BeforeFinalizeType()
в Nemerle.Compiler.TypeBuilder.EmitImplementation()
в Nemerle.Compiler.TypeBuilder._N__N_lambda__63615__63645.apply_void()
в Nemerle.Compiler.Solver.Enqueue(FunctionVoid action)
в Nemerle.Compiler.ManagerClass.Run()
в Nemerle.CommandlineCompiler.MainClass.main_with_catching()
Построение проекта "Shuffle.nproj" завершено с ошибкой.