Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Scala 获得;涉及对象FieldSerializer的非法循环引用;使用注释时_Scala_Annotations - Fatal编程技术网

Scala 获得;涉及对象FieldSerializer的非法循环引用;使用注释时

Scala 获得;涉及对象FieldSerializer的非法循环引用;使用注释时,scala,annotations,Scala,Annotations,我正在使用以下代码提取案例类属性的所有注释: val allAnnotations = typeOf[T].typeSymbol.asClass.primaryConstructor .typeSignature.paramLists.head.map(_.annotations) 在我将此注释添加到案例类属性之一之前,一切正常: @(Tag@field) 例如: case class Test(@(Tag@field)(10) id1: Int, @M

我正在使用以下代码提取案例类属性的所有注释:

val allAnnotations = typeOf[T].typeSymbol.asClass.primaryConstructor
   .typeSignature.paramLists.head.map(_.annotations)
在我将此注释添加到案例类属性之一之前,一切正常:

@(Tag@field)
例如:

case class Test(@(Tag@field)(10) id1: Int,
                @MyAnnotation(128) id2: String,
                ...)
我得到一个例外:

scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving object FieldSerializer

有什么解决方法吗?

能否请您提供
MyAnnotation
Tag
field
的定义?能否请您提供
MyAnnotation
Tag
field
的定义?