angular / clutz

Closure to TypeScript `.d.ts` generator
MIT License
162 stars 60 forks source link

error: cannot find symbol import com.google.javascript.rhino.jstype.FunctionType.Parameter; #1007

Open T-Skinner opened 4 years ago

T-Skinner commented 4 years ago
> Task :compileJava FAILED
/Users/ts76/Dev/clutz/src/main/java/com/google/javascript/clutz/DeclarationGenerator.java:45: error: cannot find symbol
import com.google.javascript.rhino.jstype.FunctionType.Parameter;

What could be causing this? I ran an npm install before the ./gradlew build

lauraharker commented 4 years ago

You're probably running with an older version of Closure Compiler.

The FunctionType.Parameter API was added in https://github.com/google/closure-compiler/commit/041dc07d025b64fcf0239359bc732dd78c3d2e75 and is in the most recent release v20200614.

See https://github.com/angular/clutz#supported-versions.

Does updating your Closure Compiler version fix this?

lauraharker commented 4 years ago

Created Google internal issue http://b/159832817.

T-Skinner commented 4 years ago

@lauraharker How do I update the closure dependency?

I went into build.gradle and switched the dependency reference to this: compile 'com.google.javascript:closure-compiler-unshaded:v20200614'

Now I have these new errors:

/Users/ts76/Dev/clutz2/src/main/java/com/google/javascript/gents/pass/comments/GeneralComment.java:39: error: cannot find symbol
    return new GeneralComment(comment.getCommentString(), comment.getStartPosition().getOffset());
                                                                 ^
  symbol:   method getStartPosition()
  location: variable comment of type NonJSDocComment

/Users/ts76/Dev/clutz2/src/main/java/com/google/javascript/gents/pass/comments/AstCommentLinkingPass.java:162: error: cannot find symbol
                      nonJSDocInfo.getStartPosition().getOffset())) {
                                  ^
  symbol:   method getStartPosition()
  location: variable nonJSDocInfo of type NonJSDocComment
/Users/ts76/Dev/clutz2/src/main/java/com/google/javascript/gents/pass/comments/AstCommentLinkingPass.java:166: error: cannot find symbol
                        nonJSDocInfo.getStartPosition().getOffset()));
                                    ^
  symbol:   method getStartPosition()
  location: variable nonJSDocInfo of type NonJSDocComment
lauraharker commented 4 years ago

I tried updating to the latest SNAPSNOT build of Closure Compiler:

compile 'com.google.javascript:closure-compiler:1.0-SNAPSHOT'

and then I get just this error:

> Task :compileJava FAILED
clutz/src/main/java/com/google/javascript/clutz/DeclarationGenerator.java:1285: error: cannot find symbol
        .splitToStream(namespace)
        ^

and then I believe https://github.com/angular/clutz/issues/985#issuecomment-635911944 has a workaround for that.

Thanks for commenting on https://github.com/angular/clutz/issues/1006#issuecomment-650823513 BTW.

T-Skinner commented 4 years ago

@lauraharker I think I did get it to compile using the fix you mentioned but it does not pass the tests so it's useless right?

nreid260 commented 4 years ago

Is this still an issue?