2018-03-04 09:17:52 +03:00
|
|
|
//! Test that `#[span]` and `#[fold]` can be used at same time.
|
2019-02-20 05:35:41 +03:00
|
|
|
extern crate serde;
|
2018-03-04 09:17:52 +03:00
|
|
|
extern crate swc_common;
|
2019-02-20 05:35:41 +03:00
|
|
|
use serde::{Deserialize, Serialize};
|
2018-11-17 10:38:23 +03:00
|
|
|
use swc_common::{ast_node, Fold, Span, Spanned};
|
2018-03-04 09:17:52 +03:00
|
|
|
|
|
|
|
#[ast_node]
|
|
|
|
// See https://github.com/rust-lang/rust/issues/44925
|
|
|
|
pub struct Class {
|
|
|
|
#[span]
|
|
|
|
pub has_span: HasSpan,
|
|
|
|
#[fold(ignore)]
|
|
|
|
pub s: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
#[ast_node]
|
|
|
|
pub struct Tuple(#[span] HasSpan, #[fold(ignore)] usize, usize);
|
|
|
|
|
2019-02-20 05:35:41 +03:00
|
|
|
#[derive(Debug, Clone, PartialEq, Fold, Spanned, Serialize, Deserialize)]
|
2018-03-04 09:17:52 +03:00
|
|
|
pub struct HasSpan {
|
|
|
|
pub span: Span,
|
|
|
|
}
|