D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3802 - Error message without line number when using struct initializers for a struct with constructors.
Summary: Error message without line number when using struct initializers for a struct...
Status: RESOLVED DUPLICATE of issue 3662
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-14 07:49 UTC by Sönke Ludwig
Modified: 2015-06-09 01:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Sönke Ludwig 2010-02-14 07:49:21 UTC
Using the struct initializer syntax which is now forbidden for structs with constructors results in an error message without line number information.

---
struct test {
	int f;

	this(int x){
		f = x;
	}
}

immutable test t2 = {1};
---

output:
Error: struct test has constructors, cannot use { initializers }, use test( initializers ) instead
Comment 1 Don 2010-02-15 02:03:08 UTC

*** This issue has been marked as a duplicate of issue 3662 ***