closure-stylesheets icon indicating copy to clipboard operation
closure-stylesheets copied to clipboard

Problem using mixins or conditionals inside a rule.

Open iflan opened this issue 10 years ago • 0 comments

Originally reported on Google Code with ID 24

Source files:

--- menu.gss ---
li.social {
    @mixin debug_italics();
    padding-left: 15px;
}

--- 00-debug.gss ---
@if (DEBUG) {
    @defmixin debug_italics() {
            font-style: italics;
    }
} @else {
    @defmixin debug_italics() {
        /* Nothing. */
    }
}

-- OR --

li.social {
    @if (DEBUG) {
        font-style: italic;
    }
    padding-left: 15px;
}

-------------------------------
Neither work, the first example results in:

Compiler internal error: com.google.common.css.compiler.ast.CssMixinNode cannot be
cast to com.google.common.css.compiler.ast.CssDeclarationNode
java.lang.ClassCastException: com.google.common.css.compiler.ast.CssMixinNode cannot
be cast to com.google.common.css.compiler.ast.CssDeclarationNode
    at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.enterRuleset(DisallowDuplicateDeclarations.java:64)
    at com.google.common.css.compiler.ast.DefaultVisitController$VisitRulesetState.doVisit(DefaultVisitController.java:762)
    at com.google.common.css.compiler.ast.DefaultVisitController.startVisit(DefaultVisitController.java:1762)
    at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.runPass(DisallowDuplicateDeclarations.java:75)
    at com.google.common.css.compiler.passes.PassRunner.runPasses(PassRunner.java:142)
    at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:106)
    at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:94)
    at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:129)
    at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:286)
    at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:359)


--------------------

The second results in:

Compiler internal error: com.google.common.css.compiler.ast.CssUnknownAtRuleNode cannot
be cast to com.google.common.css.compiler.ast.CssDeclarationNode
java.lang.ClassCastException: com.google.common.css.compiler.ast.CssUnknownAtRuleNode
cannot be cast to com.google.common.css.compiler.ast.CssDeclarationNode
    at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.enterRuleset(DisallowDuplicateDeclarations.java:64)
    at com.google.common.css.compiler.ast.DefaultVisitController$VisitRulesetState.doVisit(DefaultVisitController.java:762)
    at com.google.common.css.compiler.ast.DefaultVisitController.startVisit(DefaultVisitController.java:1762)
    at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.runPass(DisallowDuplicateDeclarations.java:75)
    at com.google.common.css.compiler.passes.PassRunner.runPasses(PassRunner.java:142)
    at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:106)
    at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:94)
    at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:129)
    at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:286)
    at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:359)


------------------

I've tried this with the tip-of-the-tree version, the latest downloadable version,
and the version before that, all with the same errors. What do?

Reported by SeligArkin on 2012-07-22 22:23:27

iflan avatar Oct 23 '15 20:10 iflan