google / google/closure-compiler

No warning for incorrectly-placed inline type.

Open
#2,183 1 comment 0 reactions 1 assignee Claimed by @brad4d View on GitHub
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

The compiler silently ignores a misplaced inline type declaration.
The code below demonstrates this.

```javascript
// misplaced inline type - no warning for typo.
/** !Aray */
let dateArrayIgnoredType = [];

// correct inline type placement - warning for typo.
let /** !Aray */ dateArrayInlineType = [];

// non-inline type - warning for typo.
/** @type !Aray */
let dateArrayAtType = [];
```

https://closure-compiler-debugger.appspot.com/#input0%3D%252F%252F%2520misplaced%2520inline%2520type%2520-%2520no%2520warning%2520for%2520typo.%250A%252F**%2520!Aray%253C!Date%253E%2520*%252F%250Alet%2520dateArrayIgnoredType%2520%253D%2520%255B%255D%253B%250A%250A%252F%252F%2520correct%2520inline%2520type%2520placement%2520-%2520warning%2520for%2520typo.%250Alet%2520%252F**%2520!Aray%253C!Date%253E%2520*%252F%2520dateArrayInlineType%2520%253D%2520%255B%255D%253B%250A%250A%252F%252F%2520non-inline%2520type%2520-%2520warning%2520for%2520typo.%250A%252F**%2520%2540type%2520!Aray%253C!Date%253E%2520*%252F%250Alet%2520dateArrayAtType%2520%253D%2520%255B%255D%253B%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26CHECK_TYPES%3D1%26CLOSURE_PASS%3D1%26MISSING_PROPERTIES%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1%26TRANSPILE%3D1

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.