mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
fix(isolated-declarations): should not transform signature that has type annotation (#5927)
This commit is contained in:
parent
b6a9178075
commit
f07ff14876
3 changed files with 16 additions and 2 deletions
|
|
@ -30,12 +30,12 @@ impl<'a> IsolatedDeclarations<'a> {
|
|||
};
|
||||
|
||||
let entry = method_annotations.entry(name).or_default();
|
||||
entry.0 |= first_param.pattern.type_annotation.is_some();
|
||||
entry.0 |= first_param.pattern.type_annotation.is_none();
|
||||
entry.1 = Some(&mut first_param.pattern.type_annotation);
|
||||
}
|
||||
TSMethodSignatureKind::Get => {
|
||||
let entry = method_annotations.entry(name).or_default();
|
||||
entry.0 |= method.return_type.is_some();
|
||||
entry.0 |= method.return_type.is_none();
|
||||
entry.2 = Some(&mut method.return_type);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,3 +11,10 @@ export interface I {
|
|||
set value(_);
|
||||
get value(): string;
|
||||
}
|
||||
|
||||
|
||||
// Do nothing
|
||||
export interface Ref<T = any, S = T> {
|
||||
get value(): T
|
||||
set value(_: S)
|
||||
}
|
||||
|
|
@ -23,3 +23,10 @@ export interface I {
|
|||
set value(_: string);
|
||||
get value(): string;
|
||||
}
|
||||
export interface Ref<
|
||||
T = any,
|
||||
S = T
|
||||
> {
|
||||
get value(): T;
|
||||
set value(_: S);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue