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

Coercer syntax doesn't check for definedness #3675

Closed
p6rt opened this issue Feb 9, 2015 · 4 comments
Closed

Coercer syntax doesn't check for definedness #3675

p6rt opened this issue Feb 9, 2015 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Feb 9, 2015

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

Searchable as RT123770$

@p6rt
Copy link
Author

p6rt commented Feb 9, 2015

From @lizmat

[15​:31​:47] <lizmat> m​: sub a(Int(Cool​:D) $a) { say $a }; a Cool # feels this should fail
[15​:31​:48] <+camelia> rakudo-moar d29715​: OUTPUT«use of uninitialized value of type Cool in numeric context in sub a at /tmp/L77KWsiM9N​:1␤␤0␤»
[15​:32​:03] <lizmat> or complain about the :D in the coercer
[15​:32​:16] <lizmat> std​: sub a(Int(Cool​:D) $a) { say $a }; a Cool
[15​:32​:18] <+camelia> std f9b7f55​: OUTPUT«ok 00​:01 141m␤»
[15​:33​:06] <lizmat> m​: sub a(Cool​:D $a as Int) { say $a }; a Cool # should fail like this
[15​:33​:06] <+camelia> rakudo-moar d29715​: OUTPUT«Parameter '$a' requires an instance, but a type object was passed␤ in sub a at /tmp/D5UepJwrRP​:1␤ in block <unit> at /tmp/D5UepJwrRP​:1␤␤»
[15​:33​:30] <timotimo> sounds reasonable to me, maybe someone could rakudobug it
[15​:33​:50] <lizmat> I will
[15​:34​:12] <jnthn> lizmat​: Yeah...which in turn really wants definedness types to become first class too...

@p6rt
Copy link
Author

p6rt commented Sep 23, 2017

From @skids

On Mon, 09 Feb 2015 06​:35​:57 -0800, elizabeth wrote​:

[15​:31​:47] <lizmat> m​: sub a(Int(Cool​:D) $a) { say $a }; a Cool
# feels this should fail
[15​:31​:48] <+camelia> rakudo-moar d29715​: OUTPUT«use of
uninitialized value of type Cool in numeric context in sub a at
/tmp/L77KWsiM9N​:1␤␤0␤»
[15​:32​:03] <lizmat> or complain about the :D in the coercer
[15​:32​:16] <lizmat> std​: sub a(Int(Cool​:D) $a) { say $a }; a Cool
[15​:32​:18] <+camelia> std f9b7f55​: OUTPUT«ok 00​:01 141m␤»
[15​:33​:06] <lizmat> m​: sub a(Cool​:D $a as Int) { say $a }; a Cool
# should fail like this
[15​:33​:06] <+camelia> rakudo-moar d29715​: OUTPUT«Parameter '$a'
requires an instance, but a type object was passed␤ in sub a at
/tmp/D5UepJwrRP​:1␤ in block <unit> at /tmp/D5UepJwrRP​:1␤␤»
[15​:33​:30] <timotimo> sounds reasonable to me, maybe someone could
rakudobug it
[15​:33​:50] <lizmat> I will
[15​:34​:12] <jnthn> lizmat​: Yeah...which in turn really wants
definedness types to become first class too...

Some cases of this work now, and the rest are covered by RT#​126433.
Tests were rearranged to reflect this in roast commit 574035ff4,
so resolving this ticket and leaving RT#​126433 for the outstanding issues.

@p6rt
Copy link
Author

p6rt commented Sep 23, 2017

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

@p6rt
Copy link
Author

p6rt commented Sep 23, 2017

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

@p6rt p6rt closed this as completed Sep 23, 2017
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