typechecking Questions

1

I'm currently building a type checking library that supports checking variables from another realm (a.k.a. different context). For basic types like string and number, I can simply use the typeof o...
Giesecke asked 7/6, 2020 at 7:50

3

I need to write a C macro that checks to ensure all parameters passed to it are unsigned and of the same integer type. Ex: all input params are uint8_t, or all uint16_t, or all uint32_t, or all uin...
Bleier asked 10/3, 2020 at 4:38

2

I'm trying out Sorbet in an experimental open-source project (ruby_crystal_codemod). I can't figure out how to get the type-checking to work with some RSpec tests in a nested test project. When I r...
Fastigiate asked 8/12, 2019 at 10:13

3

Solved

I'm implementing TypeScript support into my application Data-Forge Notebook. I need to compile, type check and evaluate snippets of TypeScript code. Compilation appears to be no problem, I'm usin...

3

Solved

Need a way to check if an object is an instance of any class in some particular module. I know I can do it by explicitly importing every class from that module and checking with a tuple: from my_...
Dannielledannon asked 28/1, 2013 at 20:39

5

Solved

I'm slowly falling in love with Erlang, and only have one big, BIG problem. I'm a big fan of languages like Standart ML and ocaml with their strong static typechecking. is there a nice and clean ...
Crandale asked 14/12, 2011 at 14:57

2

As I understand from tutorial pnpm creates symlinked .registry.npmjs.org and other entries point under node_modules. My project is on typescript and I have @types for typings in node_modules. But t...
Midinette asked 2/8, 2018 at 21:30

4

Solved

I have a string serialization utility that takes a variable of (almost) any type and converts it into a string. Thus, for example, according to my convention, an integer value of 123 would be seria...
Epirogeny asked 16/4, 2009 at 8:20

5

Solved

In ActionScript, it is possible to check the type at run-time using the is operator: var mySprite:Sprite = new Sprite(); trace(mySprite is Sprite); // true trace(mySprite is DisplayObject);// tr...
Oribel asked 8/10, 2012 at 20:47

5

Solved

I have an enum like this @enum.unique class TransactionTypes(enum.IntEnum): authorisation = 1 balance_adjustment = 2 chargeback = 3 auth_reversal = 4 Now i am assigning a variable with this...
Louanneloucks asked 15/7, 2016 at 10:32

8

Solved

Refused to execute script from because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled I am trying to setup react routing which works when I click on somethi...
Holograph asked 10/4, 2018 at 18:27

4

Solved

How can I check if an object is orderable/sortable in Python? I'm trying to implement basic type checking for the __init__ method of my binary tree class, and I want to be able to check if the val...
Abysmal asked 27/10, 2013 at 3:19

2

Solved

Looking for help in getting the type errors, reported by the TypeScript compiler, into the output of ESLint. The library typescript-eslint (https://github.com/typescript-eslint/typescript-eslint/bl...
Fillet asked 3/3, 2020 at 20:21

1

Solved

TypeScript has is operator which helps to create a test function for type checking. Recently I saw two different implementations of this operator, one of which uses asserts keyword. I didn't find i...
Moritz asked 31/1, 2022 at 18:46

20

Solved

I have an array that is made up of AnyObject. I want to iterate over it, and find all elements that are array instances. How can I check if an object is of a given type in Swift?
Roger asked 6/6, 2014 at 23:4

3

Solved

I am trying to use python3 type annotation features. Here is some toy functions without annotation: def fa(func, *args): return func(*args) def fb(x:str): return x + " returned." fa(fb, "Newton...
Franke asked 13/12, 2014 at 16:25

1

Solved

I know in TypeScript we can enforce specific strings like so: const myStrings = ['foo', 'bar', 'baz'] as const; type MyStringTypes = typeof myStrings[number]; However, what I would need is to enfo...
Possessed asked 19/8, 2021 at 10:59

3

Solved

Suppose I have an attribute called phone number and I would like to enforce certain validity on the entries to this field. Can I use regular expression for this purpose, since Regular Expression is...
Galantine asked 14/4, 2013 at 22:50

0

In theory, you should be able to do this by using references to make a top-level tsconfig file that includes paths to all of the different typescript projects you want to check, setting "compo...
Ocko asked 14/4, 2021 at 0:16

1

Solved

I thought I could always put undefined in same place where I don't know yet what to put, and the code should compile fine, the error happening at run time only if that undefined is actually eveluat...
Houseline asked 31/3, 2021 at 16:56

9

Solved

Before I look through my generic data structure for a value's index, I'd like to see if it is even an instance of the type this has been parametrized to. But Eclipse complains when I do this: @Ov...
Wince asked 15/10, 2009 at 3:0

14

Solved

When trying to understand a program, or in some corner-cases, it's useful to find out what type something is. I know the debugger can show you some type information, and you can usually rely on typ...
Maidie asked 7/6, 2014 at 20:46

1

Solved

You can ignore mypy checks on a individual lines as answered here. Is there a way to ignore mypy for a full function?
Singe asked 16/2, 2021 at 10:16

3

Solved

scala> class A defined class A scala> class B defined class B scala> val a: A = new A a: A = A@551510e8 scala> a match { | case _: B => println("unlikely") | case _ => printl...

2

When I write a TypeScript library with generic constraints, I'd like to be able to specify tests of code that should type check and code that should not (because, say, I want to make sure the type ...
Pollard asked 5/7, 2018 at 14:47

© 2022 - 2024 — McMap. All rights reserved.