Skip to content

Conversation

suo
Copy link
Member

@suo suo commented Mar 16, 2019

Stack from ghstack:

Occasionally the compiler can insert constant Nones to make types line
up. In that case, don't try to make a pointer from the optional type to
None, since we know statically that None won't be mutated or whatever.

Differential Revision: D14493004

Occasionally the compiler can insert constant Nones to make types line
up. In that case, don't try to make a pointer from the optional type to
None, since we know statically that None won't be mutated or whatever.
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 16, 2019
Copy link
Collaborator

@jamesr66a jamesr66a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i guess

return;
}

// Special case: if `from` is an optional, `to` could be a None. Don't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we handle this more generally by returning if !shouldAnnotate(to)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, having from be mutable and to be immutable would be a bug, so I prefer to throw in that case. But I think we should make that explicit with an assertion (which would have made this bug a lot easier to track down in the first place).

@zou3519 zou3519 deleted the gh/suo/2/head branch March 25, 2019 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants