scope: refuse `&x` where x is a local variable
[nit.git] / tests / test_ffi_c_new_extern.nit
index e9b46d2..da5c83c 100644 (file)
@@ -14,7 +14,7 @@
 
 # Test callback to an extern constructor from extern code
 
-import standard::string
+import core::text
 
 extern class IntPtr `{ int* `}
        new (v: Int) `{
@@ -23,11 +23,11 @@ extern class IntPtr `{ int* `}
                return r;
        `}
 
-       redef fun to_s import NativeString, NativeString.to_s `{
-               int len = snprintf(NULL, 0, "%d", *recv) + 1;
-               char *c = new_NativeString(len);
-               sprintf(c, "%d", *recv);
-               return NativeString_to_s(c);
+       redef fun to_s import CString, CString.to_s `{
+               int len = snprintf(NULL, 0, "%d", *self) + 1;
+               char *c = new_CString(len);
+               sprintf(c, "%d", *self);
+               return CString_to_s(c);
        `}
 end