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

Subset name omitted from error when typecheck fails #1468

Closed
p6rt opened this issue Jan 3, 2010 · 6 comments
Closed

Subset name omitted from error when typecheck fails #1468

p6rt opened this issue Jan 3, 2010 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jan 3, 2010

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

Searchable as RT71820$

@p6rt
Copy link
Author

p6rt commented Jan 3, 2010

From publiustemp-perl6internals2@yahoo.com

For this code​:

  use v6;

  class Foo {
  subset Filename of Str where { $_ ~~ :f }
  has Filename $.filename is rw;
  }
  my $foo = Foo.new(filename => 'no_such_file');

We get this error​:

  Assignment type check failed; expected , but got Str
  in Main (file <unknown>, line <unknown>)

This fails in master at db84bc06990c37b93fe987dcffab4ed9bf31de92

Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog - http://use.perl.org/~Ovid/journal/
Twitter - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6

@p6rt
Copy link
Author

p6rt commented Aug 12, 2010

From @coke

On Sun Jan 03 06​:02​:05 2010, publiustemp-perl6internals2@​yahoo.com wrote​:

For this code​:

use v6;

class Foo {
subset Filename of Str where { $_ ~~ :f }
has Filename $.filename is rw;
}
my $foo = Foo.new(filename => 'no_such_file');

We get this error​:

Assignment type check failed; expected , but got Str
in Main (file <unknown>, line <unknown>)

This fails in master at db84bc06990c37b93fe987dcffab4ed9bf31de92

Cheers,
Ovid

This no longer fails at all, which seems wrong. (exits successfully, printing nothing.)

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Aug 12, 2010

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

@p6rt
Copy link
Author

p6rt commented Sep 29, 2011

From @jnthn

On Sun Jan 03 06​:02​:05 2010, publiustemp-perl6internals2@​yahoo.com wrote​:

For this code​:

use v6;

class Foo {
subset Filename of Str where { $_ ~~ :f }
has Filename $.filename is rw;
}
my $foo = Foo.new(filename => 'no_such_file');

We get this error​:

Assignment type check failed; expected , but got Str
in Main (file <unknown>, line <unknown>)

This fails in master at db84bc06990c37b93fe987dcffab4ed9bf31de92

After updating the example (should be where { .IO ~~ :f } these days),
it does far better​:

Type check failed in assignment to '$!filename'; expected 'Filename' but
got 'Str'

Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

From @moritz

now tested in S12-subset/subtypes.t

@p6rt
Copy link
Author

p6rt commented Oct 5, 2011

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

@p6rt p6rt closed this as completed Oct 5, 2011
@p6rt p6rt added the testneeded label Jan 5, 2020
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