Created
September 22, 2010 11:47
-
-
Save mads-hartmann/591544 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In a method that returns a NodeSeq. | |
// compiles | |
val seq = for { | |
moduleId <- S.param("moduleId") | |
moduleInstanceId <- S.param("id") | |
backupId <- S.param("backupId") | |
} yield bind("backup", xhtml, "path" -> backupId) | |
seq openOr (redirectTo("/")) | |
// doesn't compile | |
for { | |
moduleId <- S.param("moduleId") | |
moduleInstanceId <- S.param("id") | |
backupId <- S.param("backupId") | |
} yield { | |
bind("backup", xhtml, "path" -> backupId) | |
} openOr (redirectTo("/")) | |
// error | |
// [error] /Users/Mads/dev/projects/reverse_backup/productwebgui/src/main/scala/com/reversebackup/webgui/snippet/Backup.sc// ala:21: type mismatch; | |
// [error] found : net.liftweb.common.Box[String] | |
// [error] required: scala.xml.NodeSeq | |
// [error] moduleId <- S.param("moduleId") | |
// [error] ^ | |
// [error] one error found |
face-palm of course! :) Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// compiles
(for {
moduleId <- S.param("moduleId")
moduleInstanceId <- S.param("id")
backupId <- S.param("backupId")
} yield {
bind("backup", xhtml, "path" -> backupId)
}) openOr (redirectTo("/"))