- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
inferTypedPattern checkes
Mon, 2009-10-19, 23:42
I committed this patch for this ticket:
http://lampsvn.epfl.ch/trac/scala/changeset/19153
http://lampsvn.epfl.ch/trac/scala/ticket/2486
Obviously it doesn't make a huge amount of sense in its current form, as
most of the method turns into a no-op if it's only going to fail on
!isPlausiblyCompatible. I don't even know if using that method makes
any sense there - it's not documented but "plausibly compatible" is such
an enticing characterization.
It did make the code in 2486 work without breaking anything obvious, but
I'm all ears for any hints as to how it ought really to be.
Tue, 2009-10-20, 14:37
#2
Re: inferTypedPattern checkes
On Tue, Oct 20, 2009 at 09:14:03AM +0200, martin odersky wrote:
> And, remember, _every_ bit of the type checker has to be speced. A
> type-checker change is not valid without a spec change.
>
> I can look into it later this week if you assign to me.
Assigned. If it's at all reassuring I don't run around making casual
changes to the typer. I added 15 lines of comment for the 1 line of new
code to make sure it couldn't be missed, left the ticket open, and
called attention to it here on internals. It's just that the quest for
the zero defect pattern matcher takes me on a bit of the tour of the
rest of the system.
Tue, 2009-10-20, 14:47
#3
Re: inferTypedPattern checkes
On Tue, Oct 20, 2009 at 3:25 PM, Paul Phillips wrote:
> On Tue, Oct 20, 2009 at 09:14:03AM +0200, martin odersky wrote:
>> And, remember, _every_ bit of the type checker has to be speced. A
>> type-checker change is not valid without a spec change.
>>
>> I can look into it later this week if you assign to me.
>
> Assigned. If it's at all reassuring I don't run around making casual
> changes to the typer. I added 15 lines of comment for the 1 line of new
> code to make sure it couldn't be missed, left the ticket open, and
> called attention to it here on internals. It's just that the quest for
> the zero defect pattern matcher takes me on a bit of the tour of the
> rest of the system.
>
Yes, I appreciate that. It's just that I believe doing a type checker
change like this one is incomplete without an associated spec change.
Cheers
On Tue, Oct 20, 2009 at 12:41 AM, Paul Phillips wrote:
> I committed this patch for this ticket:
>
> http://lampsvn.epfl.ch/trac/scala/changeset/19153
> http://lampsvn.epfl.ch/trac/scala/ticket/2486
>
> Obviously it doesn't make a huge amount of sense in its current form, as
> most of the method turns into a no-op if it's only going to fail on
> !isPlausiblyCompatible. I don't even know if using that method makes
> any sense there - it's not documented but "plausibly compatible" is such
> an enticing characterization.
>
I don't think that's the right patch. I believe it's rather
isPopulated which is too strict
and the error message is wrong, too. isPlausiblyCompatible is an
approximation only; it's there because we want to save some cycles in
type inference by pruning obviously inapplicable branches of the
search tree. I would absolutely hate to have to specify what it does
in the SLS. And, remember, _every_ bit of the type checker has to be
speced. A type-checker change is not valid without a spec change.
I can look into it later this week if you assign to me.
Cheers