[Issue 21991] New: allocator.dispose does not work for array of qualified type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 4 13:30:48 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21991
Issue ID: 21991
Summary: allocator.dispose does not work for array of qualified
type
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: htvennik at gmail.com
std.experimental.allocator.dispose does not compile for arrays of qualified
type.
----
import std.experimental.allocator : makeArray, dispose;
import std.experimental.allocator.mallocator : Mallocator;
void main()
{
alias alloc = Mallocator.instance;
const(int)[] arr = alloc.makeArray!int(10);
alloc.dispose(arr);
}
----
/dlang/dmd/linux/bin64/../../src/phobos/std/experimental/allocator/package.d(2444):
Error: function
`std.experimental.allocator.mallocator.Mallocator.deallocate(void[] b) shared`
is not callable using argument types `(const(int)[]) shared`
/dlang/dmd/linux/bin64/../../src/phobos/std/experimental/allocator/package.d(2444):
cannot pass argument `array` of type `const(int)[]` to parameter `void[]
b`
onlineapp.d(9): Error: template instance
`std.experimental.allocator.dispose!(shared(Mallocator), const(int))` error
instantiating
--
More information about the Digitalmars-d-bugs
mailing list