Permalink
Browse files

[VS] Fix VS tests.

  • Loading branch information...
1 parent f14ba89 commit 7ef2f012708a6d0a7b69d998e025153279e7625b @VladD2 VladD2 committed Apr 6, 2012
@@ -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
@@ -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
}
@@ -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
}
View
@@ -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) =>
@@ -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

0 comments on commit 7ef2f01

Please sign in to comment.