Skip to content

Conversation

@sobolevn
Copy link
Contributor

Since this is my first contribution to Elixir (which I always loved), I am not really sure about the process :)

Should I also add a CHANGELOG entry? From the history it seems that not all people do that.

One extra question: now tests start to show warnings:

» make test
Generated elixir app
==> elixir (eunit)
warning: single quotes around calls are deprecated. Use double quotes instead.
└─ nofile:1:8

warning: single quotes around atoms are deprecated. Use double quotes instead.
└─ nofile:1:1

  All 126 tests passed.

But, I fail to find the source code for them. Any ideas?

Closes #13958

@josevalim
Copy link
Member

Well done! I have added some comments. We will also need to deprecate keywords, such as ['foo': :bar].

But, I fail to find the source code for them. Any ideas?

See atom_test.erl!

@sobolevn
Copy link
Contributor Author

We will also need to deprecate keywords, such as ['foo': :bar].

iex(1)> ['foo': :bar]
warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead.
You may run "mix format --migrate" to fix this warning automatically.
└─ iex:1:2

warning: found quoted keyword "foo" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of ASCII letters, numbers, and underscores and not beginning with a number do not require quotes
└─ iex:1:3

[foo: :bar]

Looks like they are already deprecated, but it seems like the error message is not quite right. Because using ~c here is not possible AFAIK:

iex(2)> [~c"foo": :bar]
** (SyntaxError) invalid syntax found on iex:2:9:
    error: unexpected token: ":" (column 9, code point U+003A)2[~c"foo": :bar]^
    │
    └─ iex:2:9

Other comments are addressed, thanks a lot for the quick review!

@josevalim
Copy link
Member

@sobolevn thank you, I will take a look at the incorrect deprecation then.

@josevalim josevalim merged commit 1ab6cdc into elixir-lang:main Dec 10, 2024
9 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Deprecate ' in atoms and quoted calls

2 participants