Skip to content

Commit

Permalink
Add a test for nameof(typeParam) in method parameter default value
Browse files Browse the repository at this point in the history
  • Loading branch information
gafter committed Apr 29, 2015
1 parent 48398f9 commit 2ba8bbf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Compilers/VisualBasic/Test/Semantic/Semantics/NameOfTests.vb
Original file line number Diff line number Diff line change
Expand Up @@ -3521,5 +3521,21 @@ N1N2
]]>).VerifyDiagnostics()
End Sub

<Fact, WorkItem(564, "https://github.com/dotnet/roslyn/issues/564")>
Public Sub NameOfTypeParameterInDefaultValue()
Dim compilationDef =
<compilation>
<file name="a.vb">
Module Program
Sub M(Of TP)(Optional name As String = NameOf(TP))
End Sub
End Module
</file>
</compilation>

Dim comp = CreateCompilationWithMscorlibAndVBRuntime(compilationDef, TestOptions.DebugDll)
CompileAndVerify(comp).VerifyDiagnostics()
End Sub

End Class
End Namespace

0 comments on commit 2ba8bbf

Please sign in to comment.