Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with default as C #17478

Closed
jcouv opened this issue Mar 1, 2017 · 0 comments
Closed

Crash with default as C #17478

jcouv opened this issue Mar 1, 2017 · 0 comments
Assignees
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Mar 1, 2017

It's probably good to also test default as T where T is an open type.

	at System.Diagnostics.Debug.Assert(Boolean condition)
	Binder\Binder_Operators.cs(3035,0): at Microsoft.CodeAnalysis.CSharp.Binder.BindAsOperator(BinaryExpressionSyntax node, DiagnosticBag diagnostics)
	Binder\Binder_Expressions.cs(510,0): at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node, DiagnosticBag diagnostics, Boolean invoked, Boolean indexed)
	Binder\Binder_Expressions.cs(414,0): at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionAllowArgList(ExpressionSyntax node, DiagnosticBag diagnostics)
	Binder\Binder_Expressions.cs(310,0): at Microsoft.CodeAnalysis.CSharp.Binder.BindValueAllowArgList(ExpressionSyntax node, DiagnosticBag diagnostics, BindValueKind valueKind)
	Binder\Binder_Expressions.cs(2202,0): at Microsoft.CodeAnalysis.CSharp.Binder.BindArgumentExpression(DiagnosticBag diagnostics, ExpressionSyntax argumentExpression, RefKind refKind, Boolean allowArglist)
	Binder\Binder_Expressions.cs(2048,0): at Microsoft.CodeAnalysis.CSharp.Binder.BindArgumentValue(DiagnosticBag diagnostics, ArgumentSyntax argumentSyntax, Boolean allowArglist, RefKind refKind)
...
        [Fact]
        public void DefaultInAsOperatorWithReferenceType()
        {
            var text = @"
class C
{
    static void Main()
    {
        System.Console.Write(default as C);
    }
}";

            var comp = CreateCompilationWithMscorlib(text, parseOptions: TestOptions.ExperimentalParseOptions, options: TestOptions.DebugExe);
            comp.VerifyDiagnostics(
             // TODO
                );
        }
@jcouv jcouv added this to the 2.1 milestone Mar 1, 2017
@jcouv jcouv self-assigned this Mar 1, 2017
@jcouv jcouv modified the milestones: 2.1, 2.2, 15.2, 15.3 Mar 3, 2017
@jcouv jcouv closed this as completed Apr 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant