Compiler internal error: com.google.common.css.compiler.ast.CssMixinNode cannot be cast to com.google.common.css.compiler.ast.CssDeclarationNode

29 views
Skip to first unread message

Hochhaus, Andy

unread,
Nov 3, 2015, 2:34:15 PM11/3/15
to closure-style...@googlegroups.com
Hello,

Are mixins allowed to be declared in one file and called from another? With the compiler built from HEAD I get a "Compiler internal error" but with an older version of the compiler this works just fine.

Best,
Andy




Detailed steps to reproduce:

ahochhaus@ahochhaus-pc:~/test$ cat def.gss 
@defmixin spriteUrl() {
  background: url('sprite.png') no-repeat;
}
ahochhaus@ahochhaus-pc:~/test$ cat call.gss 
.example {
  @mixin spriteUrl();
}
ahochhaus@ahochhaus-pc:~/test$ java -jar closure-stylesheets.jar def.gss call.gss
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:69)
        at com.google.common.css.compiler.ast.DefaultVisitController$VisitRulesetState.doVisit(DefaultVisitController.java:875)
        at com.google.common.css.compiler.ast.DefaultVisitController.startVisit(DefaultVisitController.java:2028)
        at com.google.common.css.compiler.passes.DisallowDuplicateDeclarations.runPass(DisallowDuplicateDeclarations.java:80)
        at com.google.common.css.compiler.passes.PassRunner.runPasses(PassRunner.java:147)
        at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.parseAndPrint(DefaultCommandLineCompiler.java:130)
        at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.compile(DefaultCommandLineCompiler.java:116)
        at com.google.common.css.compiler.commandline.DefaultCommandLineCompiler.execute(DefaultCommandLineCompiler.java:157)
        at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.executeJob(ClosureCommandLineCompiler.java:335)
        at com.google.common.css.compiler.commandline.ClosureCommandLineCompiler.main(ClosureCommandLineCompiler.java:400)
ahochhaus@ahochhaus-pc:~/test$ cat def.gss call.gss > combined.gss
ahochhaus@ahochhaus-pc:~/test$ java -jar closure-stylesheets.jar combined.gss 
.example{background:url('sprite.png') no-repeat}

Ian Flanigan

unread,
Nov 3, 2015, 2:48:48 PM11/3/15
to closure-style...@googlegroups.com
It could indeed be a bug. Can you put all of that good info into an issue on GitHub:


If you can tell me from what revision (or even date) the working version was built, I can try to see what has changed.

Thanks,

Ian

--
You received this message because you are subscribed to the Google Groups "closure-stylesheets-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-stylesheets-discuss+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hochhaus, Andy

unread,
Nov 3, 2015, 3:00:00 PM11/3/15
to closure-style...@googlegroups.com
Thanks Ian.


I know it is an old compiler, but the working version was build from HEAD on Dec 23, 2014.

Best,
Andy

Reply all
Reply to author
Forward
0 new messages