mirror of
				https://git.sfja.dk/Mikkel/slige.git
				synced 2025-11-04 12:38:16 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			418 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			418 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
 | 
						|
fn exit(status_code: int) #[builtin(Exit)] {}
 | 
						|
 | 
						|
fn print(msg: string) #[builtin(Print)] {}
 | 
						|
fn println(msg: string) { print(msg + "\n") }
 | 
						|
 | 
						|
fn id<T>(v: T) -> T {
 | 
						|
    v
 | 
						|
}
 | 
						|
 | 
						|
fn main() {
 | 
						|
    println("calling with int");
 | 
						|
    if id::<int>(123) != 123 {
 | 
						|
        exit(1);
 | 
						|
    }
 | 
						|
    println("calling with bool");
 | 
						|
    if id::<bool>(true) != true {
 | 
						|
        exit(1);
 | 
						|
    }
 | 
						|
    println("all tests ran successfully");
 | 
						|
    exit(0);
 | 
						|
}
 | 
						|
 |