Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler exception when using pipe operator ( <| or |> ) in generic method with yield #528

Open
NN--- opened this issue Aug 24, 2013 · 0 comments

Comments

@NN---
Copy link
Member

NN--- commented Aug 24, 2013

using System;
using System.Linq;
using System.Collections.Generic;

class A
{
  public F(i : int) : bool { true }
}

module M
{
  public F[T]() : IEnumerable[int]
  {
    for(;false;)
    {
      def j = match(A().F <| 1) { |_ =>1 };      
    }

    yield default(int);
  }
}

module P
{
 Main() : void { }
}

Compiler fails:

←[01;31merror←[0m: internal compiler error: got ArgumentException (The specified
 Type must not be a generic type definition.
Parameter name: type)
   at System.Reflection.Emit.TypeBuilder.GetField(Type type, FieldInfo field)
   at Nemerle.Compiler.ILEmitter.FrameworkGetField(Type t, FieldInfo m)
   at Nemerle.Compiler.ILEmitter.GetFieldInfo(Type _from_type, IField meth)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit_exprs_push(LocalBuilder[] local_variables,
 list`1 exprs)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.emit(TExpr expr)
   at Nemerle.Compiler.ILEmitter.Run()
   at Nemerle.Compiler.MethodBuilder._N__N_lambda__69172__69279.apply_void()
   at Nemerle.Compiler.TypeBuilder.BeforeFinalizeType()
   at Nemerle.Compiler.TypeBuilder.EmitImplementation()
   at Nemerle.Compiler.TypeBuilder._N__N_lambda__64132__64162.apply_void()
   at Nemerle.Compiler.Solver.Enqueue(FunctionVoid action)
   at Nemerle.Compiler.ManagerClass.Run()
   at Nemerle.CommandlineCompiler.MainClass.main_with_catching()

While removing [T] from F, making it non generic makes compile happy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant