Imported Upstream version 5.12.0.220

Former-commit-id: c477e03582759447177c6d4bf412cd2355aad476
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-04-24 09:31:23 +00:00
parent 8bd104cef2
commit 8fc30896db
1200 changed files with 29534 additions and 26161 deletions

View File

@@ -1232,6 +1232,13 @@ namespace Mono.CSharp {
FindApplicableUserDefinedConversionOperators (rc, operators, source_type_expr, target_type, restr, ref candidates);
}
if (source_type_expr == source && source_type.IsNullableType) {
operators = MemberCache.GetUserOperator (source_type.TypeArguments [0], Operator.OpType.Implicit, declared_only);
if (operators != null) {
FindApplicableUserDefinedConversionOperators (rc, operators, source_type_expr, target_type, restr, ref candidates);
}
}
if (!implicitOnly) {
operators = MemberCache.GetUserOperator (source_type, Operator.OpType.Explicit, declared_only);
if (operators != null) {

View File

@@ -1 +1 @@
4d6fcb44c0d9390b15f0449683dd69fb56c10390
7e78d41043314048b54c7e8ec54e14a9bc2944f0

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
b4a6a6a1dd58a51dfde5b14b6b6e8af4566850c0

View File

@@ -1 +1 @@
20ee9e73b19c3cf415315fbd67fcaeb787ac8ef6
d5926bf4d1fd0a84786d6b60a31d8e934a1d2074

View File

@@ -1 +1 @@
518ccc8ef43fb3e1a0902069579690ac6875696a
dbbd59d35a37f994500804a0be64e0f2198832ea

View File

@@ -74,6 +74,8 @@ namespace Mono.CSharp
return "internal";
case Modifiers.PRIVATE:
return "private";
case Modifiers.PRIVATE | Modifiers.PROTECTED:
return "private protected";
default:
throw new NotImplementedException (mod.ToString ());
}
@@ -129,12 +131,16 @@ namespace Mono.CSharp
if ((modB & Modifiers.PUBLIC) != 0) {
flags = Modifiers.PROTECTED | Modifiers.INTERNAL | Modifiers.PRIVATE;
} else if ((modB & Modifiers.PROTECTED) != 0) {
if ((modB & Modifiers.INTERNAL) != 0)
flags = Modifiers.PROTECTED | Modifiers.INTERNAL;
flags |= Modifiers.PRIVATE;
} else if ((modB & Modifiers.INTERNAL) != 0)
if ((modB & Modifiers.INTERNAL) != 0) {
flags = Modifiers.PROTECTED | Modifiers.INTERNAL | Modifiers.PRIVATE;
} else {
modA &= ~Modifiers.PROTECTED;
flags = Modifiers.PRIVATE;
}
} else if ((modB & Modifiers.INTERNAL) != 0) {
modA &= ~Modifiers.PROTECTED;
flags = Modifiers.PRIVATE;
}
return modB != modA && (modA & (~flags)) == 0;
}
@@ -151,6 +157,8 @@ namespace Mono.CSharp
} else {
if ((mod_flags & Modifiers.PUBLIC) != 0)
t = TypeAttributes.NestedPublic;
else if ((mod_flags & (Modifiers.PROTECTED | Modifiers.PRIVATE)) == (Modifiers.PROTECTED | Modifiers.PRIVATE))
t = TypeAttributes.NestedFamANDAssem;
else if ((mod_flags & Modifiers.PRIVATE) != 0)
t = TypeAttributes.NestedPrivate;
else if ((mod_flags & (Modifiers.PROTECTED | Modifiers.INTERNAL)) == (Modifiers.PROTECTED | Modifiers.INTERNAL))
@@ -173,18 +181,27 @@ namespace Mono.CSharp
{
FieldAttributes fa = 0;
if ((mod_flags & Modifiers.PUBLIC) != 0)
switch (mod_flags & Modifiers.AccessibilityMask) {
case Modifiers.PUBLIC:
fa |= FieldAttributes.Public;
if ((mod_flags & Modifiers.PRIVATE) != 0)
break;
case Modifiers.PRIVATE:
fa |= FieldAttributes.Private;
if ((mod_flags & Modifiers.PROTECTED) != 0) {
if ((mod_flags & Modifiers.INTERNAL) != 0)
fa |= FieldAttributes.FamORAssem;
else
fa |= FieldAttributes.Family;
} else {
if ((mod_flags & Modifiers.INTERNAL) != 0)
fa |= FieldAttributes.Assembly;
break;
case Modifiers.PROTECTED | Modifiers.INTERNAL:
fa |= FieldAttributes.FamORAssem;
break;
case Modifiers.PROTECTED:
fa |= FieldAttributes.Family;
break;
case Modifiers.INTERNAL:
fa |= FieldAttributes.Assembly;
break;
case Modifiers.PRIVATE | Modifiers.PROTECTED:
fa |= FieldAttributes.FamANDAssem;
break;
default:
throw new NotImplementedException (mod_flags.ToString ());
}
if ((mod_flags & Modifiers.STATIC) != 0)
@@ -215,6 +232,9 @@ namespace Mono.CSharp
case Modifiers.INTERNAL:
ma |= MethodAttributes.Assembly;
break;
case Modifiers.PRIVATE | Modifiers.PROTECTED:
ma |= MethodAttributes.FamANDAssem;
break;
default:
throw new NotImplementedException (mod_flags.ToString ());
}

View File

@@ -1474,9 +1474,9 @@ namespace Mono.CSharp {
}
}
if (!expr.IsNull && TypeSpec.IsReferenceType (parameter_type) && parameter_type.BuiltinType != BuiltinTypeSpec.Type.String) {
if (!res.IsNull && TypeSpec.IsReferenceType (parameter_type) && parameter_type.BuiltinType != BuiltinTypeSpec.Type.String) {
rc.Report.Error (1763, Location,
"Optional parameter `{0}' of type `{1}' can only be initialized with `null'",
"Optional parameter `{0}' of type `{1}' can only be initialized with default value",
p.Name, parameter_type.GetSignatureForError ());
return;

View File

@@ -594,6 +594,7 @@ namespace Mono.CSharp
public override void FlowAnalysis (FlowAnalysisContext fc)
{
source.FlowAnalysis (fc);
foreach (var expr in targetExprs)
expr.FlowAnalysis (fc);
}