mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Support for as operator and user-defined As impls. (#1476)
This commit is contained in:
@@ -33,10 +33,6 @@ class Integer {
|
||||
var int: i32;
|
||||
}
|
||||
|
||||
impl Integer as ImplicitAs(Integer) {
|
||||
fn Convert[me: Self]() -> Integer { return me; }
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
var i: Integer = {.int = 1};
|
||||
var c: Cell(Integer) = Cell(Integer).Create(i); // c contains 1
|
||||
|
||||
Reference in New Issue
Block a user