Repository: babel/babel (TypeScript)

Issue:
[Bug]: Error parsing TypeScript generics on left-hand side
### 💻

- [ ] Would you like to work on a fix?

### How are you using Babel?

@babel/cli

### Input code

[REPL link](https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=KYDwDg9gTgLgBAQwEYGcZQQY3pgNglFOAQVXSxgGF9C4BvAKDmbjAFclcBLTONBGDzgBbAJ4AxNgDtMAfgBccADwBZOKBjApAEyKk0GbNQIoAfAAomLazAAWXFIv3kjNFABor15lyn8ZwIoqntYAlHAAvKZwAG4QXNoA3AwAvgwMoJCwcHgmcJQQMlDAmsa0Glq6JGSGVG70XnDawLnFIhJcwLjaiga-AObJaRng0DiFaHC-XPARcObhUQ3WmBM4uERzBUUlwGUoyY14KAB0YpIyStuYxaVu0XPmvv6YwIvRjN4sq34QuMAnXAQfpPPwwBABE4AM063VCyWsaTSQA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Cstage-2%2Ctypescript&prettier=false&targets=&version=7.24.5&externalPlugins=&assumptions=%7B%7D)

[other compilers for comparison](https://sucrase.io/#transforms=typescript&compareWithTypeScript=true&compressedCode=H4sIAJbyM2YAA22QTQqDMBCF94J3mKVC8QD%2BlVLozkNonNpAmkgyFkvx7k2MtlU6mzB58958CY690gR1Y0jXjICJ2hg4Le157l5hALb6oRGcgaGa7HF%2FXgbJjinkFeBIKNudrYy8zRXduEm38uGrcmkzJcMUquU2hqKEh%2BJtFgZTGIQBekxPd1aSaST0dH%2BXr8wtWotGR8tRtKml11x2%2B1hlCSwGJyggmpcvfq8wYaywWZs5%2BzwhTOL%2FIt8MlC5qfdlv5BqrBCZCdZ%2BZ5OoI48xPTTPhG7UjEZGeAQAA)

### Configuration file name

.babelrc

### Configuration

```json
{
  "presets": [
    [
      "@babel/preset-typescript",
      {
        "allowDeclareFields": true
      }
    ],
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": true
        },
        "modules": "commonjs"
      }
    ]
  ]
}
```

### Current and expected behavior

Current behavior: Babel outputs the error "Invalid left-hand side in assignment expression."

Expected behavior: Babel does not output an error, and generates code similar to what `tsc` generates.

### Environment

```
  System:
    OS: Windows 10 10.0.19045
  Binaries:
    Node: 20.11.1 - ~\.nvm\versions\node\v20.11.1\bin\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.2.4 - ~\.nvm\versions\node\v20.11.1\bin\npm.CMD
  npmPackages:
    @babel/cli: ^7.23.9 => 7.23.9
    @babel/core: ^7.24.0 => 7.24.0
    @babel/node: ^7.23.9 => 7.23.9
    @babel/polyfill: ^7.11.5 => 7.12.1
    @babel/preset-env: ^7.24.0 => 7.24.0
    @babel/preset-typescript: ^7.23.3 => 7.23.3
    eslint: ^8.57.0 => 8.57.0
    jest: ^29.7.0 => 29.7.0
```

### Possible solution

_No response_

### Additional context

The minimal reproduction code is a little weird, but the real use case where we encountered this issue is when initializing Sequelize model classes that extend a base class.


Hints:
Hey @mtdavis! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant [Slack community](https://babeljs.slack.com) that typically always has someone willing to help. You can sign-up [here](https://slack.babeljs.io/) for an invite.

Patch:
diff --git a/packages/babel-parser/src/plugins/typescript/index.ts b/packages/babel-parser/src/plugins/typescript/index.ts
--- a/packages/babel-parser/src/plugins/typescript/index.ts
+++ b/packages/babel-parser/src/plugins/typescript/index.ts
@@ -3708,6 +3708,7 @@ export default (superClass: ClassWithMixin<typeof Parser, IJSXParserMixin>) =>
             TSTypeCastExpression: true,
             TSParameterProperty: "parameter",
             TSNonNullExpression: "expression",
+            TSInstantiationExpression: "expression",
             TSAsExpression: (binding !== BindingFlag.TYPE_NONE ||
               !isUnparenthesizedInAssign) && ["expression", true],
             TSSatisfiesExpression: (binding !== BindingFlag.TYPE_NONE ||


Test patch:
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts
new file mode 100644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/input.ts
@@ -0,0 +1,18 @@
+export abstract class AbstractClass {
+    public static myFunc?: <M extends AbstractClass>(
+        this: AbstractClass,
+        instance: M,
+    ) => void;
+}
+
+export class ConcreteClass extends AbstractClass {
+    declare myField: string;
+}
+
+export const init = () => {
+    const cls = ConcreteClass;
+
+    cls.myFunc<ConcreteClass> = (instance) => {
+        console.log(instance.myField);
+    }
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/options.json b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/options.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/options.json
@@ -0,0 +1,4 @@
+{
+  "BABEL_8_BREAKING": false,
+  "plugins": ["typescript"]
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/output.json b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/output.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation-babel-7/output.json
@@ -0,0 +1,336 @@
+{
+  "type": "File",
+  "start":0,"end":397,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":18,"column":1,"index":397}},
+  "program": {
+    "type": "Program",
+    "start":0,"end":397,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":18,"column":1,"index":397}},
+    "sourceType": "module",
+    "interpreter": null,
+    "body": [
+      {
+        "type": "ExportNamedDeclaration",
+        "start":0,"end":158,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":1,"index":158}},
+        "exportKind": "value",
+        "specifiers": [],
+        "source": null,
+        "declaration": {
+          "type": "ClassDeclaration",
+          "start":7,"end":158,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":6,"column":1,"index":158}},
+          "abstract": true,
+          "id": {
+            "type": "Identifier",
+            "start":22,"end":35,"loc":{"start":{"line":1,"column":22,"index":22},"end":{"line":1,"column":35,"index":35},"identifierName":"AbstractClass"},
+            "name": "AbstractClass"
+          },
+          "superClass": null,
+          "body": {
+            "type": "ClassBody",
+            "start":36,"end":158,"loc":{"start":{"line":1,"column":36,"index":36},"end":{"line":6,"column":1,"index":158}},
+            "body": [
+              {
+                "type": "ClassProperty",
+                "start":42,"end":156,"loc":{"start":{"line":2,"column":4,"index":42},"end":{"line":5,"column":14,"index":156}},
+                "accessibility": "public",
+                "static": true,
+                "key": {
+                  "type": "Identifier",
+                  "start":56,"end":62,"loc":{"start":{"line":2,"column":18,"index":56},"end":{"line":2,"column":24,"index":62},"identifierName":"myFunc"},
+                  "name": "myFunc"
+                },
+                "computed": false,
+                "optional": true,
+                "typeAnnotation": {
+                  "type": "TSTypeAnnotation",
+                  "start":63,"end":155,"loc":{"start":{"line":2,"column":25,"index":63},"end":{"line":5,"column":13,"index":155}},
+                  "typeAnnotation": {
+                    "type": "TSFunctionType",
+                    "start":65,"end":155,"loc":{"start":{"line":2,"column":27,"index":65},"end":{"line":5,"column":13,"index":155}},
+                    "typeParameters": {
+                      "type": "TSTypeParameterDeclaration",
+                      "start":65,"end":90,"loc":{"start":{"line":2,"column":27,"index":65},"end":{"line":2,"column":52,"index":90}},
+                      "params": [
+                        {
+                          "type": "TSTypeParameter",
+                          "start":66,"end":89,"loc":{"start":{"line":2,"column":28,"index":66},"end":{"line":2,"column":51,"index":89}},
+                          "name": "M",
+                          "constraint": {
+                            "type": "TSTypeReference",
+                            "start":76,"end":89,"loc":{"start":{"line":2,"column":38,"index":76},"end":{"line":2,"column":51,"index":89}},
+                            "typeName": {
+                              "type": "Identifier",
+                              "start":76,"end":89,"loc":{"start":{"line":2,"column":38,"index":76},"end":{"line":2,"column":51,"index":89},"identifierName":"AbstractClass"},
+                              "name": "AbstractClass"
+                            }
+                          }
+                        }
+                      ]
+                    },
+                    "parameters": [
+                      {
+                        "type": "Identifier",
+                        "start":100,"end":119,"loc":{"start":{"line":3,"column":8,"index":100},"end":{"line":3,"column":27,"index":119},"identifierName":"this"},
+                        "name": "this",
+                        "typeAnnotation": {
+                          "type": "TSTypeAnnotation",
+                          "start":104,"end":119,"loc":{"start":{"line":3,"column":12,"index":104},"end":{"line":3,"column":27,"index":119}},
+                          "typeAnnotation": {
+                            "type": "TSTypeReference",
+                            "start":106,"end":119,"loc":{"start":{"line":3,"column":14,"index":106},"end":{"line":3,"column":27,"index":119}},
+                            "typeName": {
+                              "type": "Identifier",
+                              "start":106,"end":119,"loc":{"start":{"line":3,"column":14,"index":106},"end":{"line":3,"column":27,"index":119},"identifierName":"AbstractClass"},
+                              "name": "AbstractClass"
+                            }
+                          }
+                        }
+                      },
+                      {
+                        "type": "Identifier",
+                        "start":129,"end":140,"loc":{"start":{"line":4,"column":8,"index":129},"end":{"line":4,"column":19,"index":140},"identifierName":"instance"},
+                        "name": "instance",
+                        "typeAnnotation": {
+                          "type": "TSTypeAnnotation",
+                          "start":137,"end":140,"loc":{"start":{"line":4,"column":16,"index":137},"end":{"line":4,"column":19,"index":140}},
+                          "typeAnnotation": {
+                            "type": "TSTypeReference",
+                            "start":139,"end":140,"loc":{"start":{"line":4,"column":18,"index":139},"end":{"line":4,"column":19,"index":140}},
+                            "typeName": {
+                              "type": "Identifier",
+                              "start":139,"end":140,"loc":{"start":{"line":4,"column":18,"index":139},"end":{"line":4,"column":19,"index":140},"identifierName":"M"},
+                              "name": "M"
+                            }
+                          }
+                        }
+                      }
+                    ],
+                    "typeAnnotation": {
+                      "type": "TSTypeAnnotation",
+                      "start":148,"end":155,"loc":{"start":{"line":5,"column":6,"index":148},"end":{"line":5,"column":13,"index":155}},
+                      "typeAnnotation": {
+                        "type": "TSVoidKeyword",
+                        "start":151,"end":155,"loc":{"start":{"line":5,"column":9,"index":151},"end":{"line":5,"column":13,"index":155}}
+                      }
+                    }
+                  }
+                },
+                "value": null
+              }
+            ]
+          }
+        }
+      },
+      {
+        "type": "ExportNamedDeclaration",
+        "start":160,"end":241,"loc":{"start":{"line":8,"column":0,"index":160},"end":{"line":10,"column":1,"index":241}},
+        "exportKind": "value",
+        "specifiers": [],
+        "source": null,
+        "declaration": {
+          "type": "ClassDeclaration",
+          "start":167,"end":241,"loc":{"start":{"line":8,"column":7,"index":167},"end":{"line":10,"column":1,"index":241}},
+          "id": {
+            "type": "Identifier",
+            "start":173,"end":186,"loc":{"start":{"line":8,"column":13,"index":173},"end":{"line":8,"column":26,"index":186},"identifierName":"ConcreteClass"},
+            "name": "ConcreteClass"
+          },
+          "superClass": {
+            "type": "Identifier",
+            "start":195,"end":208,"loc":{"start":{"line":8,"column":35,"index":195},"end":{"line":8,"column":48,"index":208},"identifierName":"AbstractClass"},
+            "name": "AbstractClass"
+          },
+          "body": {
+            "type": "ClassBody",
+            "start":209,"end":241,"loc":{"start":{"line":8,"column":49,"index":209},"end":{"line":10,"column":1,"index":241}},
+            "body": [
+              {
+                "type": "ClassProperty",
+                "start":215,"end":239,"loc":{"start":{"line":9,"column":4,"index":215},"end":{"line":9,"column":28,"index":239}},
+                "declare": true,
+                "static": false,
+                "key": {
+                  "type": "Identifier",
+                  "start":223,"end":230,"loc":{"start":{"line":9,"column":12,"index":223},"end":{"line":9,"column":19,"index":230},"identifierName":"myField"},
+                  "name": "myField"
+                },
+                "computed": false,
+                "typeAnnotation": {
+                  "type": "TSTypeAnnotation",
+                  "start":230,"end":238,"loc":{"start":{"line":9,"column":19,"index":230},"end":{"line":9,"column":27,"index":238}},
+                  "typeAnnotation": {
+                    "type": "TSStringKeyword",
+                    "start":232,"end":238,"loc":{"start":{"line":9,"column":21,"index":232},"end":{"line":9,"column":27,"index":238}}
+                  }
+                },
+                "value": null
+              }
+            ]
+          }
+        }
+      },
+      {
+        "type": "ExportNamedDeclaration",
+        "start":243,"end":397,"loc":{"start":{"line":12,"column":0,"index":243},"end":{"line":18,"column":1,"index":397}},
+        "exportKind": "value",
+        "specifiers": [],
+        "source": null,
+        "declaration": {
+          "type": "VariableDeclaration",
+          "start":250,"end":397,"loc":{"start":{"line":12,"column":7,"index":250},"end":{"line":18,"column":1,"index":397}},
+          "declarations": [
+            {
+              "type": "VariableDeclarator",
+              "start":256,"end":397,"loc":{"start":{"line":12,"column":13,"index":256},"end":{"line":18,"column":1,"index":397}},
+              "id": {
+                "type": "Identifier",
+                "start":256,"end":260,"loc":{"start":{"line":12,"column":13,"index":256},"end":{"line":12,"column":17,"index":260},"identifierName":"init"},
+                "name": "init"
+              },
+              "init": {
+                "type": "ArrowFunctionExpression",
+                "start":263,"end":397,"loc":{"start":{"line":12,"column":20,"index":263},"end":{"line":18,"column":1,"index":397}},
+                "id": null,
+                "generator": false,
+                "async": false,
+                "params": [],
+                "body": {
+                  "type": "BlockStatement",
+                  "start":269,"end":397,"loc":{"start":{"line":12,"column":26,"index":269},"end":{"line":18,"column":1,"index":397}},
+                  "body": [
+                    {
+                      "type": "VariableDeclaration",
+                      "start":275,"end":301,"loc":{"start":{"line":13,"column":4,"index":275},"end":{"line":13,"column":30,"index":301}},
+                      "declarations": [
+                        {
+                          "type": "VariableDeclarator",
+                          "start":281,"end":300,"loc":{"start":{"line":13,"column":10,"index":281},"end":{"line":13,"column":29,"index":300}},
+                          "id": {
+                            "type": "Identifier",
+                            "start":281,"end":284,"loc":{"start":{"line":13,"column":10,"index":281},"end":{"line":13,"column":13,"index":284},"identifierName":"cls"},
+                            "name": "cls"
+                          },
+                          "init": {
+                            "type": "Identifier",
+                            "start":287,"end":300,"loc":{"start":{"line":13,"column":16,"index":287},"end":{"line":13,"column":29,"index":300},"identifierName":"ConcreteClass"},
+                            "name": "ConcreteClass"
+                          }
+                        }
+                      ],
+                      "kind": "const"
+                    },
+                    {
+                      "type": "ExpressionStatement",
+                      "start":307,"end":395,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":17,"column":5,"index":395}},
+                      "expression": {
+                        "type": "AssignmentExpression",
+                        "start":307,"end":395,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":17,"column":5,"index":395}},
+                        "operator": "=",
+                        "left": {
+                          "type": "TSInstantiationExpression",
+                          "start":307,"end":332,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":15,"column":29,"index":332}},
+                          "expression": {
+                            "type": "MemberExpression",
+                            "start":307,"end":317,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":15,"column":14,"index":317}},
+                            "object": {
+                              "type": "Identifier",
+                              "start":307,"end":310,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":15,"column":7,"index":310},"identifierName":"cls"},
+                              "name": "cls"
+                            },
+                            "computed": false,
+                            "property": {
+                              "type": "Identifier",
+                              "start":311,"end":317,"loc":{"start":{"line":15,"column":8,"index":311},"end":{"line":15,"column":14,"index":317},"identifierName":"myFunc"},
+                              "name": "myFunc"
+                            }
+                          },
+                          "typeParameters": {
+                            "type": "TSTypeParameterInstantiation",
+                            "start":317,"end":332,"loc":{"start":{"line":15,"column":14,"index":317},"end":{"line":15,"column":29,"index":332}},
+                            "params": [
+                              {
+                                "type": "TSTypeReference",
+                                "start":318,"end":331,"loc":{"start":{"line":15,"column":15,"index":318},"end":{"line":15,"column":28,"index":331}},
+                                "typeName": {
+                                  "type": "Identifier",
+                                  "start":318,"end":331,"loc":{"start":{"line":15,"column":15,"index":318},"end":{"line":15,"column":28,"index":331},"identifierName":"ConcreteClass"},
+                                  "name": "ConcreteClass"
+                                }
+                              }
+                            ]
+                          }
+                        },
+                        "right": {
+                          "type": "ArrowFunctionExpression",
+                          "start":335,"end":395,"loc":{"start":{"line":15,"column":32,"index":335},"end":{"line":17,"column":5,"index":395}},
+                          "id": null,
+                          "generator": false,
+                          "async": false,
+                          "params": [
+                            {
+                              "type": "Identifier",
+                              "start":336,"end":344,"loc":{"start":{"line":15,"column":33,"index":336},"end":{"line":15,"column":41,"index":344},"identifierName":"instance"},
+                              "name": "instance"
+                            }
+                          ],
+                          "body": {
+                            "type": "BlockStatement",
+                            "start":349,"end":395,"loc":{"start":{"line":15,"column":46,"index":349},"end":{"line":17,"column":5,"index":395}},
+                            "body": [
+                              {
+                                "type": "ExpressionStatement",
+                                "start":359,"end":389,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":38,"index":389}},
+                                "expression": {
+                                  "type": "CallExpression",
+                                  "start":359,"end":388,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":37,"index":388}},
+                                  "callee": {
+                                    "type": "MemberExpression",
+                                    "start":359,"end":370,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":19,"index":370}},
+                                    "object": {
+                                      "type": "Identifier",
+                                      "start":359,"end":366,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":15,"index":366},"identifierName":"console"},
+                                      "name": "console"
+                                    },
+                                    "computed": false,
+                                    "property": {
+                                      "type": "Identifier",
+                                      "start":367,"end":370,"loc":{"start":{"line":16,"column":16,"index":367},"end":{"line":16,"column":19,"index":370},"identifierName":"log"},
+                                      "name": "log"
+                                    }
+                                  },
+                                  "arguments": [
+                                    {
+                                      "type": "MemberExpression",
+                                      "start":371,"end":387,"loc":{"start":{"line":16,"column":20,"index":371},"end":{"line":16,"column":36,"index":387}},
+                                      "object": {
+                                        "type": "Identifier",
+                                        "start":371,"end":379,"loc":{"start":{"line":16,"column":20,"index":371},"end":{"line":16,"column":28,"index":379},"identifierName":"instance"},
+                                        "name": "instance"
+                                      },
+                                      "computed": false,
+                                      "property": {
+                                        "type": "Identifier",
+                                        "start":380,"end":387,"loc":{"start":{"line":16,"column":29,"index":380},"end":{"line":16,"column":36,"index":387},"identifierName":"myField"},
+                                        "name": "myField"
+                                      }
+                                    }
+                                  ]
+                                }
+                              }
+                            ],
+                            "directives": []
+                          }
+                        }
+                      }
+                    }
+                  ],
+                  "directives": []
+                }
+              }
+            }
+          ],
+          "kind": "const"
+        }
+      }
+    ],
+    "directives": []
+  }
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/input.ts b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/input.ts
new file mode 100644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/input.ts
@@ -0,0 +1,18 @@
+export abstract class AbstractClass {
+    public static myFunc?: <M extends AbstractClass>(
+        this: AbstractClass,
+        instance: M,
+    ) => void;
+}
+
+export class ConcreteClass extends AbstractClass {
+    declare myField: string;
+}
+
+export const init = () => {
+    const cls = ConcreteClass;
+
+    cls.myFunc<ConcreteClass> = (instance) => {
+        console.log(instance.myField);
+    }
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/options.json b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/options.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/options.json
@@ -0,0 +1,4 @@
+{
+  "BABEL_8_BREAKING": true,
+  "plugins": ["typescript"]
+}
diff --git a/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/output.json b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/output.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-parser/test/fixtures/typescript/assign/TSTypeParameterInstantiation/output.json
@@ -0,0 +1,340 @@
+{
+  "type": "File",
+  "start":0,"end":397,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":18,"column":1,"index":397}},
+  "program": {
+    "type": "Program",
+    "start":0,"end":397,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":18,"column":1,"index":397}},
+    "sourceType": "module",
+    "interpreter": null,
+    "body": [
+      {
+        "type": "ExportNamedDeclaration",
+        "start":0,"end":158,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":6,"column":1,"index":158}},
+        "exportKind": "value",
+        "specifiers": [],
+        "source": null,
+        "declaration": {
+          "type": "ClassDeclaration",
+          "start":7,"end":158,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":6,"column":1,"index":158}},
+          "abstract": true,
+          "id": {
+            "type": "Identifier",
+            "start":22,"end":35,"loc":{"start":{"line":1,"column":22,"index":22},"end":{"line":1,"column":35,"index":35},"identifierName":"AbstractClass"},
+            "name": "AbstractClass"
+          },
+          "superClass": null,
+          "body": {
+            "type": "ClassBody",
+            "start":36,"end":158,"loc":{"start":{"line":1,"column":36,"index":36},"end":{"line":6,"column":1,"index":158}},
+            "body": [
+              {
+                "type": "ClassProperty",
+                "start":42,"end":156,"loc":{"start":{"line":2,"column":4,"index":42},"end":{"line":5,"column":14,"index":156}},
+                "accessibility": "public",
+                "static": true,
+                "key": {
+                  "type": "Identifier",
+                  "start":56,"end":62,"loc":{"start":{"line":2,"column":18,"index":56},"end":{"line":2,"column":24,"index":62},"identifierName":"myFunc"},
+                  "name": "myFunc"
+                },
+                "computed": false,
+                "optional": true,
+                "typeAnnotation": {
+                  "type": "TSTypeAnnotation",
+                  "start":63,"end":155,"loc":{"start":{"line":2,"column":25,"index":63},"end":{"line":5,"column":13,"index":155}},
+                  "typeAnnotation": {
+                    "type": "TSFunctionType",
+                    "start":65,"end":155,"loc":{"start":{"line":2,"column":27,"index":65},"end":{"line":5,"column":13,"index":155}},
+                    "typeParameters": {
+                      "type": "TSTypeParameterDeclaration",
+                      "start":65,"end":90,"loc":{"start":{"line":2,"column":27,"index":65},"end":{"line":2,"column":52,"index":90}},
+                      "params": [
+                        {
+                          "type": "TSTypeParameter",
+                          "start":66,"end":89,"loc":{"start":{"line":2,"column":28,"index":66},"end":{"line":2,"column":51,"index":89}},
+                          "name": {
+                            "type": "Identifier",
+                            "start":66,"end":67,"loc":{"start":{"line":2,"column":28,"index":66},"end":{"line":2,"column":29,"index":67},"identifierName":"M"},
+                            "name": "M"
+                          },
+                          "constraint": {
+                            "type": "TSTypeReference",
+                            "start":76,"end":89,"loc":{"start":{"line":2,"column":38,"index":76},"end":{"line":2,"column":51,"index":89}},
+                            "typeName": {
+                              "type": "Identifier",
+                              "start":76,"end":89,"loc":{"start":{"line":2,"column":38,"index":76},"end":{"line":2,"column":51,"index":89},"identifierName":"AbstractClass"},
+                              "name": "AbstractClass"
+                            }
+                          }
+                        }
+                      ]
+                    },
+                    "params": [
+                      {
+                        "type": "Identifier",
+                        "start":100,"end":119,"loc":{"start":{"line":3,"column":8,"index":100},"end":{"line":3,"column":27,"index":119},"identifierName":"this"},
+                        "name": "this",
+                        "typeAnnotation": {
+                          "type": "TSTypeAnnotation",
+                          "start":104,"end":119,"loc":{"start":{"line":3,"column":12,"index":104},"end":{"line":3,"column":27,"index":119}},
+                          "typeAnnotation": {
+                            "type": "TSTypeReference",
+                            "start":106,"end":119,"loc":{"start":{"line":3,"column":14,"index":106},"end":{"line":3,"column":27,"index":119}},
+                            "typeName": {
+                              "type": "Identifier",
+                              "start":106,"end":119,"loc":{"start":{"line":3,"column":14,"index":106},"end":{"line":3,"column":27,"index":119},"identifierName":"AbstractClass"},
+                              "name": "AbstractClass"
+                            }
+                          }
+                        }
+                      },
+                      {
+                        "type": "Identifier",
+                        "start":129,"end":140,"loc":{"start":{"line":4,"column":8,"index":129},"end":{"line":4,"column":19,"index":140},"identifierName":"instance"},
+                        "name": "instance",
+                        "typeAnnotation": {
+                          "type": "TSTypeAnnotation",
+                          "start":137,"end":140,"loc":{"start":{"line":4,"column":16,"index":137},"end":{"line":4,"column":19,"index":140}},
+                          "typeAnnotation": {
+                            "type": "TSTypeReference",
+                            "start":139,"end":140,"loc":{"start":{"line":4,"column":18,"index":139},"end":{"line":4,"column":19,"index":140}},
+                            "typeName": {
+                              "type": "Identifier",
+                              "start":139,"end":140,"loc":{"start":{"line":4,"column":18,"index":139},"end":{"line":4,"column":19,"index":140},"identifierName":"M"},
+                              "name": "M"
+                            }
+                          }
+                        }
+                      }
+                    ],
+                    "returnType": {
+                      "type": "TSTypeAnnotation",
+                      "start":148,"end":155,"loc":{"start":{"line":5,"column":6,"index":148},"end":{"line":5,"column":13,"index":155}},
+                      "typeAnnotation": {
+                        "type": "TSVoidKeyword",
+                        "start":151,"end":155,"loc":{"start":{"line":5,"column":9,"index":151},"end":{"line":5,"column":13,"index":155}}
+                      }
+                    }
+                  }
+                },
+                "value": null
+              }
+            ]
+          }
+        }
+      },
+      {
+        "type": "ExportNamedDeclaration",
+        "start":160,"end":241,"loc":{"start":{"line":8,"column":0,"index":160},"end":{"line":10,"column":1,"index":241}},
+        "exportKind": "value",
+        "specifiers": [],
+        "source": null,
+        "declaration": {
+          "type": "ClassDeclaration",
+          "start":167,"end":241,"loc":{"start":{"line":8,"column":7,"index":167},"end":{"line":10,"column":1,"index":241}},
+          "id": {
+            "type": "Identifier",
+            "start":173,"end":186,"loc":{"start":{"line":8,"column":13,"index":173},"end":{"line":8,"column":26,"index":186},"identifierName":"ConcreteClass"},
+            "name": "ConcreteClass"
+          },
+          "superClass": {
+            "type": "Identifier",
+            "start":195,"end":208,"loc":{"start":{"line":8,"column":35,"index":195},"end":{"line":8,"column":48,"index":208},"identifierName":"AbstractClass"},
+            "name": "AbstractClass"
+          },
+          "body": {
+            "type": "ClassBody",
+            "start":209,"end":241,"loc":{"start":{"line":8,"column":49,"index":209},"end":{"line":10,"column":1,"index":241}},
+            "body": [
+              {
+                "type": "ClassProperty",
+                "start":215,"end":239,"loc":{"start":{"line":9,"column":4,"index":215},"end":{"line":9,"column":28,"index":239}},
+                "declare": true,
+                "static": false,
+                "key": {
+                  "type": "Identifier",
+                  "start":223,"end":230,"loc":{"start":{"line":9,"column":12,"index":223},"end":{"line":9,"column":19,"index":230},"identifierName":"myField"},
+                  "name": "myField"
+                },
+                "computed": false,
+                "typeAnnotation": {
+                  "type": "TSTypeAnnotation",
+                  "start":230,"end":238,"loc":{"start":{"line":9,"column":19,"index":230},"end":{"line":9,"column":27,"index":238}},
+                  "typeAnnotation": {
+                    "type": "TSStringKeyword",
+                    "start":232,"end":238,"loc":{"start":{"line":9,"column":21,"index":232},"end":{"line":9,"column":27,"index":238}}
+                  }
+                },
+                "value": null
+              }
+            ]
+          }
+        }
+      },
+      {
+        "type": "ExportNamedDeclaration",
+        "start":243,"end":397,"loc":{"start":{"line":12,"column":0,"index":243},"end":{"line":18,"column":1,"index":397}},
+        "exportKind": "value",
+        "specifiers": [],
+        "source": null,
+        "declaration": {
+          "type": "VariableDeclaration",
+          "start":250,"end":397,"loc":{"start":{"line":12,"column":7,"index":250},"end":{"line":18,"column":1,"index":397}},
+          "declarations": [
+            {
+              "type": "VariableDeclarator",
+              "start":256,"end":397,"loc":{"start":{"line":12,"column":13,"index":256},"end":{"line":18,"column":1,"index":397}},
+              "id": {
+                "type": "Identifier",
+                "start":256,"end":260,"loc":{"start":{"line":12,"column":13,"index":256},"end":{"line":12,"column":17,"index":260},"identifierName":"init"},
+                "name": "init"
+              },
+              "init": {
+                "type": "ArrowFunctionExpression",
+                "start":263,"end":397,"loc":{"start":{"line":12,"column":20,"index":263},"end":{"line":18,"column":1,"index":397}},
+                "id": null,
+                "generator": false,
+                "async": false,
+                "params": [],
+                "body": {
+                  "type": "BlockStatement",
+                  "start":269,"end":397,"loc":{"start":{"line":12,"column":26,"index":269},"end":{"line":18,"column":1,"index":397}},
+                  "body": [
+                    {
+                      "type": "VariableDeclaration",
+                      "start":275,"end":301,"loc":{"start":{"line":13,"column":4,"index":275},"end":{"line":13,"column":30,"index":301}},
+                      "declarations": [
+                        {
+                          "type": "VariableDeclarator",
+                          "start":281,"end":300,"loc":{"start":{"line":13,"column":10,"index":281},"end":{"line":13,"column":29,"index":300}},
+                          "id": {
+                            "type": "Identifier",
+                            "start":281,"end":284,"loc":{"start":{"line":13,"column":10,"index":281},"end":{"line":13,"column":13,"index":284},"identifierName":"cls"},
+                            "name": "cls"
+                          },
+                          "init": {
+                            "type": "Identifier",
+                            "start":287,"end":300,"loc":{"start":{"line":13,"column":16,"index":287},"end":{"line":13,"column":29,"index":300},"identifierName":"ConcreteClass"},
+                            "name": "ConcreteClass"
+                          }
+                        }
+                      ],
+                      "kind": "const"
+                    },
+                    {
+                      "type": "ExpressionStatement",
+                      "start":307,"end":395,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":17,"column":5,"index":395}},
+                      "expression": {
+                        "type": "AssignmentExpression",
+                        "start":307,"end":395,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":17,"column":5,"index":395}},
+                        "operator": "=",
+                        "left": {
+                          "type": "TSInstantiationExpression",
+                          "start":307,"end":332,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":15,"column":29,"index":332}},
+                          "expression": {
+                            "type": "MemberExpression",
+                            "start":307,"end":317,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":15,"column":14,"index":317}},
+                            "object": {
+                              "type": "Identifier",
+                              "start":307,"end":310,"loc":{"start":{"line":15,"column":4,"index":307},"end":{"line":15,"column":7,"index":310},"identifierName":"cls"},
+                              "name": "cls"
+                            },
+                            "computed": false,
+                            "property": {
+                              "type": "Identifier",
+                              "start":311,"end":317,"loc":{"start":{"line":15,"column":8,"index":311},"end":{"line":15,"column":14,"index":317},"identifierName":"myFunc"},
+                              "name": "myFunc"
+                            }
+                          },
+                          "typeParameters": {
+                            "type": "TSTypeParameterInstantiation",
+                            "start":317,"end":332,"loc":{"start":{"line":15,"column":14,"index":317},"end":{"line":15,"column":29,"index":332}},
+                            "params": [
+                              {
+                                "type": "TSTypeReference",
+                                "start":318,"end":331,"loc":{"start":{"line":15,"column":15,"index":318},"end":{"line":15,"column":28,"index":331}},
+                                "typeName": {
+                                  "type": "Identifier",
+                                  "start":318,"end":331,"loc":{"start":{"line":15,"column":15,"index":318},"end":{"line":15,"column":28,"index":331},"identifierName":"ConcreteClass"},
+                                  "name": "ConcreteClass"
+                                }
+                              }
+                            ]
+                          }
+                        },
+                        "right": {
+                          "type": "ArrowFunctionExpression",
+                          "start":335,"end":395,"loc":{"start":{"line":15,"column":32,"index":335},"end":{"line":17,"column":5,"index":395}},
+                          "id": null,
+                          "generator": false,
+                          "async": false,
+                          "params": [
+                            {
+                              "type": "Identifier",
+                              "start":336,"end":344,"loc":{"start":{"line":15,"column":33,"index":336},"end":{"line":15,"column":41,"index":344},"identifierName":"instance"},
+                              "name": "instance"
+                            }
+                          ],
+                          "body": {
+                            "type": "BlockStatement",
+                            "start":349,"end":395,"loc":{"start":{"line":15,"column":46,"index":349},"end":{"line":17,"column":5,"index":395}},
+                            "body": [
+                              {
+                                "type": "ExpressionStatement",
+                                "start":359,"end":389,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":38,"index":389}},
+                                "expression": {
+                                  "type": "CallExpression",
+                                  "start":359,"end":388,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":37,"index":388}},
+                                  "callee": {
+                                    "type": "MemberExpression",
+                                    "start":359,"end":370,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":19,"index":370}},
+                                    "object": {
+                                      "type": "Identifier",
+                                      "start":359,"end":366,"loc":{"start":{"line":16,"column":8,"index":359},"end":{"line":16,"column":15,"index":366},"identifierName":"console"},
+                                      "name": "console"
+                                    },
+                                    "computed": false,
+                                    "property": {
+                                      "type": "Identifier",
+                                      "start":367,"end":370,"loc":{"start":{"line":16,"column":16,"index":367},"end":{"line":16,"column":19,"index":370},"identifierName":"log"},
+                                      "name": "log"
+                                    }
+                                  },
+                                  "arguments": [
+                                    {
+                                      "type": "MemberExpression",
+                                      "start":371,"end":387,"loc":{"start":{"line":16,"column":20,"index":371},"end":{"line":16,"column":36,"index":387}},
+                                      "object": {
+                                        "type": "Identifier",
+                                        "start":371,"end":379,"loc":{"start":{"line":16,"column":20,"index":371},"end":{"line":16,"column":28,"index":379},"identifierName":"instance"},
+                                        "name": "instance"
+                                      },
+                                      "computed": false,
+                                      "property": {
+                                        "type": "Identifier",
+                                        "start":380,"end":387,"loc":{"start":{"line":16,"column":29,"index":380},"end":{"line":16,"column":36,"index":387},"identifierName":"myField"},
+                                        "name": "myField"
+                                      }
+                                    }
+                                  ]
+                                }
+                              }
+                            ],
+                            "directives": []
+                          }
+                        }
+                      }
+                    }
+                  ],
+                  "directives": []
+                }
+              }
+            }
+          ],
+          "kind": "const"
+        }
+      }
+    ],
+    "directives": []
+  }
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/input.ts b/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/input.ts
new file mode 100644
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/input.ts
@@ -0,0 +1,18 @@
+export abstract class AbstractClass {
+    public static myFunc?: <M extends AbstractClass>(
+        this: AbstractClass,
+        instance: M,
+    ) => void;
+}
+
+export class ConcreteClass extends AbstractClass {
+    declare myField: string;
+}
+
+export const init = () => {
+    const cls = ConcreteClass;
+
+    cls.myFunc<ConcreteClass> = (instance) => {
+        console.log(instance.myField);
+    }
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/options.json b/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/options.json
new file mode 100644
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/options.json
@@ -0,0 +1,11 @@
+{
+  "sourceType": "module",
+  "plugins": [
+    [
+      "transform-typescript",
+      {
+        "allowDeclareFields": true
+      }
+    ]
+  ]
+}
diff --git a/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/output.mjs b/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/output.mjs
new file mode 100644
--- /dev/null
+++ b/packages/babel-plugin-transform-typescript/test/fixtures/lvalues/TSTypeParameterInstantiation/output.mjs
@@ -0,0 +1,10 @@
+export class AbstractClass {
+  static myFunc;
+}
+export class ConcreteClass extends AbstractClass {}
+export const init = () => {
+  const cls = ConcreteClass;
+  cls.myFunc = instance => {
+    console.log(instance.myField);
+  };
+};