curimit / SugarCpp

SugarCpp is a language which can compile to C++11.
135 stars 13 forks source link

Bug in function arguments #13

Closed ppwwyyxx closed 11 years ago

ppwwyyxx commented 11 years ago
import "string"
import "cstdio"
using namespace std

string s(a: int) = "haha"

int main()
    printf("%s", s(1).c_str())

compiles to

#include "a.h"

string s(int a) {
    return "haha";
}

int main() {
    printf("%s", s(1).c_str(1));
}

where c_str(1) is wrong.

curimit commented 11 years ago

Thanks, This bug has been fixed.