sweet-js / sweet-core

Sweeten your JavaScript.
https://www.sweetjs.org
BSD 2-Clause "Simplified" License
4.59k stars 211 forks source link

importing names that have been "marked" by macro expansion are being renamed #736

Closed disnet closed 7 years ago

disnet commented 7 years ago

Importing names that have "gone through a macro" causes renaming in the import clause:

// mod.js
syntax m = ctx => {
  let first = ctx.next().value;
  let second = ctx.next().value;
  return #`class ${first} ${second}`;
}  
export m F { }

// main.js
import { F } from './mod.js';
let c = new F();

compiling main.js with sweet gives:

import {F_5} from "./mod.js";
let c_7 = new F_5;