Skip to content

Commit

Permalink
[VS] Fix VS tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladD2 committed Apr 6, 2012
1 parent f14ba89 commit 7ef2f01
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 7 deletions.
Expand Up @@ -607,12 +607,17 @@ namespace Nemerle.Completion2
| me is TExpr.MacroEnvelope => (QuickTipInfo(loc, me))
| lv is LocalValue => (QuickTipInfo(loc, lv))
| mm is IMember => (QuickTipInfo(loc, mm, manager))
| st is StaticTypeVar => (QuickTipInfo(loc, st))
| tv is TypeVar => (QuickTipInfo(loc, tv))
| st is StaticTypeVar => (QuickTipInfo(loc, st))
| tv is TypeVar => (QuickTipInfo(loc, tv))
| tc is TExpr.ImplicitValueTypeCtor => (QuickTipInfo(loc, tc.ty))
| fh is Typedtree.TFunHeader => (QuickTipInfo(loc, fh))
| fp is Typedtree.TParameter => (QuickTipInfo(loc, fp))
| fp is Typedtree.TParameter => (QuickTipInfo(loc, fp))
| p is Pattern.Enum => (QuickTipInfo(loc, p.fld, manager))
| dv is TExpr.DefValIn when dv.name.Location.Contains(fileIndex, line, col)
=> QuickTipInfo(loc, dv.name)
| TExpr.Call(func=TExpr.MethodRef(meth=IMethod(Name=name) as accessor))
when name.StartsWith("get_") || name.StartsWith("set_")
=> (QuickTipInfo(loc, accessor, manager))
| null => (null)
| expr is TExpr => QuickTipInfo(loc, pObj, expr, manager)
#if DEBUG
Expand Down
8 changes: 6 additions & 2 deletions ncc/typing/TyVarEnv.n
Expand Up @@ -334,8 +334,10 @@ namespace Nemerle.Compiler

res.Location = t.Location;

when (res.ParsedObject == null) //(t.TypedObject == null)
if (res.ParsedObject == null) //(t.TypedObject == null)
res.SetParsedObject(t); //t.TypedObject = res;
else
t.SetTypedObject(res);

res
}
Expand Down Expand Up @@ -500,8 +502,10 @@ namespace Nemerle.Compiler

res2.Location = tyexpr.Location;

when (res2.ParsedObject == null) //(tyexpr.TypedObject == null)
if (res2.ParsedObject == null) //(tyexpr.TypedObject == null)
res2.SetParsedObject(tyexpr); //tyexpr.TypedObject = res2;
else
tyexpr.SetTypedObject(res2);

res2
}
Expand Down
16 changes: 14 additions & 2 deletions ncc/typing/Typer.n
Expand Up @@ -1601,8 +1601,20 @@ namespace Nemerle.Compiler
ReportFatal (messenger,
"ref and out parameters are only allowed in function calls")

| PExpr.DefMutable (x, null) =>
DoType (PExpr.DefMutable (x, <[ $(TExpr.DefaultValue (FreshTypeVar ()) : typed) ]>), expected, is_toplevel_in_seq);
| PExpr.DefMutable(x, null) =>
def res = DoType(PExpr.DefMutable(x, <[ $(TExpr.DefaultValue(FreshTypeVar()) : typed) ]>), expected, is_toplevel_in_seq);
match (x)
{
| PExpr.TypeEnforcement(n, ty) =>
def defVal = res :> TExpr.DefValIn;
def typeVar = (defVal.val :> TExpr.TypeConversion).target_type;

defVal.name.SetParsedObject(n);
typeVar.SetParsedObject(ty);

| _ => ()
}
res

| PExpr.DefMutable (PExpr.Ref as name, val)
| PExpr.Define (PExpr.Ref as name, val) =>
Expand Down
Expand Up @@ -613,6 +613,11 @@ namespace Nemerle.Completion2
| fh is Typedtree.TFunHeader => (QuickTipInfo(loc, fh))
| fp is Typedtree.TParameter => (QuickTipInfo(loc, fp))
| p is Pattern.Enum => (QuickTipInfo(loc, p.fld, manager))
| dv is TExpr.DefValIn when dv.name.Location.Contains(fileIndex, line, col)
=> QuickTipInfo(loc, dv.name)
| TExpr.Call(func=TExpr.MethodRef(meth=IMethod(Name=name) as accessor))
when name.StartsWith("get_") || name.StartsWith("set_")
=> (QuickTipInfo(loc, accessor, manager))
| null => (null)
| expr is TExpr => QuickTipInfo(loc, pObj, expr, manager)
#if DEBUG
Expand Down

0 comments on commit 7ef2f01

Please sign in to comment.