Execute typechecks eagerly when within a constraint (#964)

This changes the language to check all types eagerly when within a type constraint.

This addresses two regressions in the language:

1. Type constraints are too relaxed (listing/mapping parameters may not be checked)
2. Failing type constraints hide members that were forced during execution of the constraint
This commit is contained in:
Daniel Chao
2025-02-19 12:51:52 -08:00
committed by GitHub
parent 227f0637fc
commit 643c6f5a76
17 changed files with 266 additions and 63 deletions
@@ -0,0 +1,9 @@
typealias EmailAddress = String(matches(Regex(#".+@\S+|.+<\S+@\S+>"#)))
class MyClass {
emails: Listing<EmailAddress>
}
myClass: MyClass
others: Listing<module(this != module)>
@@ -0,0 +1,7 @@
amends ".../input-helper/classes/MyClass.pkl"
myClass {
emails {
"baz@bar.com"
}
}