Last active
August 16, 2017 07:42
-
-
Save VienosNotes/aad8645220669420e42621f5ce470710 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// いままでは OK だったが Visual Studio 2017 Update3 で急に怒られるようになったコード | |
// error CS8306: タプル要素名 'a' と推測されます。推測される名前で要素にアクセスするには、言語バージョン 7.1 以上をお使いください。 | |
// error CS8306: タプル要素名 'b' と推測されます。推測される名前で要素にアクセスするには、言語バージョン 7.1 以上をお使いください。 | |
// 「最新のマイナーを使用」に設定する(C# 7.1) と通る | |
using System.Linq; | |
namespace ResolveTupleTest | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var a = 1; | |
var b = 1; | |
var tuple = (a, b); // フィールド名が推論されるようになったので型は (int a, int b) になった | |
var (a2, b2) = tuple; // 違う要素名に束縛できなくなった? | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment