ErrorsValues and types · rule
syntax.new_keyword
Value created with new.
Area 2, Values and types; not declinable; the next step is usually the agent's.
A value is made with Type(value), or an object with Type { field: value }, without new.
type CustomerNote = Text { max_length: 500}type NoteWasEdited = Bool {}function edited(before: CustomerNote, after: CustomerNote) -> NoteWasEdited { return new NoteWasEdited(before != after)}
error Jadpo creates a value without new
--> main.jadpo:8:12
|8 | return new NoteWasEdited(before != after) | ^^^ remove `new`
- reason
newcreates an object in JavaScript, TypeScript, Java and C#; Jadpo creates a value withType(value), or an object withType { field: value }.- next
- Remove
new(agent) - rule
- syntax.
new_ keyword - help
- https://jadpo.
dev/docs/errors/syntax. new_ keyword
Markdown for agents: /docs/errors/syntax.new_keyword.md.Built from Jadpo main at aee2e8f.