Skip to content

Non-nullable type used in examples #2342

Closed
@jmewes

Description

@jmewes

Observed

The Dart Language Specification contains the following statement in the section "Classes > Instance Methods > The Method noSuchMethod":

Note that it must be a method that accepts one positional argument, in order to correctly override noSuchMethod in Object. For instance, it can have signature noSuchMethod(Invocation i) or noSuchMethod(Object i, [String s]),

However, if a method has the signature noSuchMethod(Object i, [String s]), it yields a compiler error:

compiler-error

Expected

Probably the example is outdated and should use a nullable type for the second parameter.

References

Metadata

Metadata

Assignees

Labels

bugThere is a mistake in the language specification or in an active documentspecification

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions