Skip to content

RTInfo generation can fail for structs defined in imported modules #18614

@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

Rainer Schuetze (@rainers) reported this on 2013-06-22T01:34:11Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=10442

CC List

  • Mike Franklin

Description

The current default implementation for template RTInfo always sets the value 0x12345678, so this should work:

////////////////
module s;

struct S
{
	int x;
	void* p;
}

///////////////
module test;

import s;

struct T
{
	int x;
	void* p;
}

void main()
{
	assert(typeid(T).rtInfo == cast(void*)0x12345678); // ok
	assert(typeid(S).rtInfo == cast(void*)0x12345678); // fails
}

////////////////
but the second assertion triggers if compiled with

dmd test.d

If you add s.d to the command line, it does not fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions