racket / rhombus

Rhombus programming language
Other
332 stars 59 forks source link

disallow use of veneer names in dynamic-mode contexts #505

Closed mflatt closed 3 months ago

mflatt commented 4 months ago

Since veneers can behave confusingly in dynamic-mode contexts, disallow their use as an expression or annotation in a dynamic-mode context. The intent is to avoid especially confusing behavior like a true result from

("a" :: StringCI) > "A"

where static mode would error due to inconsistent comparable implementations for the arguments to >, but dynamic mode would just dispatch to a dynamic (not case-sensitive) string comparison.

This change does not avoid all possible confusions with veneers. For example, a function declared in a static context can declare a veneer result annotation, and then the function can still be called in a dynamic context. The change hopefully avoids most potential confusion, though.