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

StringTokens not seen as subtype of {Object*} #1106

Closed
lucaswerkmeister opened this issue Oct 2, 2014 · 4 comments
Closed

StringTokens not seen as subtype of {Object*} #1106

lucaswerkmeister opened this issue Oct 2, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@lucaswerkmeister
Copy link
Member

void run() {
    Anything split = "Hello World!".split();
    print(split is {Object*});
}

Expected: true
Actual: false

Found in eclipse-archived/ceylon-ide-eclipse#987, where we use String.split() (not yet committed), which is then not recognized here.

I stepped into the subtyping algorithm a bit, and apparently StringTokensAbsent type parameter is somehow widened (during the check! it’s okay in the original descriptor) from Null to Object, which is of course not a subtype of {Object*}’s Null.

lucaswerkmeister added a commit to eclipse-archived/ceylon-ide-eclipse that referenced this issue Oct 2, 2014
The previous fix (677b021) wasn't enough - it still broke when the
option was 'all'. To truly fix this, we need to be able to disable the
text preference when it's created, before its listeners are attached.
(Some other tabs can apparently enable and disable preferences during
initialization without update problems - my best guess is that it's only
problematic for string properties, but I didn't investigate it too
much.)

Also, the handling of this "union" option was pretty broken. Now we
simply display 'all' in the text field when 'all' is checked (which makes
sense because that's what we'll write to the config file). When that
checkbox is unchecked, we insert the default inline annotations into the
textfield.

Also fixes the validity test. It's allowed to declare any annotations as
inline, so we shouldn't have a list of "allowed" annotations; instead,
we now only check if it's a valid annotation name.

Includes a workaround for ceylon/ceylon-spec#1106.
@gavinking
Copy link
Member

Surely this bug belongs in ceylon.language, no?

@lucaswerkmeister
Copy link
Member Author

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No idea… StringTokens does have reified type arguments String and
Null, so there was no obvious error to me.

On 03.10.2014 01:14, Gavin King wrote:

Surely this bug belongs in |ceylon.language|, no?

— Reply to this email directly or view it on GitHub
#1106 (comment).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBAgAGBQJULdywAAoJEOkUbI/rtXZKxNkH/jvroAhHxjhq2Y26rfQBt9zg
C8FzaPiVVUV0dWFe5pTdFiKbmq6E+xdg3qXd4Ti3ftxX4hHhYGwnWMSbKDxmMmgb
Z/sdJnCK6FZX/2lBB7o2QELQAcq4Na1VIHlZixWbgpGvZ/Q6ZliroxqYLBdjv9W1
Au5r6w8BiAuFqc9oA7bCMRMBHd1OPNNEezxhDm4W9JaEmOl3xLBWZpYw041XpxDN
vWWOj2X+DeOAS1vx6b9vi2u97Rk6CEIHcOT/3xsNJUVhDySXPdOiO1QB5BvFzRRx
HALIRGwOfk6ldzprpaI7Izvu5q99LuUoRxlTZ+/bOH2mCHgU424rJ9dKqujgX8g=
=NX93
-----END PGP SIGNATURE-----

@gavinking
Copy link
Member

That probably fixed it.

@gavinking gavinking added this to the 1.1 milestone Oct 2, 2014
@gavinking gavinking self-assigned this Oct 2, 2014
@gavinking gavinking added the bug label Oct 2, 2014
@lucaswerkmeister
Copy link
Member Author

Works great, thanks!

lucaswerkmeister added a commit to eclipse-archived/ceylon-ide-eclipse that referenced this issue Oct 3, 2014
lucaswerkmeister added a commit to eclipse-archived/ceylon-ide-eclipse that referenced this issue Jan 9, 2015
The previous fix (677b021) wasn't enough - it still broke when the
option was 'all'. To truly fix this, we need to be able to disable the
text preference when it's created, before its listeners are attached.
(Some other tabs can apparently enable and disable preferences during
initialization without update problems - my best guess is that it's only
problematic for string properties, but I didn't investigate it too
much.)

Also, the handling of this "union" option was pretty broken. Now we
simply display 'all' in the text field when 'all' is checked (which makes
sense because that's what we'll write to the config file). When that
checkbox is unchecked, we insert the default inline annotations into the
textfield.

Also fixes the validity test. It's allowed to declare any annotations as
inline, so we shouldn't have a list of "allowed" annotations; instead,
we now only check if it's a valid annotation name.

Includes a workaround for ceylon/ceylon-spec#1106.
lucaswerkmeister added a commit to eclipse-archived/ceylon-ide-eclipse that referenced this issue Jan 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants