Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
fc98b7e9
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fc98b7e9
编写于
7月 10, 2018
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Misc. changes following merge
上级
afce94b1
变更
26
展开全部
隐藏空白更改
内联
并排
Showing
26 changed file
with
112 addition
and
3283 deletion
+112
-3283
src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs
...inder/Semantics/OverloadResolution/MethodTypeInference.cs
+4
-4
src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs
src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs
+1
-1
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs
...le/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs
+1
-1
src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
...ers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
+1
-1
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
...lers/CSharp/Portable/Operations/CSharpOperationFactory.cs
+3
-3
src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
+6
-0
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs
...Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs
+3
-22
src/Compilers/CSharp/Test/Semantic/Semantics/GenericConstraintsTests.cs
...CSharp/Test/Semantic/Semantics/GenericConstraintsTests.cs
+2
-2
src/Compilers/CSharp/Test/Semantic/Semantics/StaticNullChecking.cs
...lers/CSharp/Test/Semantic/Semantics/StaticNullChecking.cs
+11
-11
src/Compilers/Test/Utilities/CSharp/TestOptions.cs
src/Compilers/Test/Utilities/CSharp/TestOptions.cs
+3
-3
src/Features/CSharp/Portable/CSharpFeaturesResources.Designer.cs
...tures/CSharp/Portable/CSharpFeaturesResources.Designer.cs
+9
-0
src/Features/CSharp/Portable/CSharpFeaturesResources.resx
src/Features/CSharp/Portable/CSharpFeaturesResources.resx
+3
-0
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf
...res/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf
...atures/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf
...s/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf
+5
-5
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf
...s/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf
+5
-5
src/Workspaces/CoreTest/WorkspaceTests/MSBuildWorkspaceTests.cs
...rkspaces/CoreTest/WorkspaceTests/MSBuildWorkspaceTests.cs
+0
-3170
未找到文件。
src/Compilers/CSharp/Portable/Binder/Semantics/OverloadResolution/MethodTypeInference.cs
浏览文件 @
fc98b7e9
...
...
@@ -514,9 +514,9 @@ private void InferTypeArgsFirstPhase(Binder binder, ref HashSet<DiagnosticInfo>
BoundExpression
argument
=
_arguments
[
arg
];
bool
?
isNullable
=
IsNullable
(
argument
);
TypeSymbolWithAnnotations
target
=
_formalParameterTypes
[
arg
];
bool
isExactInference
=
GetRefKind
(
arg
).
IsManagedReference
()
||
target
.
IsPointerType
()
;
ExactOrBoundsKind
kind
=
GetRefKind
(
arg
).
IsManagedReference
()
||
target
.
IsPointerType
()
?
ExactOrBoundsKind
.
Exact
:
ExactOrBoundsKind
.
LowerBound
;
MakeExplicitParameterTypeInferences
(
binder
,
argument
,
isNullable
,
target
,
isExactInference
,
ref
useSiteDiagnostics
);
MakeExplicitParameterTypeInferences
(
binder
,
argument
,
isNullable
,
target
,
kind
,
ref
useSiteDiagnostics
);
}
}
...
...
@@ -1628,11 +1628,11 @@ private bool ExactConstructedInference(TypeSymbolWithAnnotations source, TypeSym
return
true
;
}
private
bool
ExactPointerInference
(
TypeSymbol
source
,
TypeSymbol
target
,
ref
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
)
private
bool
ExactPointerInference
(
TypeSymbol
WithAnnotations
source
,
TypeSymbolWithAnnotations
target
,
ref
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
)
{
if
(
source
.
TypeKind
==
TypeKind
.
Pointer
&&
target
.
TypeKind
==
TypeKind
.
Pointer
)
{
ExactInference
(((
PointerTypeSymbol
)
source
).
PointedAtType
,
((
PointerTypeSymbol
)
target
).
PointedAtType
,
ref
useSiteDiagnostics
);
ExactInference
(((
PointerTypeSymbol
)
source
.
TypeSymbol
).
PointedAtType
,
((
PointerTypeSymbol
)
target
.
TypeSymbol
).
PointedAtType
,
ref
useSiteDiagnostics
);
return
true
;
}
...
...
src/Compilers/CSharp/Portable/CodeGen/Optimizer.cs
浏览文件 @
fc98b7e9
...
...
@@ -1011,7 +1011,7 @@ internal static bool IsFixedBufferAssignmentToRefLocal(BoundExpression left, Bou
=>
isRef
&&
right
is
BoundFieldAccess
fieldAccess
&&
fieldAccess
.
FieldSymbol
.
IsFixed
&&
left
.
Type
.
Equals
(((
PointerTypeSymbol
)
right
.
Type
).
PointedAtType
,
TypeCompareKind
.
AllIgnoreOptions
);
left
.
Type
.
Equals
(((
PointerTypeSymbol
)
right
.
Type
).
PointedAtType
.
TypeSymbol
,
TypeCompareKind
.
AllIgnoreOptions
);
// indirect assignment is assignment to a value referenced indirectly
// it may only happen if
...
...
src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_FixedStatement.cs
浏览文件 @
fc98b7e9
...
...
@@ -246,7 +246,7 @@ public override BoundNode VisitFixedLocalCollectionInitializer(BoundFixedLocalCo
// either should lower into addressof
Debug
.
Assert
(
initializerExpr
.
Kind
==
BoundKind
.
AddressOfOperator
);
TypeSymbol
initializerType
=
((
PointerTypeSymbol
)
initializerExpr
.
Type
).
PointedAtType
;
TypeSymbol
initializerType
=
((
PointerTypeSymbol
)
initializerExpr
.
Type
).
PointedAtType
.
TypeSymbol
;
// initializer expressions are bound/lowered right into addressof operators here
// that is a bit too far
...
...
src/Compilers/CSharp/Portable/Lowering/SyntheticBoundNodeFactory.cs
浏览文件 @
fc98b7e9
...
...
@@ -445,7 +445,7 @@ public BoundReturnStatement Return(BoundExpression expression = null)
if
(
conversion
.
Kind
!=
ConversionKind
.
Identity
)
{
Debug
.
Assert
(
CurrentFunction
.
RefKind
==
RefKind
.
None
);
expression
=
BoundConversion
.
Synthesized
(
Syntax
,
expression
,
conversion
,
false
,
false
,
ConstantValue
.
NotAvailable
,
CurrentFunction
.
ReturnType
.
TypeSymbol
);
expression
=
BoundConversion
.
Synthesized
(
Syntax
,
expression
,
conversion
,
false
,
explicitCastInCode
:
false
,
conversionGroupOpt
:
null
,
ConstantValue
.
NotAvailable
,
CurrentFunction
.
ReturnType
.
TypeSymbol
);
}
}
...
...
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
浏览文件 @
fc98b7e9
...
...
@@ -1588,14 +1588,14 @@ private IForEachLoopOperation CreateBoundForEachStatementOperation(BoundForEachS
HashSet
<
DiagnosticInfo
>
useSiteDiagnostics
=
null
;
var
compilation
=
(
CSharpCompilation
)
_semanticModel
.
Compilation
;
info
=
new
ForEachLoopOperationInfo
(
enumeratorInfoOpt
.
ElementType
,
info
=
new
ForEachLoopOperationInfo
(
enumeratorInfoOpt
.
ElementType
.
TypeSymbol
,
enumeratorInfoOpt
.
GetEnumeratorMethod
,
(
PropertySymbol
)
enumeratorInfoOpt
.
CurrentPropertyGetter
.
AssociatedSymbol
,
enumeratorInfoOpt
.
MoveNextMethod
,
enumeratorInfoOpt
.
NeedsDisposeMethod
,
knownToImplementIDisposable
:
enumeratorInfoOpt
.
NeedsDisposeMethod
&&
(
object
)
enumeratorInfoOpt
.
GetEnumeratorMethod
!=
null
?
compilation
.
Conversions
.
ClassifyImplicitConversionFromType
(
enumeratorInfoOpt
.
GetEnumeratorMethod
.
ReturnType
,
ClassifyImplicitConversionFromType
(
enumeratorInfoOpt
.
GetEnumeratorMethod
.
ReturnType
.
TypeSymbol
,
compilation
.
GetSpecialType
(
SpecialType
.
System_IDisposable
),
ref
useSiteDiagnostics
).
IsImplicit
:
false
,
...
...
@@ -1737,7 +1737,7 @@ private ILockOperation CreateBoundLockStatementOperation(BoundLockStatement boun
bool
legacyMode
=
_semanticModel
.
Compilation
.
CommonGetWellKnownTypeMember
(
WellKnownMember
.
System_Threading_Monitor__Enter2
)
==
null
;
ILocalSymbol
lockTakenSymbol
=
legacyMode
?
null
:
new
SynthesizedLocal
(
_semanticModel
.
GetEnclosingSymbol
(
boundLockStatement
.
Syntax
.
SpanStart
)
as
MethodSymbol
,
(
TypeSymbol
)
_semanticModel
.
Compilation
.
GetSpecialType
(
SpecialType
.
System_Boolean
),
TypeSymbolWithAnnotations
.
Create
((
TypeSymbol
)
_semanticModel
.
Compilation
.
GetSpecialType
(
SpecialType
.
System_Boolean
)
),
SynthesizedLocalKind
.
LockTaken
,
syntaxOpt
:
boundLockStatement
.
Argument
.
Syntax
);
SyntaxNode
syntax
=
boundLockStatement
.
Syntax
;
...
...
src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
浏览文件 @
fc98b7e9
*REMOVED*static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(this string version, out Microsoft.CodeAnalysis.CSharp.LanguageVersion result) -> bool
Microsoft.CodeAnalysis.CSharp.LanguageVersion.CSharp8 = 800 -> Microsoft.CodeAnalysis.CSharp.LanguageVersion
Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax.WithAsyncKeyword(Microsoft.CodeAnalysis.SyntaxToken asyncKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax.WithBody(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode body) -> Microsoft.CodeAnalysis.CSharp.Syntax.AnonymousFunctionExpressionSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.ArrayRankSpecifierSyntax.QuestionToken.get -> Microsoft.CodeAnalysis.SyntaxToken
Microsoft.CodeAnalysis.CSharp.Syntax.ArrayRankSpecifierSyntax.Update(Microsoft.CodeAnalysis.SyntaxToken openBracketToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax> sizes, Microsoft.CodeAnalysis.SyntaxToken closeBracketToken, Microsoft.CodeAnalysis.SyntaxToken questionToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrayRankSpecifierSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.ArrayRankSpecifierSyntax.WithQuestionToken(Microsoft.CodeAnalysis.SyntaxToken questionToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrayRankSpecifierSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax.AddArguments(params Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax.WithArguments(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ArgumentSyntax> arguments) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseArgumentListSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.BaseCrefParameterListSyntax.AddParameters(params Microsoft.CodeAnalysis.CSharp.Syntax.CrefParameterSyntax[] items) -> Microsoft.CodeAnalysis.CSharp.Syntax.BaseCrefParameterListSyntax
...
...
@@ -81,7 +85,9 @@ Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithEndQuoteToken(Micros
Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithEqualsToken(Microsoft.CodeAnalysis.SyntaxToken equalsToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithName(Microsoft.CodeAnalysis.CSharp.Syntax.XmlNameSyntax name) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax
Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax.WithStartQuoteToken(Microsoft.CodeAnalysis.SyntaxToken startQuoteToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.XmlAttributeSyntax
Microsoft.CodeAnalysis.CSharp.SyntaxKind.SuppressNullableWarningExpression = 9054 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
override Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ClassifyCommonConversion(Microsoft.CodeAnalysis.ITypeSymbol source, Microsoft.CodeAnalysis.ITypeSymbol destination) -> Microsoft.CodeAnalysis.Operations.CommonConversion
override Microsoft.CodeAnalysis.CSharp.CSharpCompilation.ContainsSymbolsWithName(string name, Microsoft.CodeAnalysis.SymbolFilter filter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> bool
override Microsoft.CodeAnalysis.CSharp.CSharpCompilation.GetSymbolsWithName(string name, Microsoft.CodeAnalysis.SymbolFilter filter = Microsoft.CodeAnalysis.SymbolFilter.TypeAndMember, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISymbol>
static Microsoft.CodeAnalysis.CSharp.LanguageVersionFacts.TryParse(string version, out Microsoft.CodeAnalysis.CSharp.LanguageVersion result) -> bool
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.ArrayRankSpecifier(Microsoft.CodeAnalysis.SyntaxToken openBracketToken, Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.CSharp.Syntax.ExpressionSyntax> sizes, Microsoft.CodeAnalysis.SyntaxToken closeBracketToken, Microsoft.CodeAnalysis.SyntaxToken questionToken) -> Microsoft.CodeAnalysis.CSharp.Syntax.ArrayRankSpecifierSyntax
src/Compilers/CSharp/Portable/Symbols/Synthesized/SynthesizedEmbeddedAttributeSymbol.cs
浏览文件 @
fc98b7e9
...
...
@@ -195,32 +195,13 @@ internal override void GenerateMethodBody(TypeCompilationState compilationState,
}
var
factory
=
new
SyntheticBoundNodeFactory
(
this
,
this
.
GetNonNullSyntaxNode
(),
compilationState
,
diagnostics
);
factory
.
Current
Method
=
this
;
factory
.
Current
Function
=
this
;
var
baseConstructorCall
=
MethodCompiler
.
GenerateBaseParameterlessConstructorInitializer
(
this
,
diagnostics
);
if
(
baseConstructorCall
==
null
)
{
if
(
ContainingType
.
BaseTypeNoUseSiteDiagnostics
is
MissingMetadataTypeSymbol
)
{
// System_Attribute is missing. Don't generate anything
return
;
}
var
factory
=
new
SyntheticBoundNodeFactory
(
this
,
this
.
GetNonNullSyntaxNode
(),
compilationState
,
diagnostics
);
factory
.
CurrentFunction
=
this
;
var
baseConstructorCall
=
MethodCompiler
.
GenerateBaseParameterlessConstructorInitializer
(
this
,
diagnostics
);
if
(
baseConstructorCall
==
null
)
{
// This may happen if Attribute..ctor is not found or is inaccessible
return
;
}
var
block
=
factory
.
Block
(
factory
.
ExpressionStatement
(
baseConstructorCall
),
factory
.
Return
());
factory
.
CloseMethod
(
block
);
// This may happen if Attribute..ctor is not found or is inaccessible
return
;
}
var
block
=
factory
.
Block
(
...
...
src/Compilers/CSharp/Test/Semantic/Semantics/GenericConstraintsTests.cs
浏览文件 @
fc98b7e9
...
...
@@ -3140,7 +3140,7 @@ class C
var
declaredMethod
=
compilation
.
GlobalNamespace
.
GetTypeMember
(
"C"
).
GetMethod
(
"M"
);
Assert
.
Equal
(
declaredMethod
,
inferredMethod
);
Assert
.
Equal
(
declaredMethod
.
TypeParameters
.
Single
(),
inferredMethod
.
TypeArguments
.
Single
());
Assert
.
Equal
(
declaredMethod
.
TypeParameters
.
Single
(),
inferredMethod
.
TypeArguments
.
Single
()
.
TypeSymbol
);
}
[
Fact
]
...
...
@@ -3196,7 +3196,7 @@ unsafe class C
var
declaredMethod
=
compilation
.
GlobalNamespace
.
GetTypeMember
(
"C"
).
GetMethod
(
"M"
);
Assert
.
Equal
(
declaredMethod
,
inferredMethod
);
Assert
.
Equal
(
declaredMethod
.
TypeParameters
.
Single
(),
inferredMethod
.
TypeArguments
.
Single
());
Assert
.
Equal
(
declaredMethod
.
TypeParameters
.
Single
(),
inferredMethod
.
TypeArguments
.
Single
()
.
TypeSymbol
);
}
[
Fact
]
...
...
src/Compilers/CSharp/Test/Semantic/Semantics/StaticNullChecking.cs
浏览文件 @
fc98b7e9
...
...
@@ -17372,7 +17372,7 @@ void Test2()
class CL1<T>
{}
",
new[] { SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
// (12,54): warning CS8622: Nullability of reference types in type of parameter 'p1' of 'lambda expression' doesn't match the target delegate 'Action<CL1<string?>>'.
...
...
@@ -18469,7 +18469,7 @@ void Test2(dynamic x2)
x2 = x2[0] ?? x2;
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
);
...
...
@@ -18537,7 +18537,7 @@ void Test2(CL0 x2, dynamic? y2, CL1 z2)
x2[(dynamic)0] = y2;
z2[0] = y2;
}
}
}
class CL0
{
...
...
@@ -18562,7 +18562,7 @@ class CL1
set { }
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
// (14,26): warning CS8601: Possible null reference assignment.
...
...
@@ -18885,7 +18885,7 @@ void Test2(dynamic x2)
x2 = x2.M1(0) ?? x2;
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
);
...
...
@@ -18999,7 +18999,7 @@ void Test3(dynamic? x3)
dynamic y3 = x3.M1;
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
// (19,22): warning CS8602: Possible dereference of a null reference.
...
...
@@ -20085,7 +20085,7 @@ void Test2(dynamic? x2, dynamic? y2)
dynamic z2 = x2 + y2 ?? """";
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
);
...
...
@@ -21196,7 +21196,7 @@ class CL1 {}
class CL2 {}
class CL3 {}
class CL4 : CL3 {}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
// (10,18): warning CS8604: Possible null reference argument for parameter 'x' in 'CL0.implicit operator CL1(CL0 x)'.
...
...
@@ -21273,7 +21273,7 @@ void Test1(CL0<string?> x1)
class CL0<T>
{
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
// (10,26): warning CS8619: Nullability of reference types in value of type 'CL0<string?>' doesn't match target type 'CL0<string>'.
...
...
@@ -22245,7 +22245,7 @@ void Test5(dynamic x5)
dynamic u5 = --x5;
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
// (16,22): warning CS8600: Converting null literal or possible null value to non-nullable type.
...
...
@@ -22730,7 +22730,7 @@ void Test4(dynamic? x4, dynamic? y4)
dynamic u4 = x4 += y4;
}
}
",
new[] { CSharpRef, SystemCoreRef },
parseOptions: TestOptions.Regular8);
", parseOptions: TestOptions.Regular8);
c.VerifyDiagnostics(
);
src/Compilers/Test/Utilities/CSharp/TestOptions.cs
浏览文件 @
fc98b7e9
...
...
@@ -11,10 +11,10 @@ public static class TestOptions
// Disable diagnosing documentation comments by default so that we don't need to
// document every public member of every test input.
// PROTOTYPE(NullableReferenceTypes): Use default for LanguageVersion rather than LanguageVersion.CSharp7.3.
public
static
readonly
CSharpParseOptions
ScriptDefault
=
new
CSharpParseOptions
(
kind
:
SourceCodeKind
.
Script
,
documentationMode
:
DocumentationMode
.
None
);
public
static
readonly
CSharpParseOptions
Script
=
ScriptDefault
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7_3
);
public
static
readonly
CSharpParseOptions
RegularDefault
=
new
CSharpParseOptions
(
kind
:
SourceCodeKind
.
Regular
,
documentationMode
:
DocumentationMode
.
None
);
public
static
readonly
CSharpParseOptions
RegularDefault
=
new
CSharpParseOptions
(
kind
:
SourceCodeKind
.
Regular
,
documentationMode
:
DocumentationMode
.
Parse
);
public
static
readonly
CSharpParseOptions
Regular
=
RegularDefault
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7_3
);
public
static
readonly
CSharpParseOptions
ScriptDefault
=
new
CSharpParseOptions
(
kind
:
SourceCodeKind
.
Script
,
documentationMode
:
DocumentationMode
.
Parse
);
public
static
readonly
CSharpParseOptions
Script
=
ScriptDefault
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7_3
);
public
static
readonly
CSharpParseOptions
Regular6
=
RegularDefault
.
WithLanguageVersion
(
LanguageVersion
.
CSharp6
);
public
static
readonly
CSharpParseOptions
Regular7
=
RegularDefault
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7
);
public
static
readonly
CSharpParseOptions
Regular7_1
=
RegularDefault
.
WithLanguageVersion
(
LanguageVersion
.
CSharp7_1
);
...
...
src/Features/CSharp/Portable/CSharpFeaturesResources.Designer.cs
浏览文件 @
fc98b7e9
...
...
@@ -305,6 +305,15 @@ internal class CSharpFeaturesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Declare as nullable.
/// </summary>
internal
static
string
Declare_as_nullable
{
get
{
return
ResourceManager
.
GetString
(
"Declare_as_nullable"
,
resourceCulture
);
}
}
/// <summary>
/// Looks up a localized string similar to deconstruction.
/// </summary>
...
...
src/Features/CSharp/Portable/CSharpFeaturesResources.resx
浏览文件 @
fc98b7e9
...
...
@@ -159,6 +159,9 @@
<data
name=
"Autoselect_disabled_due_to_potential_range_variable_declaration"
xml:space=
"preserve"
>
<value>
Autoselect disabled due to potential range variable declaration.
</value>
</data>
<data
name=
"Declare_as_nullable"
xml:space=
"preserve"
>
<value>
Declare as nullable
</value>
</data>
<data
name=
"Simplify_name_0"
xml:space=
"preserve"
>
<value>
Simplify name '{0}'
</value>
</data>
...
...
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"cs"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Dočasná vložená proměnná
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"de"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Inline temporär variabel
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"es"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Variable temporal en línea
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"fr"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Variable temporaire inline
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"it"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Variabile temporanea inline
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"ja"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
インラインの一時変数
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"ko"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
인라인 임시 변수
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"pl"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Wstawiona zmienna tymczasowa
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"pt-BR"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Variável temporária embutida
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"ru"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Встроенная временная переменная
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"tr"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
Satır içi geçici değişken
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"zh-Hans"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
内联临时变量
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf
浏览文件 @
fc98b7e9
...
...
@@ -2,6 +2,11 @@
<xliff
xmlns=
"urn:oasis:names:tc:xliff:document:1.2"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
version=
"1.2"
xsi:schemaLocation=
"urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd"
>
<file
datatype=
"xml"
source-language=
"en"
target-language=
"zh-Hant"
original=
"../CSharpFeaturesResources.resx"
>
<body>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Inline_temporary_variable"
>
<source>
Inline temporary variable
</source>
<target
state=
"translated"
>
內嵌暫存變數
</target>
...
...
@@ -637,11 +642,6 @@
<target
state=
"new"
>
Invert if
</target>
<note
/>
</trans-unit>
<trans-unit
id=
"Declare_as_nullable"
>
<source>
Declare as nullable
</source>
<target
state=
"new"
>
Declare as nullable
</target>
<note
/>
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
src/Workspaces/CoreTest/WorkspaceTests/MSBuildWorkspaceTests.cs
已删除
100644 → 0
浏览文件 @
afce94b1
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录