class C1[T] where T : C1[T], new()
{
public Prop : int { get; protected set }
public static StM() : void
{
def a = T();
a.Prop = 666;
}
}
C:\Program Files (x86)\Nemerle\Net-4.0\Nemerle.MSBuild.targets(289,5): error : internal compiler error: got some unknown exception of type System.NullReferenceException: Object reference not set to an instance of an object.
at Nemerle.Compiler.MemberInfo.CanAccess(TypeInfo memberTypeInfo, TypeInfo currentTypeInfo, Boolean isThisAccess)
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.DoWalk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Walk(Context ctx, TExpr expr)
at Nemerle.Compiler.Typer2.Run()
at Nemerle.Compiler.Typer.RunSecondPass(MethodBuilder meth)
at Nemerle.Compiler.Typer.RunFullTyping()
at Nemerle.Compiler.MethodBuilder.RunBodyTyper()
at Nemerle.Compiler.MethodBuilder.Compile()
at Nemerle.Compiler.TypeBuilder.EmitImplementation()
at Nemerle.Compiler.TypesManager._N_emit_impl__62688.apply_void(TypeBuilder ti)
at Nemerle.Compiler.TypesManager._N_maybe_f__62939.apply_void(TypeBuilder ti)
at Nemerle.Collections.NList.Iter[T](list`1 l, FunctionVoid`1 f)
at Nemerle.Compiler.TypesManager.Iter(list`1 builders, FunctionVoid`1 f)
at Nemerle.Compiler.TypesManager.compile_all_tyinfos(Boolean aux_phase)
at Nemerle.Compiler.TypesManager._N__N_lambda__62112__62215.apply_void()
at Nemerle.Compiler.Solver.Enqueue(FunctionVoid action)
at Nemerle.Compiler.ManagerClass.Run()
at Nemerle.CommandlineCompiler.MainClass.main_with_catching()
Done building project "Test4.nproj" -- FAILED.
Net 4.0, Nemerle 1.2.415
Что делать?
... << RSDN@Home (RF) 1.2.0 alpha 5 rev. 58>>
class C1[T] where T : C1[T], new()
{
public Prop : int { get; protected set }
public static StM() : void
{
def a = T();
a.Prop = 666;
}
}
А new тут что значит?
Здравствуйте, s22, Вы писали:
s22>А new тут что значит?
Тоже, что и в шарпе — тип Т должен иметь конструктор без параметров. И поэтому легально такое:
def a = T();
... << RSDN@Home (RF) 1.2.0 alpha 5 rev. 58>>
Здравствуйте, DarthSidius, Вы писали:
Похоже регрессия.
Компилятор 0.9.3 это собирает ( с небольшими измененияеми )
http://ideone.com/R1LAhx
class C1[T] where T : C1[T], new()
{
mutable p : int;
public Prop : int { get {p}; protected set {p=value} }
public static StM() : void
{
def a = T();
a.Prop = 666;
}
}
Здравствуйте, DarthSidius, Вы писали:
DS>Что делать?
Завести issue на
https://github.com/rsdn/nemerle/
Поместить ссылку на него сюда. Как будет время, поглядим. Ну, или самому поглядеть под отладчиком.
Здравствуйте, VladD2, Вы писали:
VD>Завести issue на https://github.com/rsdn/nemerle/
VD>Поместить ссылку на него сюда. Как будет время, поглядим. Ну, или самому поглядеть под отладчиком.
Ок, как назвать исуе?
... << RSDN@Home (RF) 1.2.0 alpha 5 rev. 58>>
Здравствуйте, DarthSidius, Вы писали:
https://github.com/rsdn/nemerle/issues/13283... << RSDN@Home (RF) 1.2.0 alpha 5 rev. 58>>