dart-lang / dart-lang/language

Allow interface as its own construct (short for `abstract interface class`)

Open
#3,736 16 comments 4 reactions 0 assignees View on GitHub
feature
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

You should be allowed to declare an `interface`

```dart
interface MyInterface {}
```

Which would be short for:

```dart
abstract interface class MyInterface {}
```

This is similar to how [mixin](https://dart.dev/language/mixins) allows both a separate construct and a class modifier.

---

_Originally this proposal included addition restrictions on interfaces, but those ideas have been moved to a lint proposal instead (https://github.com/dart-lang/sdk/issues/59466)._

Contributor guide

Open the contributing guide

Research direction

Start by comparing the proposed `interface MyInterface {}` syntax with the existing `abstract interface class MyInterface {}` form and the linked Dart mixin construct. Review the proposal's relationship to the moved lint proposal, then determine the language-specification and implementation work needed for the shorthand to behave equivalently.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.