Julia: Allow line break before `where` keyword

Created on 17 Mar 2019  路  2Comments  路  Source: JuliaLang/julia

Valid syntax:

function myfunc(x::T) where {T}
    x
end

Invalid syntax:

function myfunc2(x::T)
    where {T}
    x
end

Error message for invalid syntax

ERROR: LoadError: syntax: space before "{" not allowed in "where {"
parser

Most helpful comment

Valid syntax

function myfunc2(x::T)
    where{T}
    x
end

All 2 comments

Valid syntax

function myfunc2(x::T)
    where{T}
    x
end

That鈥檚 funny. Would be nice to allow the where on the next line if possible.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yurivish picture yurivish  路  3Comments

ararslan picture ararslan  路  3Comments

sbromberger picture sbromberger  路  3Comments

arshpreetsingh picture arshpreetsingh  路  3Comments

dpsanders picture dpsanders  路  3Comments