提交 d1cb5918 编写于 作者: J Julien 提交者: VSadov

Tuples: removing more PROTOTYPE markers (#10919)

上级 b56a6ad5
......@@ -653,8 +653,7 @@ internal override bool Equals(TypeSymbol t2, bool ignoreCustomModifiersAndArrayS
}
}
// PROTOTYPE(tuples): rename ignoreDynamic or introduce another "ignoreTuple" flag
// if ignoring dynamic, compare underlying tuple types
// If ignoring dynamic, compare underlying tuple types
if (t2.IsTupleType)
{
t2 = ((TupleTypeSymbol)t2).UnderlyingTupleType;
......
......@@ -199,7 +199,6 @@ internal override ObsoleteAttributeData ObsoleteAttributeData
{
get
{
// PROTOTYPE(tuples): need to figure what is the right behavior when underlying is obsolete
return null;
}
}
......
......@@ -3084,69 +3084,6 @@ static void Main()
);
}
// PROTOTYPE(tuples): this test is for a precedent reference
// it does not test tuples and should be removed or moved to appropriate location
[Fact]
public void InterpolatedConvertedType()
{
var source = @"
class C
{
static void Main()
{
System.IFormattable x = (System.IFormattable)$""qq {1} qq"";
}
}
" + trivial2uple + trivial3uple;
var tree = Parse(source);
var comp = CreateCompilationWithMscorlib(tree);
var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
var nodes = tree.GetCompilationUnitRoot().DescendantNodes();
var node = nodes.OfType<InterpolatedStringExpressionSyntax>().Single();
Assert.Equal(@"$""qq {1} qq""", node.ToString());
Assert.Equal("System.String", model.GetTypeInfo(node).Type.ToTestDisplayString());
Assert.Equal("System.String", model.GetTypeInfo(node).ConvertedType.ToTestDisplayString());
Assert.Equal(Conversion.Identity, model.GetConversion(node));
Assert.Equal(Conversion.Identity, model.GetConversion(node.Parent));
var x = nodes.OfType<VariableDeclaratorSyntax>().First();
Assert.Equal("System.IFormattable x", model.GetDeclaredSymbol(x).ToTestDisplayString());
}
// PROTOTYPE(tuples): this test is for a precedent reference
// it does not test tuples and should be removed or moved to appropriate location
[Fact]
public void InterpolatedConvertedTypeInSource()
{
var source = @"
class C
{
static void Main()
{
System.IFormattable x = $""qq {1} qq"";
}
}
" + trivial2uple + trivial3uple;
var tree = Parse(source);
var comp = CreateCompilationWithMscorlib(tree);
var model = comp.GetSemanticModel(tree, ignoreAccessibility: false);
var nodes = tree.GetCompilationUnitRoot().DescendantNodes();
var node = nodes.OfType<InterpolatedStringExpressionSyntax>().Single();
Assert.Equal(@"$""qq {1} qq""", node.ToString());
Assert.Equal("System.String", model.GetTypeInfo(node).Type.ToTestDisplayString());
Assert.Equal("System.IFormattable", model.GetTypeInfo(node).ConvertedType.ToTestDisplayString());
Assert.Equal(Conversion.InterpolatedString, model.GetConversion(node));
var x = nodes.OfType<VariableDeclaratorSyntax>().First();
Assert.Equal("System.IFormattable x", model.GetDeclaredSymbol(x).ToTestDisplayString());
}
[Fact]
public void TupleConvertedType01()
{
......
......@@ -454,7 +454,6 @@ Done:
Private ReadOnly Property ITypeSymbol_IsTupleSymbol As Boolean Implements ITypeSymbol.IsTupleType
Get
' PROTOTYPE(tuples): VB does not yet support tuples.
Return False
End Get
End Property
......
......@@ -47,8 +47,6 @@ protected override async Task<CompletionItem> GetBuilderAsync(Document document,
{
return CreateBuilder(text, position, CSharpFeaturesResources.LambdaExpression, CSharpFeaturesResources.AutoselectDisabledDueToPotentialLambdaDeclaration);
}
// PROTOTYPE(tuples): tuples in this context are very much like a kind of anonymous type
// I wonder if we need a special CSharpFeaturesResources or just generalize the existing one
else if (IsAnonymousObjectCreation(token) || IsPossibleTupleExpression(token))
{
return CreateBuilder(text, position, CSharpFeaturesResources.MemberName, CSharpFeaturesResources.AutoselectDisabledDueToPossibleExplicitlyNamesAnonTypeMemCreation);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册