nau / jscala

Scala macro that produces JavaScript from Scala code.
MIT License
205 stars 25 forks source link

AST generation should use fully qualified names? #27

Closed tbje closed 10 years ago

tbje commented 10 years ago

This one was a little bit surprising. I assume the AST generator is not specifying which JsIf to use and that the lift one is picked as it's imported specifically.

import org.jscala._
import net.liftweb.http.js.JsCmds.JsIf
javascript {
  if (true) "ter" else "er"
}

/..../Js.scala:120: overloaded method value apply with alternatives: (condition: net.liftweb.http.js.JsExp,bodyTrue: net.liftweb.http.js.JsExp,bodyFalse: net.liftweb.http.js.JsExp)net.liftweb.http.js.JsCmd (condition: net.liftweb.http.js.JsExp,body: net.liftweb.http.js.JsExp)net.liftweb.http.js.JsCmd (condition: net.liftweb.http.js.JsExp,bodyTrue: net.liftweb.http.js.JsCmd,bodyFalse: net.liftweb.http.js.JsCmd)net.liftweb.http.js.JsCmd (condition: net.liftweb.http.js.JsExp,body: net.liftweb.http.js.JsCmd)net.liftweb.http.js.JsCmd cannot be applied to (org.jscala.JsBinOp, org.jscala.JsCall, Some[org.jscala.JsCall]) javascript {

tbje commented 10 years ago

Removing or renaming the lift JsIf obviously solves the problem.