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

  • Home
  • SEARCH
  • 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 8811227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:18:38+00:00 2026-06-14T03:18:38+00:00

I have stumbled into some difficulty trying to use an interface that defines an

  • 0

I have stumbled into some difficulty trying to use an interface that defines an indexer and using it with the system type number[]. The reason for the interface is that I wish to be able to pass any type that has a numeric indexer than returns a number, as is the case for both number[] and also typed array instances.

Consider:

interface IIndexedNumeric
{
    [index: number]: number;
}

class buffer {
    // ... 
    push(vals: IIndexedNumeric) { ... }
}

// problem usage:
var ary: number[] = [1,2,3];
var foo = new buffer();

foo.push(ary); // error
//  Supplied parameters do not match any signature of call target:
//  Could not apply type 'IIndexedNumeric' to argument 1, which is of type 'number[]'   

Should this occur? It seems that number[] should fully structurally implement IIndexedNumeric. If I’ve simply botched something, please help me see my error. If not, could you think of a workaround?

  • 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-06-14T03:18:39+00:00Added an answer on June 14, 2026 at 3:18 am

    I’m not entirely sure but I believe this is a bug. The spec states that an array type literal is equivalent to an object type with an index signature [index: number]: ElementType, where ElementType in your case is number. The array type has additional properties corresponding to Array.prototype.* but this shouldn’t affect assignment compatibility with just an indexer. If you would, please file a bug on CodePlex about this.

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

Sidebar

Related Questions

I've stumbled into a tiny problem, which, for some reason, i have no idea
I'm trying to translate a Verilog program into VHDL and have stumbled across a
While trying to get comfortable with boost , stumbled into problem with using boost::function
I have stumbled into the :not() selector on day 12 of Jquery. I would
I have some problems importing an existing C++ project into my XCode. I already
We have a C# logging class that uses System.Diagnostics.StackTrace and StackFrame to obtain information
I have some XML which I would like to serialize into a class. <Group>
Some of you might have stumbled upon this cute article - http://igoro.com/archive/quicksort-killer/ \ What
After being recommended to use adehabitat to calculate volume of intersection I have stumbled
I'm currently learning Hibernate, and I've stumbled into this issue: I have defined 3

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.