Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an error occurs in the first definition of the block when using 'if else' #1589

Closed
narirou opened this issue Jul 16, 2014 · 4 comments · Fixed by #1590
Closed

an error occurs in the first definition of the block when using 'if else' #1589

narirou opened this issue Jul 16, 2014 · 4 comments · Fixed by #1590

Comments

@narirou
Copy link

narirou commented Jul 16, 2014

Hello.
From version 1.4.1, the error "this block is never used" occurs in the first definition of the block when using the "if else".
However, it is useful in the following cases. In such case, would it possible to be tolerate the error?

example:

-var ajax = true

-if( ajax )
    //- return only contents if ajax requests
    block contents
        p ajax contents

-else
    //- return all html
    doctype html
    html
        head
            meta( charset='utf8' )
            title sample
            body
                block contents
                    p all contetns

this is compiled to: ( but warning at line 6 )

<p>ajax contents</p>

Thanks,
Regards.

@narirou narirou changed the title an error occurs in the first definition of the block when using 'if else'. an error occurs in the first definition of the block when using 'if else' Jul 16, 2014
@ForbesLindesay
Copy link
Member

Thanks for reporting this. You can indeed ignore that warning. It should not have been triggered in this instance and is caused by a failure to walk to bodies of Code elements. This will be fixed in the next release.

@ForbesLindesay
Copy link
Member

Version 1.4.2 (just released) should fix this warning for you.

@narirou
Copy link
Author

narirou commented Jul 16, 2014

Thank you for your quick fix! :)

@ForbesLindesay
Copy link
Member

You're welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants