Open hyyan opened 1 year ago
@hyyan
To fully support the type inference and validation we need a type system implementation. Implementing a type system is normally very time consuming. For simple or clear cases like above, we could provide a validation. Here we need to know that BBjNumber
is a number
type and a string literal is not convertible to a number.
What would probably help in some other cases is checking the variable name prefix, but for !
it will not work as java.lang.String is also an Object
For simple or clear cases like above, we could provide a validation. Here we need to know that
BBjNumber
is anumber
type and a string literal is not convertible to a number.What would probably help in some other cases is checking the variable name prefix, but for
!
it will not work as java.lang.String is also an Object
@dhuebner That would be completely fine. We would like to cover only simple and obvious cases at the moment. Once we have a good understanding of the challenges involved, we can then start to work on more complex cases.
Is it possible to validate field value against the type. The following should produce an error:
The value is a string but the type is
BBjNumber