aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
author_ov4 <ov4@ov4.org>2026-10-17 06:50:29 +0000
committer_ov4 <ov4@ov4.org>2026-10-17 06:50:29 +0000
commitc89477d615fb0ce4d89786ef848ffe6aca1da088 (patch)
treeb2c5692cfa4946fcd1df034630fc1a678d922b9c /lib/CodeGen
parent43451328a5ae74ffa34356259ee02e3786f070c3 (diff)
feat(classes): support explicit NEW constructor method calls
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/Designator.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/CodeGen/Designator.cc b/lib/CodeGen/Designator.cc
index adf08f1..13eb25f 100644
--- a/lib/CodeGen/Designator.cc
+++ b/lib/CodeGen/Designator.cc
@@ -56,9 +56,7 @@ void CodeGen::runTypePrePass(const std::vector<std::unique_ptr<StmtAST>> &Statem
for (const auto &Method : Class->getMethods()) {
SaveAndRestore<int> Location(DiagnosticLine, Method->getLine());
const std::string &Name = Method->getProto()->getName();
- if (sameIdentifier(Name, "NEW")) {
- reportError("NEW constructors are not implemented");
- } else if (sameIdentifier(Name, "this")) {
+ if (sameIdentifier(Name, "this")) {
reportError("A method cannot be named this");
} else if (!Names.insert(Name).second) {
reportError("Duplicate member %s in class %s", Name.c_str(), Class->getName().c_str());