TypeBuilder.AstParts fails

2 views
Skip to first unread message

emp...@gmail.com

unread,
Jun 20, 2009, 6:23:06 PM6/20/09
to Nemerle Forum
According to Vlad's macros tutorial we should always use AstParts
since the implementation can be partial:

"However, the AST is accessible in all compilation stages. AST is
accessible through the AstParts property (in TypeBuilder), because one
type can come in several parts (declared with the keyword partial).
AstParts lists class parts. If the class is not a partial class, then
this list contains a single-element list.
TIP
Always use the AstParts property, or your code may not work correctly
with partial classes. "

http://nemerle.org/Macros_-_extended_course._Part_3


However when I try it, it fails with an assertion error. I checked the
code and found out that:

public AstParts : list [PT.TopDeclaration]
{
get
{
System.Diagnostics.Debug.Assert(Manager.IsIntelliSenseMode);
pt_tydecl :: partial_parts
}
}


Somehow Manager.IsIntellisenseMode returns false (even though I work
in VS) But why do we have such an Assertion ? I think it should be
removed !

VladD2

unread,
Jun 22, 2009, 8:46:55 AM6/22/09
to nemer...@googlegroups.com
Fixed in 8276.

2009/6/21 emp...@gmail.com <emp...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages