Skip to content

Commit

Permalink
Update Method.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Aug 6, 2024
1 parent 97c838b commit f4f2757
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/nitrogen/src/syntax/Method.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export class Method implements CodeNode {
this.parameters = parameters
} else {
// constructor(...) #2
const [prop] = args
this.name = prop.getSymbolOrThrow().getEscapedName()
const returnType = prop.getReturnType()
const [method] = args
this.name = method.getSymbolOrThrow().getEscapedName()
const returnType = method.getReturnType()
const isOptional = returnType.isNullable()
this.returnType = createType(returnType, isOptional)
this.parameters = prop.getParameters().map((p) => new Parameter(p))
this.parameters = method.getParameters().map((p) => new Parameter(p))
}
}

Expand Down

0 comments on commit f4f2757

Please sign in to comment.