parent
							
								
									03864e4ab8
								
							
						
					
					
						commit
						3b5de71e60
					
				| 
						 | 
					@ -87,3 +87,7 @@ pub fn (e &Error) free() {
 | 
				
			||||||
pub fn (n &None__) free() {
 | 
					pub fn (n &None__) free() {
 | 
				
			||||||
	unsafe { n.msg.free() }
 | 
						unsafe { n.msg.free() }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pub fn (_ none) str() string {
 | 
				
			||||||
 | 
						return 'none'
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					struct MyError {
 | 
				
			||||||
 | 
						code int
 | 
				
			||||||
 | 
						msg  string
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fn foo() int | none | IError {
 | 
				
			||||||
 | 
						return IError(MyError{})
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fn test_string_optional_none() {
 | 
				
			||||||
 | 
						x := foo()
 | 
				
			||||||
 | 
						println(x)
 | 
				
			||||||
 | 
						assert true
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue