// Part of the Carbon Language project, under the Apache License v2.0 with LLVM // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // AUTOUPDATE package ExplorerTest api; class ConvertTo(T:! type) { var v: T; extend impl as ImplicitAs(T) { fn Convert[self: Self]() -> T { return self.v; } } } fn Main() -> i32 { Assert({.v = true} as ConvertTo(bool), {.v = "Pass"} as ConvertTo(String)); return 0; } // CHECK:STDOUT: result: 0