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

definedness constraint mismatches reported incorrectly #4569

Closed
p6rt opened this issue Sep 20, 2015 · 6 comments
Closed

definedness constraint mismatches reported incorrectly #4569

p6rt opened this issue Sep 20, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Sep 20, 2015

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

Searchable as RT126124$

@p6rt
Copy link
Author

p6rt commented Sep 20, 2015

From zefram@fysh.org

$ ./perl6 -e 'sub aa (Mu​:D $a) { }; aa(Int)'
Parameter '$a' requires an instance of type Int, but a type object was passed. Did you forget a .new?
  in sub aa at -e​:1
  in block <unit> at -e​:1
$ ./perl6 -e 'sub aa (Mu​:U $a) { }; aa(3)'
Parameter '$a' requires a type object of type Int, but an object instance was passed. Did you forget a 'multi'?
  in sub aa at -e​:1
  in block <unit> at -e​:1

In both cases it is correct to get an error of this general type,
regarding the definedness constraint. But the desired type is
misreported​: the class of the argument passed, rather than the desired
class, is being stated.

-zefram

@p6rt
Copy link
Author

p6rt commented Aug 24, 2016

From @zoffixznet

Fixed in rakudo/rakudo#845

Tests added in Raku/roast@c0feebdbb1

@p6rt
Copy link
Author

p6rt commented Aug 24, 2016

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

@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

From @usev6

With Rakudo commit we get the same output on MoarVM and JVM​:

$ ./perl6-j -e 'sub aa (Mu​:D $a) { }; aa(Int)'
Parameter '$a' requires an instance of type Mu, but a type object was passed. Did you forget a .new?
  in sub aa at -e line 1
  in block <unit> at -e line 1

$ ./perl6-j -e 'sub aa (Mu​:U $a) { }; aa(3)'
Parameter '$a' requires a type object of type Mu, but an object instance was passed. Did you forget a 'multi'?
  in sub aa at -e line 1
  in block <unit> at -e line 1

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

From @usev6

With Rakudo commit we get the same output on MoarVM and JVM​:

$ ./perl6-j -e 'sub aa (Mu​:D $a) { }; aa(Int)'
Parameter '$a' requires an instance of type Mu, but a type object was passed. Did you forget a .new?
  in sub aa at -e line 1
  in block <unit> at -e line 1

$ ./perl6-j -e 'sub aa (Mu​:U $a) { }; aa(3)'
Parameter '$a' requires a type object of type Mu, but an object instance was passed. Did you forget a 'multi'?
  in sub aa at -e line 1
  in block <unit> at -e line 1

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant