本文介绍了我该如何与声明罗斯林一个变种变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我已经得到了下面的一段代码,但我找不到如何获得VAR TypeSyntax 。 任何想法 Syntax.LocalDeclarationStatement(声明:Syntax.VariableDeclaration(型:Syntax.PredefinedType(Syntax.Token(SyntaxKind.VarKeyword)),变量:Syntax.SeparatedList( Syntax.VariableDeclarator(标识符:Syntax.Identifier(名)))))); 这将失败,参数异常,上面写着:关键字 解决方案 我会用: Syntax.LocalDeclarationStatement(声明:Syntax.VariableDeclaration(型:Syntax.IdentifierName(Syntax.Token(SyntaxKind.VarKeyword)),变量:Syntax.SeparatedList( Syntax.VariableDeclarator(标识符:Syntax.Identifier(名))))); I've got the following piece of code, but I can't find how to get the var TypeSyntax. Any ideas?Syntax.LocalDeclarationStatement( declaration: Syntax.VariableDeclaration( type: Syntax.PredefinedType(Syntax.Token(SyntaxKind.VarKeyword)), variables: Syntax.SeparatedList( Syntax.VariableDeclarator( identifier: Syntax.Identifier(name))) ) ));this fails with an Argument exception that says: "keyword" 解决方案 I'd use:Syntax.LocalDeclarationStatement( declaration: Syntax.VariableDeclaration( type: Syntax.IdentifierName(Syntax.Token(SyntaxKind.VarKeyword)), variables: Syntax.SeparatedList( Syntax.VariableDeclarator( identifier: Syntax.Identifier(name))))); 这篇关于我该如何与声明罗斯林一个变种变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-29 18:35