我有以下代码段:
case class Test(i:Int)
val b = Test // b: Test.type
val a = Test(1) // a: Test
是否有一种方法可以将类型为a
的值Test
转换为Test.type
?
答案 0 :(得分:2)
将 foreach (Control x in this.Controls)
{
if (x is Button)
{
Button newbut = (Button)x;
newbut.FlatStyle = FlatStyle.Flat;
newbut.FlatAppearance.BorderColor = Color.FromArgb(0, 255, 255, 255);
newbut.FlatAppearance.BorderSize = 0;
newbut.TabStop = false;
}
}
添加到libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value
,然后您可以尝试
build.sbt