Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MyType[:a :b; :c :d] is a syntax error on latest master #22840

Closed
dalum opened this issue Jul 17, 2017 · 1 comment
Closed

MyType[:a :b; :c :d] is a syntax error on latest master #22840

dalum opened this issue Jul 17, 2017 · 1 comment
Assignees
Labels
kind:regression Regression in behavior compared to a previous version parser Language parsing and surface syntax

Comments

@dalum
Copy link
Contributor

dalum commented Jul 17, 2017

In v0.6, this works:

struct MyType{T}
    value::T
end
Base.convert(::Type{MyType}, x::MyType) = x
Base.convert(::Type{MyType}, x) = MyType(x)
A = MyType[:a :b; :c :d]

to create a Matrix of MyTypes.

In latest master this gets interpreted as a slicing of some sort, I guess, because I get the following error:

ERROR: syntax: expected separator between arguments to "[ ]"; got ":a:"

Same thing for larger matrices of symbols. But

A = MyType[:a; :c]

has no such problems.

@fredrikekre
Copy link
Member

#22816 (comment)

@JeffBezanson JeffBezanson self-assigned this Jul 17, 2017
@JeffBezanson JeffBezanson added parser Language parsing and surface syntax kind:regression Regression in behavior compared to a previous version labels Jul 17, 2017
JeffBezanson added a commit that referenced this issue Jul 17, 2017
fix #22840, regression in parsing `[:a :b]`
jeffwong pushed a commit to jeffwong/julia that referenced this issue Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:regression Regression in behavior compared to a previous version parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

3 participants