dart-lang / dart-lang/native

Constructing non-static nested classes

Open
#629 2 comments 0 reactions 0 assignees View on GitHub
good first issue lang-java package:jni package:jnigen type-enhancement
Dominant language
Dart
Stars
275
Forks
144
Avg merge
2d 10h
Merged PRs (30d)
47

Description

```java
public class A {
public class B {
// ...
}
}
```

We should be able to construct `B` from an **instance** of `A`. Something like:

```dart
final a = A(...);
final b = a.B(...);
```

`a.B` here has to be a field where its `call` method invokes the default constructor of `B`. `B`'s constructors themselves have to all be private (except for `fromRef`) because we cannot construct `B` without having an instance of `A`.

Other constructors:

```dart
final b = a.B.ctor2(...);
```

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.