types.aug
Generic types and functions · Source and specification
Code
aug
// aug-spec: "types.aug.md" explains this file. Read it before changes; refresh with aug spec.
interface Formatter:
format<T>(T value) returns string
title():
return "formatted"
TextFormatter() implements Formatter:
format<T>(T value):
return "generic method called"
Box<T>(T value) implements IBox<T>:
get():
return value
interface IBox<T>:
get() returns Taug
// aug-spec: "types.aug.md" explains this file. Read it before changes; refresh with aug spec.
interface Formatter {
format<T>(T value) returns string
title() {
return "formatted"
}
}
TextFormatter() implements Formatter {
format<T>(T value) {
return "generic method called"
}
}
Box<T>(T value) implements IBox<T> {
get() {
return value
}
}
interface IBox<T> {
get() returns T
}Compiled specification
Formatter · interface · source
Formatter.format · source
The type parameters are T. It takes value as T. It returns string.
Formatter.title · source
It returns "formatted". source
Checked interface
text
title() returns stringTextFormatter · class · source
It implements Formatter. It inherits the default implementations of Formatter.title.
TextFormatter.format · source
It takes value as T. It returns "generic method called". source
Checked interface
text
format<T>(T value) returns stringThe type parameters are T. It takes value as T.
Box · class · source
It implements IBox<T>. The type parameters are T. It takes value as T, kept read-only.
Box.get · source
It returns value. source
Checked interface
text
get() returns TIBox · interface · source
The type parameters are T.
IBox.get · source
It returns T.