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

Syntax Highlighting breaks on parametrised lambda #154

Open
merisbahti opened this issue Oct 24, 2018 · 2 comments
Open

Syntax Highlighting breaks on parametrised lambda #154

merisbahti opened this issue Oct 24, 2018 · 2 comments

Comments

@merisbahti
Copy link

This code breaks the syntax highlighter:

type Stuff<T> = {
  result: T                    
} | {
  error: string
} 
const apply = <T>(x: T, y: T, f: (xx: T, xy: T) => Stuff<T>): Stuff<T> => {
    return f(x, y)             
} 
console.log(apply(5, 2, (x, y) => ({result: x + y})))

Seems to break after

const apply = <T>[...etc]

screenshot 2018-10-24 at 09 58 58

@leafgarland
Copy link
Owner

Thanks for the bug report!

@OFRBG
Copy link

OFRBG commented Aug 11, 2019

Another case!

import t from 'io-ts';

export enum Entity {
  User,
  Client
}

const extendType = <T extends t.Props, K extends t.Props>(
  A: t.TypeC<T>,
  B: K
): t.TypeC<T & K> =>
  t.type({
    ...A.props,
    ...B
  });

const DBItem = t.type({
  id: t.string
});

Seems to break after T extends.

Bildschirmfoto 2019-08-10 um 20 22 00

Thanks for the plugin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants