Skip to content

Commit df5a8bf

Browse files
Deprecation code within a block and updated deprecation note
1 parent 60c7b97 commit df5a8bf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/backend/src/codegen.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -810,9 +810,11 @@ impl TryToTokens for ast::Export {
810810
if self.function.r#async {
811811
(quote_spanned! {
812812
self.function.name_span =>
813-
#[deprecated(note = "async constructors are not supported")]
814-
fn constructor() {}
815-
constructor();
813+
const _: () = {
814+
#[deprecated(note = "async constructors produce invalid TS code and support will be removed in the future")]
815+
const fn constructor() {}
816+
constructor();
817+
};
816818
})
817819
.to_tokens(into);
818820
}

0 commit comments

Comments
 (0)