mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Reverse interop support for type aliases. (#7043)
Allow any type that has a mapping from Carbon to C++ to be exposed to C++ via name lookup. This also exposes the logic to export Carbon classes to C++ to apply during type mapping, which gives very slight support for passing Carbon types to C++ functions from Carbon, but not really enough to sensibly test yet. Depends on #7042.
This commit is contained in:
@@ -316,9 +316,13 @@ class Derived {
|
||||
fn F[self: Self]() {
|
||||
//@dump-sem-ir-begin
|
||||
// TODO: It should be possible to call protected methods in the base class.
|
||||
// CHECK:STDERR: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE+4]]:5: error: call argument of type `Derived` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: self.instance_fn();
|
||||
// CHECK:STDERR: ^~~~
|
||||
// CHECK:STDERR: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE+8]]:22: error: no matching function for call to 'instance_fn' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | self.instance_fn();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_import_function_member_protected_extend_call_instance_in_member.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./function_member_protected.h:4:8: note: candidate function not viable: cannot convert argument of incomplete type 'const Carbon::Derived' to 'C' for object argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto instance_fn() -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
self.instance_fn();
|
||||
//@dump-sem-ir-end
|
||||
|
||||
Reference in New Issue
Block a user