Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
Updated mcs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Krüger committed Apr 24, 2012
1 parent ef726be commit 6a45cef
Show file tree
Hide file tree
Showing 16 changed files with 674 additions and 594 deletions.
26 changes: 24 additions & 2 deletions ICSharpCode.NRefactory.CSharp/Parser/mcs/anonymous.cs
Original file line number Diff line number Diff line change
Expand Up @@ -960,11 +960,16 @@ public AnonymousMethodExpression (Location loc)
return Block.Parameters;
}
}

public bool IsAsync {
get;
internal set;
}

public ReportPrinter TypeInferenceReportPrinter {
get; set;
}

#endregion

//
Expand All @@ -975,7 +980,13 @@ public bool ImplicitStandardConversionExists (ResolveContext ec, TypeSpec delega
{
using (ec.With (ResolveContext.Options.InferReturnType, false)) {
using (ec.Set (ResolveContext.Options.ProbingMode)) {
return Compatible (ec, delegate_type) != null;
var prev = ec.Report.SetPrinter (TypeInferenceReportPrinter ?? new NullReportPrinter ());

var res = Compatible (ec, delegate_type) != null;

ec.Report.SetPrinter (prev);

return res;
}
}
}
Expand Down Expand Up @@ -1109,12 +1120,23 @@ public TypeSpec InferReturnType (ResolveContext ec, TypeInferenceContext tic, Ty
}

using (ec.Set (ResolveContext.Options.ProbingMode | ResolveContext.Options.InferReturnType)) {
ReportPrinter prev;
if (TypeInferenceReportPrinter != null) {
prev = ec.Report.SetPrinter (TypeInferenceReportPrinter);
} else {
prev = null;
}

var body = CompatibleMethodBody (ec, tic, null, delegate_type);
if (body != null) {
am = body.Compatible (ec, body);
} else {
am = null;
}

if (TypeInferenceReportPrinter != null) {
ec.Report.SetPrinter (prev);
}
}

if (am == null)
Expand Down
16 changes: 6 additions & 10 deletions ICSharpCode.NRefactory.CSharp/Parser/mcs/class.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ public TypeContainer (TypeContainer parent, MemberName name, Attributes attrs, M
}
}

public Dictionary<string, MemberCore> DefinedNames {
get {
return defined_names;
}
}

public TypeDefinition PartialContainer {
get {
return main_container;
Expand Down Expand Up @@ -2403,16 +2409,6 @@ public override void AddNameToContainer (MemberCore symbol, string name)
base.AddNameToContainer (symbol, name);
}

public override void VerifyMembers ()
{
base.VerifyMembers ();

if (containers != null) {
foreach (var t in containers)
t.VerifyMembers ();
}
}

public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
{
if (a.IsValidSecurityAttribute ()) {
Expand Down
Loading

0 comments on commit 6a45cef

Please sign in to comment.