E0027#
Warning name: deprecated_syntax
The syntax is deprecated. Please refer to the warning message on the reason and potential fix.
For example, one deprecated usage is declaring a polymorphic function as
fn f[T]. Instead, write the type parameters before the function name, as in
fn[T] f.
Erroneous example#
fn identity[T](value : T) -> T {
//
// Warning: The syntax fn f[..] for declaring polymorphic function is
// deprecated. Use fn[..] f instead.
value
}
fn main {
println(identity("Hello, world!"))
}
Suggestion#
Migrate the code according to the warning message. In this case, move the type parameter list before the function name.
///|
fn[T] identity(value : T) -> T {
value
}
///|
fn main {
println(identity("Hello, world!"))
}