Bug 23505 – `with` cannot be used with built-in types

Status
NEW
Severity
enhancement
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-11-24T10:05:22Z
Last change time
2024-12-13T19:25:53Z
Assigned to
No Owner
Creator
Bolpat
Moved to GitHub: dmd#20192 →

Comments

Comment #0 by qs.il.paperinik — 2022-11-24T10:05:22Z
`with (int) { }` does not parse and `alias Int = int; with (Int) { }` does not compile, saying that "`with` type `int` has no members". This is nonsense in two ways: 1. Even if `int` has no members, I should be able to write this. Generic code might do that. 2. And `int` does at least appear to have members: `min`, `max`, `init` are some obvious ones. For `double`, there are even more interesting members, like `nan`, `infinity`, and `epsilon`. See https://dlang.org/spec/property.html
Comment #1 by robert.schadek — 2024-12-13T19:25:53Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20192 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB