google / google/closure-compiler

Local types in Polymer elements can cause error

Open
#3,450 0 comments 0 reactions 0 assignees View on GitHub
internal-issue-created triage-done
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

I'm creating this issue based on #544, which is fixed in the general case but not in all places in the compiler.

[Here's an example where local types fail with Polymer](https://closure-compiler-debugger.appspot.com/#input0%3D(function()%2520%257B%250A%2520%2520%252F**%2520%2540typedef%2520%257B%257Bfoo%253A%2520string%257D%257D%2520*%252F%250A%2520%2520let%2520MyTypedef%253B%250A%2520%250A%2520%2520Polymer(%257B%250A%2520%2520%2520%2520is%253A%2520'pretty-button'%252C%250A%2520%2520%2520%2520properties%253A%2520%257B%250A%2520%2520%2520%2520%2520%2520%252F**%2520%2540type%2520%257B!MyTypedef%257D%2520*%252F%250A%2520%2520%2520%2520%2520%2520value%253A%2520Object%252C%250A%2520%2520%2520%2520%257D%252C%250A%2520%2520%257D)%253B%250A%257D)()%253B%250A%26input1%26conformanceConfig%26externs%3D%252F**%2520%2540constructor%2520*%252F%250Avar%2520PolymerElement%253B%26refasterjs-template%26includeDefaultExterns%3Dtrue%26CHECK_TYPES%3Dtrue%26CHECKS_ONLY%3Dtrue%26CLOSURE_PASS%3Dtrue%26POLYMER_PASS%3Dtrue%26PRESERVE_TYPE_ANNOTATIONS%3Dtrue%26PRETTY_PRINT%3Dtrue).

``` js
(function() {
/** @typedef {{foo: string}} */
let MyTypedef;

Polymer({
is: 'pretty-button',
properties: {
/** @type {!MyTypedef} */
value: Object,
},
});
})();

```

This is at least partially related to http://b/138224391

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.