Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6777123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:06:37+00:00 2026-05-26T16:06:37+00:00

In Eclipse, the following line of JavaScript var a1 = [[1, 2], [3, 4]];

  • 0

In Eclipse, the following line of JavaScript

var a1 = [[1, 2], [3, 4]];

generates the warnings:

Type mismatch: cannot convert from Number[] to any
Type mismatch: cannot convert from Number[] to any

while

var a2 = [['w', 'x'], ['y', 'z']];

generates:

Type mismatch: cannot convert from String[] to any
Type mismatch: cannot convert from String[] to any

and

var a3 = [[1, 2], ['y', 'z']];

generates:

Type mismatch: cannot convert from Number[] to any
Type mismatch: cannot convert from String[] to any

However, these lines are all okay:

var a4 = [[1, 'x'], [3, 'y']];
var a5 = [[1, 2]];
var a6 = [['x', 'y']];

There seems to be a problem with arrays of arrays, when the sub-arrays contain the same primitive type. However, I don’t understand why, and the code seems to execute okay. Can someone explain what Eclipse is worried about?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T16:06:38+00:00Added an answer on May 26, 2026 at 4:06 pm

    It looks like a bug. There is essentially no such thing as a type mismatch in Javascript.

    I would hazard a guess that the parser that is doing this was based on a Java parser, and this is a bit of that original parser peeking through.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have the following text in my Eclipse editor: Text Line 1 Text
Eclipse is showing the following errors in my Spring's applicationContext.xml : cvc-complex-type.2.4.c: The matching
Eclipse is giving me a warning of the following form: Type safety: Unchecked cast
I have a following problems with eclipse, when I installed ClearCase plugin from this
Why this line doesn't work? import static java.nio.file.AccessMode.*; Eclipse says: The import java.nio.file cannot
I am learning Scala with Scala-IDE in Eclipse. While following the Chapter 9: Control
I was given the following code, and Eclipse marked it (at the JPEGImageEncoder line)
Can someone shed more light the following warning from Eclipse: JList is a raw
I'm using the following org.eclipse.jface.viewers.CheckboxCellEditor.CheckboxCellEditor(Composite parent) I'm creating a table viewer with cellEditors and
I have the following setup: eclipse a standard Java project (A) an eclipse plugin

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.