empty_class.carbon 489 B

123456789101112131415161718
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // NOAUTOUPDATE
  6. package ExplorerTest api;
  7. class A { fn F[self: Self]() -> i32 { return 0; } }
  8. fn Main() -> i32 {
  9. // {} is a bit strange: its type is {}. Make sure we can properly convert a
  10. // value of type {} to class type.
  11. var a: A = {};
  12. return a.F();
  13. }
  14. // CHECK:STDOUT: result: 0