我的意思是
public class C1 {
public string ProcessString([StringLiteralsOnly] string s) { ... }
readonly string S1 = ProcessString("this is a string literal"); // good
readonly string V2 = "This is a variable";
readonly string S2 = ProcessString(V2); // should be ERROR or warning due to [StringLiteralsOnly]
}
如果没有零力量方式,可以了解如何实施此工作流程吗?