Skip to content

fix: issue #5839#6960

Merged
thorn0 merged 1 commit intomasterfrom
issue-5839
Nov 15, 2019
Merged

fix: issue #5839#6960
thorn0 merged 1 commit intomasterfrom
issue-5839

Conversation

@alexander-akait
Copy link
Copy Markdown
Member

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

fixes #5839

just tests

function f3<>() {}

class f4 {
constructor<>() {}
Copy link
Copy Markdown
Member

@thorn0 thorn0 Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constructors can't have type parameters, but classes (as well as interfaces and type aliases) can.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

@thorn0 thorn0 Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need a separate folder for tests like this. typescript_invalid or typescript_error_recovery.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You misunderstood me. All this code is not valid TS. Not only constructors.


function f3<>() {}

class f4 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class f4 {
class f4<> {


const f5 = function<>() {}

interface f6 {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface f6 {
interface f6<> {

@alexander-akait
Copy link
Copy Markdown
Member Author

@thorn0 ready for review

@thorn0 thorn0 merged commit a9217a7 into master Nov 15, 2019
@lydell lydell deleted the issue-5839 branch November 15, 2019 10:51
lipis added a commit that referenced this pull request Jan 8, 2020
* 'next' of github.com:prettier/prettier:
  Optimize some usage of `Array#filter` (#6996)
  Update `jest` to v24 (#6954)
  Replace `trim{Left,Right}` with `trim{Start,End}` (#6994)
  Set `trailingComma` default value to `es5` (#6963)
  Fix `new` usage for builtin objects (#6968)
  Replace `indexOf` with `includes` (#6967)
  fix: tests for empty type parameters in TS (#6960)
  Fix MDX html parsing errors (#6949)
  fix: issue #6813 (Zero-based lists are broken) (#6852)
  Style: use async functions (#6935)
  Disable trailingComma for Angular internal parser (#6912)
  Update `snapshot-diff` to v0.6.1 (#6955)
  Update build scripts to target Node.js 10 (#6908)
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Feb 13, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typescript: empty typeParameters and typeArguments

2 participants