aui-framework / aui-framework/aui

`setContents(Label {"Test"})`: better diagnostics needed

Open
#620 0 comments 0 reactions 1 assignee Claimed by @luadebug View on GitHub
Dominant language
C++
Stars
598
Forks
44
Avg merge
17h 56m
Merged PRs (30d)
3

Description

### One More Step Before opening this issue

- [x] To follow our [Code of Conduct](https://github.com/aui-framework/aui/blob/master/CODE_OF_CONDUCT.md)
- [x] I've considered [existing issues on GitHub page](https://github.com/aui-framework/aui/issues) and didn't find a similar issue

### What happened?

At this moment, an attempt to push a view (not a container) to `AWindow::setContents` will produce the following error:

Image

Which is misleading and hard to understand for a newcomer.

Either `static_assert` or `requires` clause is needed. I want the error indicating you have passed an AView instead of AViewContainer; wrap AView with some kind of container, i.e., `view` -> `Centered { view }`.

### Relevant log output or stack trace

```shell

```

### Steps to reproduce

```bash
AUI_ENTRY {
auto w = _new("test");
w->setContents(Label { "test" });
return 0;
}
```

### Affected Platforms

_No response_

### Link to build, i.e. failing GitHub Action job (if any).

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.