projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1695 from gregoryyoung/master
[mono.git]
/
mcs
/
mcs
/
decl.cs
diff --git
a/mcs/mcs/decl.cs
b/mcs/mcs/decl.cs
index e7f27aa7d626a32151675707335df0dc6312ff5f..d60e6ca0aece20e9b2e085ff78ab2c8146817449 100644
(file)
--- a/
mcs/mcs/decl.cs
+++ b/
mcs/mcs/decl.cs
@@
-195,11
+195,6
@@
namespace Mono.CSharp {
return name + "`" + args.Count;
}
return name + "`" + args.Count;
}
-
- public static string MakeName (string name, int count)
- {
- return name + "`" + count;
- }
}
public class SimpleMemberName
}
public class SimpleMemberName
@@
-303,7
+298,7
@@
namespace Mono.CSharp {
/// </summary>
internal Flags caching_flags;
/// </summary>
internal Flags caching_flags;
- p
ublic
MemberCore (TypeContainer parent, MemberName name, Attributes attrs)
+ p
rotected
MemberCore (TypeContainer parent, MemberName name, Attributes attrs)
{
this.Parent = parent;
member_name = name;
{
this.Parent = parent;
member_name = name;
@@
-435,7
+430,7
@@
namespace Mono.CSharp {
if ((mod_flags & Modifiers.COMPILER_GENERATED) != 0)
return true;
if ((mod_flags & Modifiers.COMPILER_GENERATED) != 0)
return true;
- return Parent
== null ? false :
Parent.IsCompilerGenerated;
+ return Parent
!= null &&
Parent.IsCompilerGenerated;
}
}
}
}
@@
-578,8
+573,11
@@
namespace Mono.CSharp {
// protected type then the type is accessible
//
while (mc.Parent != null && mc.Parent.PartialContainer != null) {
// protected type then the type is accessible
//
while (mc.Parent != null && mc.Parent.PartialContainer != null) {
- if (mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent))
+ if (mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent))
{
same_access_restrictions = true;
same_access_restrictions = true;
+ break;
+ }
+
mc = mc.Parent;
}
}
mc = mc.Parent;
}
}
@@
-591,8
+589,15
@@
namespace Mono.CSharp {
same_access_restrictions = p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);
else if (al == (Modifiers.PROTECTED | Modifiers.INTERNAL))
same_access_restrictions = mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent) && p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);
same_access_restrictions = p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);
else if (al == (Modifiers.PROTECTED | Modifiers.INTERNAL))
same_access_restrictions = mc.Parent.PartialContainer.IsBaseTypeDefinition (p_parent) && p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly);
- else
+ else
if (al == Modifiers.PROTECTED)
goto case Modifiers.PROTECTED;
goto case Modifiers.PROTECTED;
+ else if (al == Modifiers.PRIVATE) {
+ if (p.MemberDefinition.IsInternalAsPublic (mc.Module.DeclaringAssembly)) {
+ same_access_restrictions = true;
+ } else {
+ goto case Modifiers.PROTECTED;
+ }
+ }
break;
break;
@@
-675,13
+680,13
@@
namespace Mono.CSharp {
// Does extension methods look up to find a method which matches name and extensionType.
// Search starts from this namespace and continues hierarchically up to top level.
//
// Does extension methods look up to find a method which matches name and extensionType.
// Search starts from this namespace and continues hierarchically up to top level.
//
- public ExtensionMethodCandidates LookupExtensionMethod (
TypeSpec extensionType,
string name, int arity)
+ public ExtensionMethodCandidates LookupExtensionMethod (string name, int arity)
{
var m = Parent;
do {
var ns = m as NamespaceContainer;
if (ns != null)
{
var m = Parent;
do {
var ns = m as NamespaceContainer;
if (ns != null)
- return ns.LookupExtensionMethod (this,
extensionType,
name, arity, 0);
+ return ns.LookupExtensionMethod (this, name, arity, 0);
m = m.Parent;
} while (m != null);
m = m.Parent;
} while (m != null);
@@
-884,7
+889,7
@@
namespace Mono.CSharp {
if (GetAttributeObsolete () != null)
return true;
if (GetAttributeObsolete () != null)
return true;
- return Parent
== null ? false :
Parent.IsObsolete;
+ return Parent
!= null &&
Parent.IsObsolete;
}
}
}
}
@@
-893,7
+898,7
@@
namespace Mono.CSharp {
if ((ModFlags & Modifiers.UNSAFE) != 0)
return true;
if ((ModFlags & Modifiers.UNSAFE) != 0)
return true;
- return Parent
== null ? false :
Parent.IsUnsafe;
+ return Parent
!= null &&
Parent.IsUnsafe;
}
}
}
}
@@
-1085,7
+1090,12
@@
namespace Mono.CSharp {
// will contain types only but it can have numerous values for members
// like methods where both return type and all parameters are checked
//
// will contain types only but it can have numerous values for members
// like methods where both return type and all parameters are checked
//
- public List<TypeSpec> GetMissingDependencies ()
+ public List<MissingTypeSpecReference> GetMissingDependencies ()
+ {
+ return GetMissingDependencies (this);
+ }
+
+ public List<MissingTypeSpecReference> GetMissingDependencies (MemberSpec caller)
{
if ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)
return null;
{
if ((state & (StateFlags.MissingDependency | StateFlags.MissingDependency_Undetected)) == 0)
return null;
@@
-1093,11
+1103,11
@@
namespace Mono.CSharp {
state &= ~StateFlags.MissingDependency_Undetected;
var imported = definition as ImportedDefinition;
state &= ~StateFlags.MissingDependency_Undetected;
var imported = definition as ImportedDefinition;
- List<
TypeSpec
> missing;
+ List<
MissingTypeSpecReference
> missing;
if (imported != null) {
if (imported != null) {
- missing = ResolveMissingDependencies ();
+ missing = ResolveMissingDependencies (
caller
);
} else if (this is ElementTypeSpec) {
} else if (this is ElementTypeSpec) {
- missing = ((ElementTypeSpec) this).Element.GetMissingDependencies ();
+ missing = ((ElementTypeSpec) this).Element.GetMissingDependencies (
caller
);
} else {
missing = null;
}
} else {
missing = null;
}
@@
-1109,7
+1119,7
@@
namespace Mono.CSharp {
return missing;
}
return missing;
}
- public abstract List<
TypeSpec> ResolveMissingDependencies (
);
+ public abstract List<
MissingTypeSpecReference> ResolveMissingDependencies (MemberSpec caller
);
protected virtual bool IsNotCLSCompliant (out bool attrValue)
{
protected virtual bool IsNotCLSCompliant (out bool attrValue)
{
@@
-1125,7
+1135,7
@@
namespace Mono.CSharp {
public virtual string GetSignatureForError ()
{
public virtual string GetSignatureForError ()
{
- var bf = MemberDefinition as Property.BackingField;
+ var bf = MemberDefinition as Property.BackingField
Declaration
;
string name;
if (bf == null) {
name = Name;
string name;
if (bf == null) {
name = Name;
@@
-1161,7
+1171,7
@@
namespace Mono.CSharp {
var ctype = ctx.CurrentType;
if (ma == Modifiers.PRIVATE) {
var ctype = ctx.CurrentType;
if (ma == Modifiers.PRIVATE) {
- if (ctype == null)
+ if (ctype == null
|| parentType == null
)
return false;
//
// It's only accessible to the current class or children
return false;
//
// It's only accessible to the current class or children
@@
-1227,7
+1237,7
@@
namespace Mono.CSharp {
return (state & StateFlags.CLSCompliant) != 0;
}
return (state & StateFlags.CLSCompliant) != 0;
}
- public bool IsConditionallyExcluded (IMemberContext ctx
, Location loc
)
+ public bool IsConditionallyExcluded (IMemberContext ctx)
{
if ((Kind & (MemberKind.Class | MemberKind.Method)) == 0)
return false;
{
if ((Kind & (MemberKind.Class | MemberKind.Method)) == 0)
return false;