Verizon / remotely

An elegant RPC system for reasonable people
http://verizon.github.io/remotely/
Apache License 2.0
306 stars 39 forks source link

@GenClient cannot expand method named in reserved word properly #94

Closed shengc closed 9 years ago

shengc commented 9 years ago
val definition = Protocol.empty.codec[String].specify1("type", Field.strict[String]("foo"), Type[String])

@GenClient(definition)
object FooClient

this throws compile error at https://github.com/oncue/remotely/blob/master/core/src/main/scala/GenClient.scala#L46

since type is a reserved word.

easiest solution could be using backtick to surround the variable name, like this,

  val signatures : Set[Tree] = s.signatures.map { sig =>
      c.parse(s"""val `${sig.name}` = Remote.ref[${sig.typeString}]("${sig.name}")""")
  }
ahjohannessen commented 9 years ago

Closed by https://github.com/oncue/remotely/commit/21edf825880e2727ccab436b28de9441d7ff3070