I am trying to port some java code to scala. The code uses annotations with a member named type
, but this is a keyword in scala. Is there any way to address this valid java member in scala?
Here is the Java code
@Component( name = "RestProcessorImpl", type = mediation // Compile error ) public class RestProcessorImpl { // impl }
This part of the code is identical in scala, except that type
is a keyword, so it does not compile. Is there a way to avoid the type
keyword?
This is also a problem with java classes with type
member
HasType.java
package spike1; public class HasType { public String type() { return "the type"; } }
UseType.scala
class UseType { def hasType = new HasType hasType.type()
iain source share