-
Notifications
You must be signed in to change notification settings - Fork 471
Open
Description
this is a really stupid example that would likely never happen in real-life (but hey, you give a million monkeys infinite amount of time with keyboards...). if it DOES happen, it'll cost some developer x amount of hours to debug. it's kinda far out there, but not as far as @as("RE_EXN_ID)"
...
right now i'm just having fun trying to break things to find bugs and i stumbled upon this.
exception Foo({@as("Error") e: string})
let s: string = try throw(Foo({e: "foo"})) catch {
| Foo({e}) => e
}
Console.log(s == "foo")
Console.log(s)
as you can imagine, this logs false and then an error object. i'm not sure what the takeaway is here.. possibly:
a) call me an idiot and close this
b) come up with some way to prohibit use of or warn on using @as("Error") for inlined exception records (yeah, kinda niche...)
Metadata
Metadata
Assignees
Labels
No labels