[nem-en] More for completion
Kamil Skalski
kamil.skalski at gmail.com
Sun Jul 2 16:29:54 CEST 2006
This particular instance of MarkAsUsed seems like a 'shut up' mark for
the compiler warnings. This is quite common to disable warnings for
generated code, as user does not have direct influence on how to fix
the warning.
Isn't it feasible to use Location.Default here? The rationale for such
hack is that you won't search for references of this generated member
anyways.
2006/7/2, Alejandro Serrano <trupill at yahoo.es>:
> Kamil Skalski escribió:
> > bash-3.00$ cd nemerle/ncc/
> > bash-3.00$ ./g HasBeenUsed
> > external/LibrariesLoader.n:1102: public override HasBeenUsed : bool
> > [...]
> > typing/Typer2.n:1211: meth.HasBeenUsed = true;
> >
> > Probably all the assignments to HasBeenUsed should be changed to some
> > kind of method
> > ManagerClass.MarkAsUsed (IMember, Location), which could be then
> > overriden in completion engine to catch all uses of given member.
> > Then you would need to run the whole typing step for all methods.
> Hi again,
> Now I have some time, I'm trying to implement these MarkAsUsed method.
> However, I've got a big problem: I don't know where to find the location
> most of the times. For example, in generation/Typer3.n (line 789)
>
> def rewrite (expr : TExpr) {
> | TryFinally (body, handler) =>
> def fld = clo_type.DefineAndReturn (<[ decl:
> mutable $(Macros.NewSymbol ("finally_needed") : name) : bool;
> ]>) :> IField;
> fld.HasBeenAssigned = true;
> fld.HasBeenUsed = true;
> def fldref = TExpr.FieldMember (InternalType.Boolean, thisref,
> fld);
>
> How can I know where the reference is located so I can call the
> MarkAsUsed (IMember, Location) method?
>
> Thanks in advance,
> Alejandro Serrano "Serras"
>
>
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list