rhombus-prototype
rhombus-prototype copied to clipboard
`syntax_class` fields have `Syntax` static information, even when they aren't syntax
Consider this code:
#lang rhombus/static
syntax_class Foo:
kind: ~term
fields: value
| '$(stx :: Number)':
field value = stx.unwrap()
def '$(foo :: Foo)' = '42'
foo.value.unwrap()
I would expect the final line to fail statically, since there should not be a known unwrap() method on foo.value; however, this program compiles in static mode. It fails at runtime on the last line, but not when actually matching against the syntax class.