私はVS2017にアップグレードしましたが、VS15を使用していたときに存在しなかった奇妙なコンパイラエラーが発生するため、私のプロジェクトをビルドできなくなりました。Visual Studio 2017コンパイラエラー
Syntax Error; value expected
Invalid Expression Term '['
Invalid Expression Term 'byte'
Using the generic type requires 1 type arguments
編集1:など
エラー
- は、ほんの少しのコンソールアプリケーションを作成し、それにコードの一部をコピーして、同じコンパイラエラー(複数可)正確に同じプロジェクトは、VS15とさえVS13で大丈夫コンパイルされること
using System;
using System.Runtime.InteropServices;
namespace Error
{
class Program
{
static void Main()
{
Array array2D = null;
if (array2D is Bgra <byte>[,])
{
}
}
}
public interface IColor { }
public interface IColor<T> : IColor
where T : struct
{ }
public interface IColor2 : IColor { }
public interface IColor2<T> : IColor2, IColor<T>
where T : struct
{ }
public interface IColor3 : IColor { }
public interface IColor3<T> : IColor3, IColor<T>
where T : struct
{ }
public interface IColor4 : IColor { }
public interface IColor4<T> : IColor4, IColor<T>
where T : struct
{ }
[StructLayout(LayoutKind.Sequential)]
public struct Bgra<T> : IColor4<T>
where T : struct
{
public Bgra(T b, T g, T r, T a)
{
B = b;
G = g;
R = r;
A = a;
}
public T B;
public T G;
public T R;
public T A;
public override string ToString()
{
return $"B: {B}, G: {G}, R: {R}, A: {A}";
}
public const int IDX_B = 0;
public const int IDX_G = 1;
public const int IDX_R = 2;
public const int IDX_A = 3;
}
}
注意が登場しました。
小さなプログラムでエラーを再現できますか? –
"構文エラー"があると思われるコード行を指定していない場合、その行は何ですか? –
@MatthewWatson #Edited –