Skip to content

Hit an error position xx does not resolve to a source location while trying to transform ast to literal code. #2300

Answered by kdy1
hyf0 asked this question in Q&A
Discussion options

You must be logged in to vote
  let cm = Lrc::new(SourceMap::new(FilePathMapping::empty()));

This is wrong. You should use the same instance of Lrc<SourceMap> for parsing and codegen.
It is designed to be shared and that's why it's wrapped in Lrc, which is Rc or Arc, depending on the compile option.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@hyf0
Comment options

@kdy1
Comment options

Answer selected by hyf0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants