if (include_files == null)
include_files = new Dictionary<string, SourceFile> ();
- if (!include_files.ContainsKey (file.FullPathName))
- include_files.Add (file.FullPathName, file);
+ if (!include_files.ContainsKey (file.OriginalFullPathName))
+ include_files.Add (file.OriginalFullPathName, file);
}
public void AddDefine (string value)
{
var sw = Module.DeclaringAssembly.SymbolWriter;
if (sw != null) {
- CreateUnitSymbolInfo (sw);
+ CreateUnitSymbolInfo (sw, Compiler.Settings.PathMap);
}
base.PrepareEmit ();
//
// Creates symbol file index in debug symbol file
//
- void CreateUnitSymbolInfo (MonoSymbolFile symwriter)
+ void CreateUnitSymbolInfo (MonoSymbolFile symwriter, List<KeyValuePair<string, string>> pathMap)
{
- var si = file.CreateSymbolInfo (symwriter);
+ var si = file.CreateSymbolInfo (symwriter, pathMap);
comp_unit = new CompileUnitEntry (symwriter, si);
if (include_files != null) {
foreach (SourceFile include in include_files.Values) {
- si = include.CreateSymbolInfo (symwriter);
+ si = include.CreateSymbolInfo (symwriter, pathMap);
comp_unit.AddFile (si);
}
}
match = texpr_fne;
}
- if (types_using_table != null) {
+ if (types_using_table != null && (mode & LookupMode.IgnoreStaticUsing) == 0) {
foreach (var using_type in types_using_table) {
- var members = MemberCache.FindMembers (using_type, name, true);
- if (members == null)
+ var type = MemberCache.FindNestedType (using_type, name, arity, true);
+ if (type == null)
continue;
+
+ fne = new TypeExpression (type, loc);
+ if (match == null) {
+ match = fne;
+ continue;
+ }
- foreach (var member in members) {
- if (arity > 0 && member.Arity != arity)
- continue;
-
- if ((member.Kind & MemberKind.NestedMask) != 0) {
- // non-static nested type is included with using static
- } else {
- if ((member.Modifiers & Modifiers.STATIC) == 0)
- continue;
-
- if ((member.Modifiers & Modifiers.METHOD_EXTENSION) != 0)
- continue;
-
- if (mode == LookupMode.Normal)
- continue;
-
- return null;
- }
-
- fne = new TypeExpression ((TypeSpec) member, loc);
- if (match == null) {
- match = fne;
- continue;
- }
-
- if (mode == LookupMode.Normal) {
- Error_AmbiguousReference (name, match, fne, loc);
- }
+ if (mode == LookupMode.Normal) {
+ Error_AmbiguousReference (name, match, fne, loc);
}
}
}
continue;
}
- entry.Define (this);
+ try {
+ entry.Define (this);
+ } finally {
+ //
+ // It's needed for repl only, when using clause cannot be resolved don't hold it in
+ // global list which is resolved for every evaluation
+ //
+ if (entry.ResolvedExpression == null) {
+ clauses.RemoveAt (i--);
+ }
+ }
- //
- // It's needed for repl only, when using clause cannot be resolved don't hold it in
- // global list which is resolved for each evaluation
- //
- if (entry.ResolvedExpression == null) {
- clauses.RemoveAt (i--);
+ if (entry.ResolvedExpression == null)
continue;
- }
var using_ns = entry.ResolvedExpression as NamespaceExpression;
if (using_ns == null) {
for (int i = 0; i < clauses.Count; ++i) {
var entry = clauses[i];
if (entry.Alias != null) {
- aliases.Add (entry.Alias.Value, (UsingAliasNamespace) entry);
+ aliases[entry.Alias.Value] = (UsingAliasNamespace) entry;
}
}
}
if (resolved != null) {
var compiler = ctx.Module.Compiler;
var type = resolved.Type;
+ resolved = null;
compiler.Report.SymbolRelatedToPreviousError (type);
compiler.Report.Error (138, Location,