Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repr trait on a class definition after a forward declaration doesn't take affect #4385

Closed
p6rt opened this issue Jul 8, 2015 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jul 8, 2015

Migrated from rt.perl.org#125574 (status was 'resolved')

Searchable as RT125574$

@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

From @hoelzro

See the attached test script.

If I forward declare a class, like so​:

  class Foo { ... }

...and define the class later on, in addition to using the repr trait​:

  class Foo is repr('CPointer') { ... }

...the repr trait takes no effect. If this is the intended behavior, a warning or error should probably be emitted.

@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

From @hoelzro

use Test;

plan 1;

class Foo { ... }

class Foo is repr('CPointer') {
}

is Foo.REPR, 'CPointer';

@p6rt
Copy link
Author

p6rt commented Jul 9, 2015

From @jnthn

On Tue Jul 07 22​:02​:46 2015, rob@​hoelz.ro wrote​:

See the attached test script.

If I forward declare a class, like so​:

class Foo { ... }

...and define the class later on, in addition to using the repr trait​:

class Foo is repr('CPointer') { ... }

...the repr trait takes no effect. If this is the intended behavior,
a warning or error should probably be emitted.

Yes, it's intended; we have to pick a representation at the point we create the type object. Made it an error now, and added a test in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Jul 9, 2015

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 9, 2015

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jul 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant