매개 변수에는 'modifier name' 한정자 하나만 사용할 수 있습니다.
this, ref, in 및 out 같은 매개 변수 한정자가 매개 변수 정의에서 두 번 이상 나타나는 것은 오류입니다.
예시
다음 예제에서는 CS1107을 생성합니다.
// cs1107.cs
public static class Test
{
// Extension methods.
public static void TestMethod(this this int t) { } // CS1107
}
public class TestTwo
{
// Regular Instance Method
public void TestMethod(ref ref int i) { } // CS1107
// Regular Instance Method
public void TestMethod(in in double d) { } // CS1107
}
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET