-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix overloads coming from overridable interfaces
Fixes #1457
- Loading branch information
Showing
6 changed files
with
123 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "pch.h" | ||
#include "OverloadClass.h" | ||
#include "OverloadClass.g.cpp" | ||
|
||
namespace winrt::test_component::implementation | ||
{ | ||
void OverloadClass::Overload() | ||
{ | ||
throw hresult_not_implemented(); | ||
} | ||
void OverloadClass::Overload(int a) | ||
{ | ||
throw hresult_not_implemented(); | ||
} | ||
void OverloadClass::Overload(int a, int b) | ||
{ | ||
throw hresult_not_implemented(); | ||
} | ||
void OverloadClass::Overload(int a, int b, int c) | ||
{ | ||
throw hresult_not_implemented(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#pragma once | ||
#include "OverloadClass.g.h" | ||
|
||
namespace winrt::test_component::implementation | ||
{ | ||
struct OverloadClass : OverloadClassT<OverloadClass> | ||
{ | ||
OverloadClass() = default; | ||
|
||
void Overload(); | ||
void Overload(int a); | ||
void Overload(int a, int b); | ||
void Overload(int a, int b, int c); | ||
}; | ||
} | ||
namespace winrt::test_component::factory_implementation | ||
{ | ||
struct OverloadClass : OverloadClassT<OverloadClass, implementation::OverloadClass> | ||
{ | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#include "pch.h" | ||
#include "winrt/test_component.h" | ||
|
||
// Simple compile-only test to validate overloads coming from overridable interfaces compile. | ||
|
||
using namespace winrt; | ||
using namespace test_component; | ||
|
||
struct DerivedClass : OverloadClassT<DerivedClass> | ||
{ | ||
void Foo() | ||
{ | ||
// make sure we can actually call the overloads (no ambiguous call errors) | ||
Overload(); | ||
Overload(1); | ||
Overload(1, 2); | ||
Overload(1, 2, 3); | ||
} | ||
}; |