Skip to content

Commit

Permalink
2010-05-05 Marek Safar <marek.safar@gmail.com>
Browse files Browse the repository at this point in the history
	* import.cs: Don't import private fields.


svn path=/trunk/mcs/; revision=156712
  • Loading branch information
marek-safar committed May 5, 2010
1 parent ab07538 commit 802a9a6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mcs/mcs/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2010-05-05 Marek Safar <marek.safar@gmail.com>

* import.cs: Don't import private fields.

2010-04-30 Marek Safar <marek.safar@gmail.com>

Partially based on patch by <sami.lamti@gmail.com>
Expand Down
7 changes: 7 additions & 0 deletions mcs/mcs/import.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ public static FieldSpec CreateField (FieldInfo fi, TypeSpec declaringType)
break;
}

// Ignore private fields (even for error reporting) to not require extra dependencies
if (mod == Modifiers.PRIVATE)
return null;

var definition = new ImportedMemberDefinition (fi);

if ((fa & FieldAttributes.Literal) != 0) {
Expand Down Expand Up @@ -1056,6 +1060,9 @@ public MemberCache LoadMembers (TypeSpec declaringType)
continue;

imported = Import.CreateField (fi, declaringType);
if (imported == null)
continue;

break;
case MemberTypes.NestedType:
Type t = (Type) member;
Expand Down

0 comments on commit 802a9a6

Please sign in to comment.