7272 – `out` section makes return type `const` in `return` statement

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7272 - `out` section makes return type `const` in `return` statement
Summary: `out` section makes return type `const` in `return` statement
Status: RESOLVED DUPLICATE of issue 1313
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
Reported: 2012年01月11日 10:01 UTC by Denis Shelomovskii
Modified: 2012年01月12日 20:29 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Denis Shelomovskii 2012年01月11日 10:01:55 UTC
---
int* f() 
out { } // no errors with `out` section
body {
 immutable(int)* ptr;
 return ptr;
}
---
If `immutable(int)*` is changed to `immutable(void)*` we have the following error:
`Error: cannot implicitly convert expression (ptr) of type immutable(void)* to const(int*)` illustrating the issue. Note, that `typeof(f())` and `typeof(return)` are `int*`.
Maybe concerned with Issue 1313 
Comment 1 Kenji Hara 2012年01月12日 20:29:56 UTC
I've posted a patch to fix 1313, and confirmed that this is a dup of it.
*** This issue has been marked as a duplicate of issue 1313 ***


AltStyle によって変換されたページ (->オリジナル) /