Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6ed81a0

Browse files
committedJan 29, 2017
deprecate special "inner constructor" syntax. part of #11310
1 parent a087c38 commit 6ed81a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+241
-191
lines changed
 

‎NEWS.md

+12
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ New language features
2020
Language changes
2121
----------------
2222

23+
* "Inner constructor" syntax for parametric types is deprecated. For example,
24+
in this definition:
25+
```
26+
type Foo{T}
27+
x
28+
Foo(x) = new(x)
29+
end
30+
```
31+
the syntax `Foo(x) = new(x)` actually defined a constructor for `Foo{T}`,
32+
i.e. the case where the type parameter is specified. For clarity, this
33+
definition now must be written as `Foo{T}(x) where T = new(x)`. ([#11310])
34+
2335
* Multi-line and single-line nonstandard command literals have been added. A
2436
nonstandard command literal is like a nonstandard string literal, but the
2537
syntax uses backquotes (``` ` ```) instead of double quotes, and the

‎base/LineEdit.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -1014,10 +1014,10 @@ type HistoryPrompt{T<:HistoryProvider} <: TextInterface
10141014
hp::T
10151015
complete
10161016
keymap_dict::Dict{Char,Any}
1017-
HistoryPrompt(hp) = new(hp, EmptyCompletionProvider())
1017+
HistoryPrompt{T}(hp) where T<:HistoryProvider = new(hp, EmptyCompletionProvider())
10181018
end
10191019

1020-
HistoryPrompt{T<:HistoryProvider}(hp::T) = HistoryPrompt{T}(hp)
1020+
HistoryPrompt(hp::T) where T<:HistoryProvider = HistoryPrompt{T}(hp)
10211021
init_state(terminal, p::HistoryPrompt) = SearchState(terminal, p, true, IOBuffer(), IOBuffer())
10221022

10231023
type PrefixSearchState <: ModeState
@@ -1054,10 +1054,11 @@ type PrefixHistoryPrompt{T<:HistoryProvider} <: TextInterface
10541054
parent_prompt::Prompt
10551055
complete
10561056
keymap_dict::Dict{Char,Any}
1057-
PrefixHistoryPrompt(hp, parent_prompt) = new(hp, parent_prompt, EmptyCompletionProvider())
1057+
PrefixHistoryPrompt{T}(hp, parent_prompt) where T<:HistoryProvider =
1058+
new(hp, parent_prompt, EmptyCompletionProvider())
10581059
end
10591060

1060-
PrefixHistoryPrompt{T<:HistoryProvider}(hp::T, parent_prompt) = PrefixHistoryPrompt{T}(hp, parent_prompt)
1061+
PrefixHistoryPrompt(hp::T, parent_prompt) where T<:HistoryProvider = PrefixHistoryPrompt{T}(hp, parent_prompt)
10611062
init_state(terminal, p::PrefixHistoryPrompt) = PrefixSearchState(terminal, p, "", IOBuffer())
10621063

10631064
write_prompt(terminal, s::PrefixSearchState) = write_prompt(terminal, s.histprompt.parent_prompt)

0 commit comments

Comments
 (0)
Please sign in to comment.