Skip to content

Suboptimal error message when setting non-existing field #19

@stamourv

Description

@stamourv

Consider this program:

#lang dssl2
class Foo[X]:
    let _data
    def __init__(self):
        self.data = 10 # wrong var name

which produces the error:

bug-hw5.rkt:7:13: set!: unbound identifier
  at: «Foo».data
  in: (set! «Foo».data 10)

That error message isn't too bad (it clearly shows the field name at fault), but the fact that it it's terms of set! isn't great.

FWIW, that happens only for class fields. Not for either local or global variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions