Skip to content

Commit

Permalink
new instance type
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Nov 26, 2023
1 parent 917a38f commit ee4dbda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/interpreter/runtimeModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ export class Evaluation {

const name = node.instantiated.name

if (!target.is(Class)) raise(new Error(`${name} is not a class, you cannot generate instances of it`))
if (!target.is(Class)) raise(new Error(`${name} is not a class, you cannot generate instances of a ${target?.kind}`))

if (target.isAbstract) raise(new Error(`${name} is an abstract class, you cannot generate instances`))

Expand Down
2 changes: 1 addition & 1 deletion src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ export class Super extends Expression(Node) {

export class New extends Expression(Node) {
get kind(): 'New' { return 'New' }
readonly instantiated!: Reference<Class>
readonly instantiated!: Reference<Module>
readonly args!: List<NamedArgument>

constructor({ args = [], ...payload }: Payload<New, 'instantiated'>) {
Expand Down

0 comments on commit ee4dbda

Please sign in to comment.