Skip to content

An annotation naming a generic type without arguments takes them from the initializer (#2144, part A) - #2146

Merged
ehartford merged 1 commit into
fix-2137from
bare-generic-annotation
Oct 5, 2026
Merged

ehartford merged 1 commit into
fix-2137from
bare-generic-annotation

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

let xs: Vec = [1, 2, 3] is Vec[i32]; likewise HashSet, BTreeSet, HashMap, BTreeMap from their literals, and let found: Option = Some(7), let pair: Pair = Pair { … } from a value of that generic type. It was "type mismatch in binding" for the literal and an internal compiler error for Option. A value of another type is refused by name. README's ownership example drops [i32].

Part B of #2144 (let xs = [1, 2, 3] becoming a Vec where its uses demand one) changes §4.3c and waits for blessed words.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant