IDE00181 IDE0018 (Variable declaration can be inlined) 변수 선언은 인라인할 수 있습니다. int result; if (int.TryParse(input, out result)) Console.WriteLine(result); else Console.WriteLine("Could not parse input"); 매개 변수를 지원하는 기존 구문이 C# 7.0 버전에서 개선 되어서 별도의 선언문을 작성하지 않고 메소드 호출의 인수 목록에서 변수를 선언할 수 있게 되었다. 코드를 다음과 같이 수정한다. //int result; if (int.TryParse(input, out int result)) Console.WriteLine(result); else Console.WriteLine("Could not parse input"); 2020. 6. 15. 이전 1 다음 728x90