mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 09:38:16 +03:00
fix(es/lints): Don't visit types while collecting const
(#3967)
This commit is contained in:
parent
978a210c68
commit
c6b5371c51
@ -405,7 +405,7 @@ fn linefeed_lf(input: PathBuf) {
|
||||
|
||||
let fm_output = cm.load_file(&output).unwrap();
|
||||
|
||||
assert_eq!(false, css_str.contains("\r\n"));
|
||||
assert!(!css_str.contains("\r\n"));
|
||||
|
||||
NormalizedOutput::from(css_str)
|
||||
.compare_to_file(output)
|
||||
@ -484,7 +484,7 @@ fn linefeed_crlf(input: PathBuf) {
|
||||
|
||||
let fm_output = cm.load_file(&output).unwrap();
|
||||
|
||||
assert_eq!(true, css_str.contains("\r\n"));
|
||||
assert!(css_str.contains("\r\n"));
|
||||
|
||||
NormalizedOutput::from(css_str)
|
||||
.compare_to_file(output)
|
||||
|
@ -92,6 +92,8 @@ struct Collector<'a> {
|
||||
}
|
||||
|
||||
impl Visit for Collector<'_> {
|
||||
noop_visit_type!();
|
||||
|
||||
fn visit_assign_pat_prop(&mut self, p: &AssignPatProp) {
|
||||
p.visit_children_with(self);
|
||||
|
||||
|
8
crates/swc_ecma_lints/tests/pass/issue-3956/1/input.ts
Normal file
8
crates/swc_ecma_lints/tests/pass/issue-3956/1/input.ts
Normal file
@ -0,0 +1,8 @@
|
||||
function fn1({ x, y }: { x: string, y: string }): string {
|
||||
return x + y
|
||||
}
|
||||
|
||||
function fn2({ x, y }: { x: string, y: string }): string {
|
||||
const fn3: ({ x, y }: { x: string, y: string }) => string = fn1
|
||||
return fn3({ x, y })
|
||||
}
|
Loading…
Reference in New Issue
Block a user