今天看到akka http库中有这么一段函数:
1 | //R <: Rendering 意思是 renderQuery 可以设置任何Rendering类的子类 |
我查了下ne 就是和eq 类似的,相当于not equal 和equal的关系。这个函数字面意思就是显示
查询参数的,看到里面的q ne query
这一句来了兴趣,查看stackoverflow上是这么写的:
A synthetic field, instead, is a field generated by the compiler to work around
the underlying JVM limitations, especially when dealing with inner anonymous
classes, a concept extraneous to the JVM
参考资料:
What’s the difference between A<:B and +B in Scala?
Scala的eq,ne,equals,==方法与Java异同
Synthetic Function “##” in scala