no segfault!
This commit is contained in:
38
test.mcl
38
test.mcl
@@ -1,21 +1,47 @@
|
||||
type str = [u8];
|
||||
|
||||
|
||||
|
||||
struct Foo {
|
||||
a: usize,
|
||||
b: &str
|
||||
}
|
||||
|
||||
fn Foo.new(a: usize, b: &str) -> Foo {
|
||||
return Foo {
|
||||
fn Foo.new(a: usize, b: &str) -> &Foo {
|
||||
return &Foo {
|
||||
a: a,
|
||||
b: b
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
fn main() -> i32 {
|
||||
let obj = Foo::new();
|
||||
|
||||
fn print(s: &str) {
|
||||
// do nothign for now
|
||||
}
|
||||
|
||||
fn mul(n: usize, n2: usize) -> usize {
|
||||
return n * n2;
|
||||
}
|
||||
|
||||
fn main() -> i32 {
|
||||
let obj = Foo::new(1, "owo");
|
||||
obj->b;
|
||||
let owo = "ahahaha";
|
||||
loop {
|
||||
print(owo);
|
||||
}
|
||||
|
||||
for (let i = 0; i < 10; i += 1) {
|
||||
print("nyaaa");
|
||||
if (i > 7) {
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
print("cant see me!");
|
||||
}
|
||||
while (true) {
|
||||
mul(1);
|
||||
}
|
||||
}
|
||||
|
||||
const FOO: usize = main;
|
||||
|
||||
Reference in New Issue
Block a user